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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EnemyAbilities.Abilities; using EntityStates; using EntityStates.AI.Walker; using EntityStates.BeetleMonster; using EntityStates.Bell.BellWeapon; using EntityStates.MajorConstruct.Weapon; using EntityStates.NullifierMonster; using EntityStates.Tanker; using EntityStates.Vulture; using Grumpy; using HarmonyLib; using IL.EntityStates.Tanker; using IL.RoR2; using IL.RoR2.Projectile; using JetBrains.Annotations; using KinematicCharacterController; using Microsoft.CodeAnalysis; using MiscFixes.Modules; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using Rewired.ComponentControls.Effects; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Scripts.GameBehaviors; using RoR2.Skills; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [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("EnemyAbilities")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c359de5a8c88d8e8d6611d1bf6e76bdcd89c6663")] [assembly: AssemblyProduct("EnemyAbilities")] [assembly: AssemblyTitle("EnemyAbilities")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EnemyAbilities { public static class EnemiesPlusUtils { public class ProjectileDetonateOnImpact : ProjectileExplosion, IProjectileImpactBehavior { public enum TransformSpace { World, Local, Normal } private Vector3 impactNormal = Vector3.up; public GameObject impactEffect; public NetworkSoundEventDef lifetimeExpiredSound; public float offsetForLifetimeExpiredSound; public bool destroyOnEnemy = true; public bool detonateOnEnemy; public bool detonateOnWorld; public bool destroyOnWorld; public bool destroyOnDistance; public float maxDistance; private float maxDistanceSqr; public bool impactOnWorld = true; public bool timerAfterImpact; public float lifetime; public float lifetimeAfterImpact; public float lifetimeRandomOffset; private float stopwatch; public uint minimumPhysicsStepsToKeepAliveAfterImpact; private float stopwatchAfterImpact; private bool hasImpact; private bool hasPlayedLifetimeExpiredSound; public TransformSpace transformSpace; private Vector3 startPos; public bool explodeOnLifeTimeExpiration; public bool nullifyExplosions = false; public override void Awake() { ((ProjectileExplosion)this).Awake(); lifetime += Random.Range(0f, lifetimeRandomOffset); } protected void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) startPos = ((Component)this).transform.position; maxDistanceSqr = maxDistance * maxDistance; } protected void FixedUpdate() { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0226: 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) stopwatch += Time.fixedDeltaTime; if (!NetworkServer.active && !base.projectileController.isPrediction) { return; } if (explodeOnLifeTimeExpiration && base.alive && stopwatch >= lifetime) { base.explosionEffect = impactEffect ?? base.explosionEffect; if (!nullifyExplosions) { ((ProjectileExplosion)this).Detonate(); } } if (timerAfterImpact && hasImpact) { stopwatchAfterImpact += Time.fixedDeltaTime; } bool flag = stopwatch >= lifetime; bool flag2 = timerAfterImpact && stopwatchAfterImpact > lifetimeAfterImpact; bool flag3 = Object.op_Implicit((Object)(object)base.projectileHealthComponent) && !base.projectileHealthComponent.alive; bool flag4 = false; if (destroyOnDistance) { Vector3 val = ((Component)this).transform.position - startPos; if (((Vector3)(ref val)).sqrMagnitude >= maxDistanceSqr) { flag4 = true; } } if (flag || flag2 || flag3 || flag4) { base.alive = false; } if (timerAfterImpact && hasImpact && minimumPhysicsStepsToKeepAliveAfterImpact != 0) { minimumPhysicsStepsToKeepAliveAfterImpact--; base.alive = true; } if (base.alive && !hasPlayedLifetimeExpiredSound) { bool flag5 = stopwatch > lifetime - offsetForLifetimeExpiredSound; if (timerAfterImpact) { flag5 |= stopwatchAfterImpact > lifetimeAfterImpact - offsetForLifetimeExpiredSound; } if (flag5) { hasPlayedLifetimeExpiredSound = true; if (NetworkServer.active && Object.op_Implicit((Object)(object)lifetimeExpiredSound)) { PointSoundManager.EmitSoundServer(lifetimeExpiredSound.index, ((Component)this).transform.position); } } } if (!base.alive) { base.explosionEffect = impactEffect ?? base.explosionEffect; if (!nullifyExplosions) { ((ProjectileExplosion)this).Detonate(); } } } public override Quaternion GetRandomDirectionForChild() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0054: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) Quaternion randomChildRollPitch = ((ProjectileExplosion)this).GetRandomChildRollPitch(); TransformSpace transformSpace = this.transformSpace; if (1 == 0) { } Quaternion result = (Quaternion)(transformSpace switch { TransformSpace.Local => ((Component)this).transform.rotation * randomChildRollPitch, TransformSpace.Normal => Quaternion.FromToRotation(Vector3.forward, impactNormal) * randomChildRollPitch, _ => randomChildRollPitch, }); if (1 == 0) { } return result; } public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (nullifyExplosions || !base.alive) { return; } Collider collider = impactInfo.collider; impactNormal = impactInfo.estimatedImpactNormal; if (!Object.op_Implicit((Object)(object)collider)) { return; } DamageInfo val = new DamageInfo(); if (Object.op_Implicit((Object)(object)base.projectileDamage)) { val.damage = base.projectileDamage.damage; val.crit = base.projectileDamage.crit; val.attacker = (Object.op_Implicit((Object)(object)base.projectileController.owner) ? base.projectileController.owner.gameObject : null); val.inflictor = ((Component)this).gameObject; val.damageType = base.projectileDamage.damageType; val.inflictor = ((Component)this).gameObject; val.position = impactInfo.estimatedPointOfImpact; val.force = base.projectileDamage.force * ((Component)this).transform.forward; val.procChainMask = base.projectileController.procChainMask; val.procCoefficient = base.projectileController.procCoefficient; val.damageType = base.projectileDamage.damageType; } HurtBox component = ((Component)collider).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (destroyOnEnemy) { HealthComponent healthComponent = component.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { if ((Object)(object)((Component)healthComponent).gameObject == (Object)(object)base.projectileController.owner || (Object.op_Implicit((Object)(object)base.projectileHealthComponent) && (Object)(object)healthComponent == (Object)(object)base.projectileHealthComponent)) { return; } base.alive = false; } } else if (detonateOnEnemy) { HealthComponent healthComponent2 = component.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent2) && (Object)(object)((Component)healthComponent2).gameObject != (Object)(object)base.projectileController.owner && (Object)(object)healthComponent2 != (Object)(object)base.projectileHealthComponent) { ((ProjectileExplosion)this).DetonateNoDestroy(); } } } else if (detonateOnWorld) { ((ProjectileExplosion)this).DetonateNoDestroy(); } else if (destroyOnWorld) { base.alive = false; } hasImpact = Object.op_Implicit((Object)(object)component) || impactOnWorld; if (NetworkServer.active && hasImpact) { GlobalEventManager.instance.OnHitAll(val, ((Component)collider).gameObject); } } } public static void ReorderSkillDrivers(this GameObject master, AISkillDriver targetSkill, int targetIdx) { AISkillDriver[] components = master.GetComponents(); master.ReorderSkillDrivers(components, Array.IndexOf(components, targetSkill), targetIdx); } public static void ReorderSkillDrivers(this GameObject master, AISkillDriver[] skills, int currentIdx, int targetIdx) { if (currentIdx < 0 || currentIdx >= skills.Length) { Log.Error($"{currentIdx} index not found or out of range. Must be less than {skills.Length}"); return; } string targetName = skills[currentIdx].customName; if (targetIdx < 0 || targetIdx >= skills.Length) { Log.Error($"Unable to reorder skilldriver {targetName} into position {targetIdx}. target must be less than {skills.Length}"); } else { if (targetIdx == currentIdx) { return; } Dictionary dictionary = skills.Where((AISkillDriver s) => (Object)(object)s.nextHighPriorityOverride != (Object)null).ToDictionary((AISkillDriver s) => s.customName, (AISkillDriver s) => s.nextHighPriorityOverride.customName); if (targetIdx > currentIdx) { master.AddComponentCopy(skills[currentIdx]); Object.DestroyImmediate((Object)(object)skills[currentIdx]); } for (int i = targetIdx; i < skills.Length; i++) { if (i != currentIdx) { master.AddComponentCopy(skills[i]); Object.DestroyImmediate((Object)(object)skills[i]); } } skills = master.GetComponents(); AISkillDriver val = ((IEnumerable)skills).FirstOrDefault((Func)((AISkillDriver s) => s.customName == targetName)); if (!dictionary.Any()) { return; } foreach (AISkillDriver val2 in skills) { if (Object.op_Implicit((Object)(object)val2) && dictionary.TryGetValue(val2.customName, out var target)) { AISkillDriver val3 = ((IEnumerable)skills).FirstOrDefault((Func)((AISkillDriver s) => s.customName == target)); if (!((Object)(object)val3 == (Object)null)) { val2.nextHighPriorityOverride = val3; } } } } } public static T GetCopyOf(this Component comp, T other) where T : Component { Type type = ((object)comp).GetType(); if (type != ((object)other).GetType()) { return default(T); } BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; PropertyInfo[] properties = type.GetProperties(bindingAttr); PropertyInfo[] array = properties; foreach (PropertyInfo propertyInfo in array) { if (propertyInfo.CanWrite) { try { propertyInfo.SetValue(comp, propertyInfo.GetValue(other, null), null); } catch { } } } FieldInfo[] fields = type.GetFields(bindingAttr); FieldInfo[] array2 = fields; foreach (FieldInfo fieldInfo in array2) { fieldInfo.SetValue(comp, fieldInfo.GetValue(other)); } return (T)(object)((comp is T) ? comp : null); } public static T AddComponentCopy(this GameObject go, T toAdd) where T : Component { return ((Component)(object)go.AddComponent()).GetCopyOf(toAdd); } } public static class Utils { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_1; public static Manipulator <>9__2_0; internal void b__2_0(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass2_0 CS$<>8__locals0 = new <>c__DisplayClass2_0(); ILCursor val = new ILCursor(il); CS$<>8__locals0.methodInfo = AccessTools.PropertySetter(typeof(CharacterBody), "maxHealth"); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)CS$<>8__locals0.methodInfo) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalMaxHealth, CharacterBody characterBody) { foreach (Func projectileHealthOverride in projectileHealthOverrides) { float num = projectileHealthOverride(originalMaxHealth, characterBody); if (num != originalMaxHealth) { return num; } } return originalMaxHealth; }); } else { Log.Error("IL.RoR2.CharacterBody.RecalculateStats health override hook failed!"); } } internal float b__2_1(float originalMaxHealth, CharacterBody characterBody) { foreach (Func projectileHealthOverride in projectileHealthOverrides) { float num = projectileHealthOverride(originalMaxHealth, characterBody); if (num != originalMaxHealth) { return num; } } return originalMaxHealth; } } [CompilerGenerated] private sealed class <>c__DisplayClass2_0 { public MethodInfo methodInfo; internal bool b__2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)methodInfo); } } private static readonly List> projectileHealthOverrides = new List>(); public static void AddHealthOverride(Func func) { projectileHealthOverrides.Add(func); } public static void Init() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__2_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); MethodInfo methodInfo = AccessTools.PropertySetter(typeof(CharacterBody), "maxHealth"); if (val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)methodInfo) })) { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(float originalMaxHealth, CharacterBody characterBody) { foreach (Func projectileHealthOverride in projectileHealthOverrides) { float num = projectileHealthOverride(originalMaxHealth, characterBody); if (num != originalMaxHealth) { return num; } } return originalMaxHealth; }); } else { Log.Error("IL.RoR2.CharacterBody.RecalculateStats health override hook failed!"); } }; <>c.<>9__2_0 = val; obj = (object)val; } CharacterBody.RecalculateStats += (Manipulator)obj; } public static Sprite CreateSprite(Texture2D texture) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)texture == (Object)null) { Log.Error("CreateSprite failed! Texture2D is null!"); return null; } return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), Vector2.op_Implicit(new Vector3(0.5f, 0.5f)), 100f); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Skeletogne.EnemyAbilities", "EnemyAbilities", "1.15.4")] public class EnemyAbilities : BaseUnityPlugin { public class ModuleInfoAttribute : Attribute { public string ModuleName { get; } public string Description { get; } public string Section { get; } public bool RequiresRestart { get; } public ModuleInfoAttribute(string moduleName, string description, string section, bool requiresRestart) { ModuleName = moduleName; Description = description; Section = section; RequiresRestart = requiresRestart; } } public const string PluginGUID = "Skeletogne.EnemyAbilities"; public const string PluginAuthor = "Skeletogne"; public const string PluginName = "EnemyAbilities"; public const string PluginVersion = "1.15.4"; internal static bool AVRInstalled = Chainloader.PluginInfos.ContainsKey("com.Nuxlar.AugmentedVoidReaver"); public Dictionary> configEntries = new Dictionary>(); public AssetBundle assetBundle; internal static bool RooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static EnemyAbilities Instance { get; private set; } internal string DirectoryName => Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); public void Awake() { //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) assetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "anglereye")); Shader shader = Addressables.LoadAssetAsync((object)RoR2_Base_Shaders.HGStandard_shader).WaitForCompletion(); Material[] array = assetBundle.LoadAllAssets(); foreach (Material val in array) { val.shader = shader; } Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); Utils.Init(); PluginConfig.Init(((BaseUnityPlugin)this).Config); foreach (KeyValuePair> configEntry in configEntries) { Type key = configEntry.Key; ((Component)Instance).gameObject.AddComponent(key); } } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public static class PluginConfig { public enum FormatType { None, Percentage, Time, Distance, Speed, Multiplier } public static void Init(ConfigFile cfg) { if (EnemyAbilities.RooInstalled) { InitRoO(); } Assembly executingAssembly = Assembly.GetExecutingAssembly(); Type[] array = (from type in executingAssembly.GetTypes() where type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(BaseModule)) select type).ToArray(); Type[] array2 = array; foreach (Type type2 in array2) { EnemyAbilities.ModuleInfoAttribute customAttribute = type2.GetCustomAttribute(); if (customAttribute != null) { ConfigEntry value = cfg.BindOption(customAttribute.Section ?? "", customAttribute.ModuleName ?? "", defaultValue: true, customAttribute.Description ?? "", customAttribute.RequiresRestart); EnemyAbilities.Instance.configEntries.Add(type2, value); } else { Log.Error("ModuleInfo for " + type2.FullName + " does not exist! No PluginConfig entry has been created."); } } } public static void InitRoO() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_005e: 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) try { ModSettingsManager.SetModDescription("Give enemies new abilities!", "Skeletogne.EnemyAbilities", "EnemyAbilities"); byte[] array = File.ReadAllBytes(Path.Combine(EnemyAbilities.Instance.DirectoryName, "icon.png")); Texture2D val = new Texture2D(256, 256); ImageConversion.LoadImage(val, array); Sprite modIcon = Sprite.Create(val, new Rect(0f, 0f, 256f, 256f), new Vector2(0.5f, 0.5f)); ModSettingsManager.SetModIcon(modIcon); } catch (Exception data) { Log.Debug(data); } } public static ConfigEntry BindOption(this ConfigFile myConfig, string section, string name, T defaultValue, string description = "", bool restartRequired = false) { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown bool flag = ((defaultValue is int || defaultValue is float) ? true : false); if (flag && !typeof(T).IsEnum) { Log.Warning("Config entry " + name + " in section " + section + " is a numeric " + typeof(T).Name + " type, but has been registered without using BindOptionSlider. Lower and upper bounds will be set to the defaults [0, 20]. Was this intentional?"); return myConfig.BindOptionSlider(section, name, defaultValue, description, 0f, 20f, restartRequired); } if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } AcceptableValueBase val = null; if (typeof(T).IsEnum) { val = (AcceptableValueBase)(object)new AcceptableValueList(Enum.GetNames(typeof(T))); } ConfigEntry val2 = myConfig.Bind(section, name, defaultValue, new ConfigDescription(description, val, Array.Empty())); if (EnemyAbilities.RooInstalled) { TryRegisterOption(val2, restartRequired); } return val2; } public static ConfigEntry BindOptionSlider(this ConfigFile myConfig, string section, string name, T defaultValue, string description = "", float min = 0f, float max = 20f, bool restartRequired = false) { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown bool flag = ((defaultValue is int || defaultValue is float) ? true : false); if (!flag || typeof(T).IsEnum) { Log.Warning("Config entry " + name + " in section " + section + " is a not a numeric " + typeof(T).Name + " type, but has been registered as a slider option using BindOptionSlider. Was this intentional?"); return myConfig.BindOption(section, name, defaultValue, description, restartRequired); } if (string.IsNullOrEmpty(description)) { description = name; } string text = description; T val = defaultValue; description = text + " (Default: " + val?.ToString() + ")"; if (restartRequired) { description += " (restart required)"; } AcceptableValueBase val2 = (AcceptableValueBase)((typeof(T) == typeof(int)) ? ((object)new AcceptableValueRange((int)min, (int)max)) : ((object)new AcceptableValueRange(min, max))); ConfigEntry val3 = myConfig.Bind(section, name, defaultValue, new ConfigDescription(description, val2, Array.Empty())); if (EnemyAbilities.RooInstalled) { TryRegisterOptionSlider(val3, min, max, restartRequired); } return val3; } public static ConfigEntry BindOptionSteppedSlider(this ConfigFile myConfig, string section, string name, T defaultValue, float increment = 1f, string description = "", float min = 0f, float max = 20f, bool restartRequired = false, FormatType formatType = FormatType.None) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown if (string.IsNullOrEmpty(description)) { description = name; } string text = description; T val = defaultValue; description = text + " (Default: " + val?.ToString() + ")"; if (restartRequired) { description += " (restart required)"; } ConfigEntry val2 = myConfig.Bind(section, name, defaultValue, new ConfigDescription(description, (AcceptableValueBase)(object)new AcceptableValueRange(min, max), Array.Empty())); if (EnemyAbilities.RooInstalled) { TryRegisterOptionSteppedSlider(val2, increment, min, max, restartRequired, formatType); } return val2; } public static void TryRegisterOption(ConfigEntry entry, bool restartRequired) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown if (entry is ConfigEntry val) { ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(val, new InputFieldConfig { submitOn = (SubmitEnum)6, restartRequired = restartRequired })); return; } if (entry is ConfigEntry val2) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(val2, restartRequired)); return; } if (entry is ConfigEntry val3) { ModSettingsManager.AddOption((BaseOption)new KeyBindOption(val3, restartRequired)); return; } if (typeof(T).IsEnum) { ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)entry, restartRequired)); return; } Log.Warning("Config entry " + ((ConfigEntryBase)entry).Definition.Key + " in section " + ((ConfigEntryBase)entry).Definition.Section + " with type " + typeof(T).Name + " could not be registered in Risk Of Options using TryRegisterOption."); } public static void TryRegisterOptionSlider(ConfigEntry entry, float min, float max, bool restartRequired) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown if (entry is ConfigEntry val) { ModSettingsManager.AddOption((BaseOption)new IntSliderOption(val, new IntSliderConfig { min = (int)min, max = (int)max, formatString = "{0:0}", restartRequired = restartRequired })); } else if (entry is ConfigEntry val2) { ModSettingsManager.AddOption((BaseOption)new SliderOption(val2, new SliderConfig { min = min, max = max, FormatString = "{0:0.000}", restartRequired = restartRequired })); } else { Log.Warning("Config entry " + ((ConfigEntryBase)entry).Definition.Key + " in section " + ((ConfigEntryBase)entry).Definition.Section + " with type " + typeof(T).Name + " could not be registered in Risk Of Options using TryRegisterOptionSlider."); } } public static void TryRegisterOptionSteppedSlider(ConfigEntry entry, float increment, float min, float max, bool restartRequired, FormatType formatType) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_004d: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (entry is ConfigEntry val) { ModSettingsManager.AddOption((BaseOption)new StepSliderOption(val, new StepSliderConfig { increment = increment, min = min, max = max, FormatString = GetStepSizePrecision((decimal)increment, formatType), restartRequired = restartRequired })); } else { Log.Warning("Config entry " + ((ConfigEntryBase)entry).Definition.Key + " in section " + ((ConfigEntryBase)entry).Definition.Section + " with type " + typeof(T).Name + " could not be registered in Risk Of Options using TryRegisterOptionSteppedSlider."); } } private static string GetStepSizePrecision(decimal n, FormatType formatType) { n = Math.Abs(n); n -= (decimal)(int)n; int num = 0; string text = "{0:"; while (n > 0m) { num++; n *= 10m; n -= (decimal)(int)n; } if (num == 0) { return text + "0}" + AppendSuffix(formatType); } if (num > 0) { text += "0."; for (int i = 0; i < num; i++) { text += "0"; } text += "}"; return text + AppendSuffix(formatType); } Log.Error("Could not determine string format!"); return "{0:000}"; } private static string AppendSuffix(FormatType formatType) { return formatType switch { FormatType.Percentage => "%", FormatType.Time => "s", FormatType.Distance => "m", FormatType.Speed => "m/s", FormatType.Multiplier => "x", _ => "", }; } } } namespace EnemyAbilities.Abilities { public class BaseModule : MonoBehaviour { protected class SkillDefData { public string objectName; public string skillName; public string esmName; public SerializableEntityStateType activationState; public float cooldown; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public InterruptPriority intPrio = (InterruptPriority)0; public bool resetCdOnUse = false; public bool cdOnEnd = false; public bool cdBlocked = false; public bool combatSkill = true; } protected class AISkillDriverData { public GameObject masterPrefab; public string customName; public SkillSlot skillSlot; public float minDistance = 0f; public float maxDistance = float.PositiveInfinity; public int desiredIndex = 0; public float moveInputScale = 1f; public MovementType movementType; public AimType aimType; public TargetType targetType; public bool ignoreNodeGraph = false; public float maxHealthFraction = float.PositiveInfinity; public float minHealthFraction = float.NegativeInfinity; public float maxTargetHealthFraction = float.PositiveInfinity; public float minTargetHealthFraction = float.NegativeInfinity; public bool requireReady = false; public SkillDef requiredSkillDef = null; public bool activationRequiresAimTargetLoS = false; public bool activationRequiresAimConfirmation = false; public bool activationRequiresTargetLoS = false; public bool selectionRequiresAimTarget = false; public bool selectionRequiresOnGround = false; public bool selectionRequiresTargetLoS = false; public bool selectionRequiresTargetNonFlier = false; public int maxTimesSelected = -1; public float driverUpdateTimerOverride = -1f; public bool noRepeat = false; public AISkillDriver nextHighPriorityOverride = null; public bool shouldSprint = false; public float aimVectorMaxSpeedOverride = -1f; public ButtonPressType buttonPressType = (ButtonPressType)0; } public class StatOverrides { public float? baseMaxHealth; public float? baseDamage; public float? baseMoveSpeed; public float? baseAcceleration; public float? baseArmor; public float? directorCost; } private string _section; internal ConfigEntry baseMaxHealthCfg; internal ConfigEntry baseDamageCfg; internal ConfigEntry baseMoveSpeedCfg; internal ConfigEntry baseAccelerationCfg; internal ConfigEntry baseArmorCfg; internal ConfigEntry costCfg; protected GameObject cachedBodyPrefab; protected List cachedSpawnCards; protected ConfigFile config => ((BaseUnityPlugin)EnemyAbilities.Instance).Config; protected string Section { get { if (_section == null) { _section = ((object)this).GetType().GetCustomAttribute()?.Section ?? ((object)this).GetType().Name; } return _section; } } protected void BindStats(GameObject prefab, List spawnCards = null, StatOverrides overrides = null) { cachedBodyPrefab = prefab; cachedSpawnCards = spawnCards; CharacterBody component = prefab.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("BodyPrefab has no CharacterBody!"); return; } string @string = Language.GetString(component.baseNameToken); overrides = overrides ?? new StatOverrides(); baseMaxHealthCfg = BindFloat("Base Max Health", overrides.baseMaxHealth ?? component.baseMaxHealth, string.Format("Base Max Health of this enemy.\nValue without this mod is {0}.{1}", component.baseMaxHealth, overrides.baseMaxHealth.HasValue ? $"\nThis mod rebalances this stat to {overrides.baseMaxHealth} by default." : ""), component.baseMaxHealth / 5f, component.baseMaxHealth * 5f, 1f); baseDamageCfg = BindFloat("Base Damage", overrides.baseDamage ?? component.baseDamage, string.Format("Base Damage of this enemy.\nValue without this mod is {0}.{1}", component.baseDamage, overrides.baseDamage.HasValue ? $"\nThis mod rebalances this stat to {overrides.baseDamage} by default." : ""), component.baseDamage / 5f, component.baseDamage * 5f); if (component.baseMoveSpeed > 0f) { baseMoveSpeedCfg = BindFloat("Base Move Speed", overrides.baseMoveSpeed ?? component.baseMoveSpeed, string.Format("Base Move Speed of this enemy.\nValue without this mod is {0}.{1}", component.baseMoveSpeed, overrides.baseMoveSpeed.HasValue ? $"\nThis mod rebalances this stat to {overrides.baseMoveSpeed} by default." : ""), component.baseMoveSpeed / 5f, component.baseMoveSpeed * 5f); } if (component.baseAcceleration > 0f) { baseAccelerationCfg = BindFloat("Base Acceleration", overrides.baseAcceleration ?? component.baseAcceleration, string.Format("Base Acceleration of this enemy.\nValue without this mod is {0}.{1}", component.baseAcceleration, overrides.baseAcceleration.HasValue ? $"\nThis mod rebalances this stat to {overrides.baseAcceleration} by default." : ""), component.baseAcceleration / 5f, component.baseAcceleration * 5f); } baseArmorCfg = BindFloat("Base Armor", overrides.baseArmor ?? component.baseArmor, string.Format("Base Armor of this enemy.\nValue without this mod is {0}.{1}", component.baseArmor, overrides.baseArmor.HasValue ? $"\nThis mod rebalances this stat to {overrides.baseArmor} by default." : ""), 0f, Mathf.Max(100f, component.baseArmor), 1f); if (spawnCards != null) { costCfg = BindFloat("Director Cost", overrides.directorCost ?? ((float)((SpawnCard)spawnCards[0]).directorCreditCost), string.Format("The amount of credits required for the director to spawn this enemy.\nValue without this mod is {0}.{1}", ((SpawnCard)spawnCards[0]).directorCreditCost, overrides.directorCost.HasValue ? $"\nThis mod rebalances this stat to {overrides.directorCost} by default." : ""), (float)((SpawnCard)spawnCards[0]).directorCreditCost / 5f, (float)((SpawnCard)spawnCards[0]).directorCreditCost * 5f, 1f); } } protected void ApplyStats() { if ((Object)(object)cachedBodyPrefab == (Object)null) { Log.Error("CachedBodyPrefab is null! BindStats has to have been run already before ApplyStats is called!!!"); return; } CharacterBody component = cachedBodyPrefab.GetComponent(); if ((Object)(object)component == (Object)null) { return; } string @string = Language.GetString(component.baseNameToken); component.baseMaxHealth = baseMaxHealthCfg.Value; component.levelMaxHealth = baseMaxHealthCfg.Value * 0.3f; component.baseDamage = baseDamageCfg.Value; component.levelDamage = baseDamageCfg.Value * 0.2f; if (baseMoveSpeedCfg != null) { component.baseMoveSpeed = baseMoveSpeedCfg.Value; } if (baseAccelerationCfg != null) { component.baseAcceleration = baseAccelerationCfg.Value; } if (baseArmorCfg != null) { component.baseArmor = baseArmorCfg.Value; } if (cachedSpawnCards != null && costCfg != null) { for (int i = 0; i < cachedSpawnCards.Count; i++) { CharacterSpawnCard val = cachedSpawnCards[i]; ((SpawnCard)val).directorCreditCost = (int)costCfg.Value; } } } public virtual void Awake() { RegisterConfig(); if (IsModuleEnabled()) { Initialise(); } } private bool IsModuleEnabled() { if (EnemyAbilities.Instance.configEntries.TryGetValue(((object)this).GetType(), out var value)) { return value.Value; } return false; } protected ConfigEntry BindFloat(string name, float defaultValue, string desc, float min, float max, float step = 0.1f, PluginConfig.FormatType format = PluginConfig.FormatType.None) { return config.BindOptionSteppedSlider(Section, name, defaultValue, step, desc, min, max, restartRequired: true, format); } protected ConfigEntry BindBool(string name, bool defaultValue, string desc) { return config.BindOption(Section, name, defaultValue, desc, restartRequired: true); } public virtual void RegisterConfig() { } public virtual void Initialise() { ApplyStats(); } protected T CreateSkillDef(SkillDefData data) where T : SkillDef { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_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) T val = ScriptableObject.CreateInstance(); ((Object)(object)val).name = data.objectName; ((SkillDef)val).skillName = data.skillName; ((SkillDef)val).activationStateMachineName = data.esmName; ((SkillDef)val).activationState = data.activationState; ((SkillDef)val).baseRechargeInterval = data.cooldown; ((SkillDef)val).baseMaxStock = data.baseMaxStock; ((SkillDef)val).rechargeStock = data.rechargeStock; ((SkillDef)val).requiredStock = data.requiredStock; ((SkillDef)val).stockToConsume = data.stockToConsume; ((SkillDef)val).interruptPriority = data.intPrio; ((SkillDef)val).resetCooldownTimerOnUse = data.resetCdOnUse; ((SkillDef)val).beginSkillCooldownOnSkillEnd = data.cdOnEnd; ((SkillDef)val).isCooldownBlockedUntilManuallyReset = data.cdBlocked; ((SkillDef)val).isCombatSkill = data.combatSkill; ContentAddition.AddSkillDef((SkillDef)(object)val); return val; } protected GenericSkill CreateGenericSkill(GameObject bodyPrefab, SkillDef skillDef, string familyName, SkillSlot slot) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0059: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected I4, but got Unknown SkillFamily val = ScriptableObject.CreateInstance(); ((Object)val).name = familyName; val.variants = (Variant[])(object)new Variant[1] { new Variant { skillDef = skillDef } }; string skillName = skillDef.skillName; GenericSkill val2 = bodyPrefab.AddComponent(); val2.skillName = skillName; val2._skillFamily = val; SkillLocator component = bodyPrefab.GetComponent(); switch (slot - -1) { case 0: Log.Error("SkillSlot.None detected in AddGenericSkill!"); break; case 1: component.primary = val2; break; case 2: component.secondary = val2; break; case 3: component.utility = val2; break; case 4: component.special = val2; break; } ContentAddition.AddSkillFamily(val); return val2; } protected EntityStateMachine CreateEntityStateMachine(GameObject bodyPrefab, string name, Type initialState = null, Type mainState = null) { //IL_001f: 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_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) EntityStateMachine val = bodyPrefab.AddComponent(); val.customName = name; val.initialStateType = new SerializableEntityStateType(initialState ?? typeof(Idle)); val.mainStateType = new SerializableEntityStateType(mainState ?? typeof(Idle)); return val; } protected AISkillDriver CreateAISkillDriver(AISkillDriverData data) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0188: 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) if (data == null || (Object)(object)data.masterPrefab == (Object)null) { Log.Error("Could not create AISkillDriver"); return null; } AISkillDriver val = data.masterPrefab.AddComponent(); val.customName = data.customName; val.skillSlot = data.skillSlot; val.minDistance = data.minDistance; val.maxDistance = data.maxDistance; val.moveInputScale = data.moveInputScale; val.movementType = data.movementType; val.aimType = data.aimType; val.moveTargetType = data.targetType; val.ignoreNodeGraph = data.ignoreNodeGraph; val.maxUserHealthFraction = data.maxHealthFraction; val.minUserHealthFraction = data.minHealthFraction; val.maxTargetHealthFraction = data.maxTargetHealthFraction; val.minTargetHealthFraction = data.minTargetHealthFraction; val.requireSkillReady = data.requireReady; val.requiredSkill = data.requiredSkillDef; val.activationRequiresAimConfirmation = data.activationRequiresAimConfirmation; val.activationRequiresAimTargetLoS = data.activationRequiresAimTargetLoS; val.activationRequiresTargetLoS = data.activationRequiresTargetLoS; val.selectionRequiresAimTarget = data.selectionRequiresAimTarget; val.selectionRequiresOnGround = data.selectionRequiresOnGround; val.selectionRequiresTargetLoS = data.selectionRequiresTargetLoS; val.selectionRequiresTargetNonFlier = data.selectionRequiresTargetNonFlier; val.maxTimesSelected = data.maxTimesSelected; val.driverUpdateTimerOverride = data.driverUpdateTimerOverride; val.noRepeat = data.noRepeat; val.nextHighPriorityOverride = data.nextHighPriorityOverride; val.shouldSprint = data.shouldSprint; val.aimVectorMaxSpeedOverride = data.aimVectorMaxSpeedOverride; val.buttonPressType = data.buttonPressType; data.masterPrefab.ReorderSkillDrivers(val, data.desiredIndex); return val; } } } namespace EnemyAbilities.Abilities.SolusProspector { [EnemyAbilities.ModuleInfo("Drill Burrow", "Gives Solus Prospectors a new Secondary ability: \n- Drill Burrow: Allows the Prospector to disappear underground to remain hidden for 1 second, before burrowing up beneath a nearby target.", "Solus Prospector", true)] public class DrillBurrowModule : BaseModule { private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_WorkerUnit.WorkerUnitBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_WorkerUnit.WorkerUnitMaster_prefab).WaitForCompletion(); internal static ConfigEntry entryDuration; internal static ConfigEntry waitDuration; internal static ConfigEntry telegraphDuration; internal static ConfigEntry damageCoeff; internal static ConfigEntry radius; internal static ConfigEntry baseVelocity; internal static ConfigEntry cooldown; private static CharacterSpawnCard csc = Addressables.LoadAssetAsync((object)RoR2_DLC3_WorkerUnit.cscWorkerUnit_asset).WaitForCompletion(); public override void RegisterConfig() { base.RegisterConfig(); entryDuration = BindFloat("Burrow Entry Duration", 1f, "How long it takes for the Solus Prospector to burrow underground.", 0.2f, 2f, 0.1f, PluginConfig.FormatType.Time); waitDuration = BindFloat("Burrow Wait Duration", 1f, "How long the Solus Prospector remains burrowed without attacking", 0.2f, 2f, 0.1f, PluginConfig.FormatType.Time); telegraphDuration = BindFloat("Burrow Telegraph Duration", 1f, "How long the Solus Prospector telegraphs before bursting up from the ground", 0.2f, 2f, 0.1f, PluginConfig.FormatType.Time); radius = BindFloat("Burrow Radius", 6f, "The radius of the burrow attack explosion", 6f, 16f, 1f, PluginConfig.FormatType.Distance); damageCoeff = BindFloat("Burrow Damage Coefficient", 300f, "The damage coefficient of the burrow attack", 100f, 500f, 5f, PluginConfig.FormatType.Percentage); baseVelocity = BindFloat("Burrow Upwards Velocity Modifier", 250f, "The speed multiplier at which the Prospector is ejected from the ground", 100f, 500f, 10f, PluginConfig.FormatType.Percentage); cooldown = BindFloat("Burrow Cooldown", 15f, "The cooldown of the burrow", 8f, 30f, 0.1f, PluginConfig.FormatType.Time); BindStats(bodyPrefab, new List(1) { csc }, new StatOverrides { directorCost = 16f }); } public override void Initialise() { base.Initialise(); CreateSkill(); } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "WorkerUnitBodyDrillBurrow", skillName = "WorkerUnitDrillBurrow", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; SkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, skillDef, "WorkerUnitSecondaryFamily", (SkillSlot)1); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSecondary", skillSlot = (SkillSlot)1, requireReady = true, minDistance = 20f, maxDistance = 50f, selectionRequiresOnGround = true, selectionRequiresTargetNonFlier = true, movementType = (MovementType)0, aimType = (AimType)0, ignoreNodeGraph = true, desiredIndex = 0 }; CreateAISkillDriver(data2); } } public class DrillBurrow : BaseSkillState { private enum DrillBurrowState { None, Windup, Burrowed, Telegraphing, Attacking } public static float baseWindupDuration = DrillBurrowModule.entryDuration.Value; public static float baseBurrowDuration = DrillBurrowModule.waitDuration.Value; public static float baseTelegraphDuration = DrillBurrowModule.telegraphDuration.Value; public static float baseAttackDuration = 1f; public static float blastRadius = DrillBurrowModule.radius.Value; public static float force = 1500f; public static Vector3 bonusForce = new Vector3(0f, 2500f, 0f); public static float damageCoefficient = DrillBurrowModule.damageCoeff.Value / 100f; public static float exitSpeedMultiplier = DrillBurrowModule.baseVelocity.Value / 100f; private static GameObject indicatorPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion(); private static GameObject explosionPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_BeetleGuard.BeetleGuardGroundSlam_prefab).WaitForCompletion(); private static GameObject burrowPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_MiniMushroom.MiniMushroomPlantEffect_prefab).WaitForCompletion(); private float windupDuration; private float burrowDuration; private float telegraphDuration; private float attackDuration; private float totalDuration; private float stopwatch = 0f; private int originalLayerIndex; private Vector3 targetPos; private GameObject indicatorInstance; private ChildLocator childLocator; private Animator animator; private bool reachedApex; private float burrowEffectTimer = 0f; private float burrowEffectInterval = 0.2f; private Vector3 startPos; private HurtBox target; private uint soundID; private DrillBurrowState currentState = DrillBurrowState.None; public override void OnEnter() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); childLocator = ((Component)animator).GetComponent(); originalLayerIndex = ((EntityState)this).gameObject.layer; windupDuration = baseWindupDuration / ((BaseState)this).attackSpeedStat; burrowDuration = baseBurrowDuration / ((BaseState)this).attackSpeedStat; telegraphDuration = baseTelegraphDuration; attackDuration = baseAttackDuration / ((BaseState)this).attackSpeedStat; totalDuration = windupDuration + burrowDuration + telegraphDuration + attackDuration; currentState = DrillBurrowState.Windup; soundID = Util.PlaySound("Play_workerUnit_dig", ((EntityState)this).gameObject); startPos = ((EntityState)this).characterBody.transform.position; BullseyeSearch val = new BullseyeSearch(); val.viewer = ((EntityState)this).characterBody; val.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref val.teamMaskFilter)).RemoveTeam(((EntityState)this).characterBody.teamComponent.teamIndex); val.sortMode = (SortMode)3; val.minDistanceFilter = 0f; val.maxDistanceFilter = 60f; val.searchOrigin = ((EntityState)this).inputBank.aimOrigin; val.searchDirection = ((EntityState)this).inputBank.aimDirection; val.maxAngleFilter = 360f; val.filterByLoS = false; val.RefreshCandidates(); HurtBox val2 = val.GetResults().FirstOrDefault(); if ((Object)(object)val2 != (Object)null) { target = val2; } } public override void OnExit() { ((EntityState)this).OnExit(); SetSprintEffectState(active: false); if (currentState != DrillBurrowState.Attacking) { Emerge(); } AkSoundEngine.StopPlayingID(soundID); } public void SpawnDirtEffect() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_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_0032: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) EffectData val = new EffectData(); Vector3 val2 = Random.insideUnitSphere * 1f; if (currentState == DrillBurrowState.Windup) { val._origin = ((EntityState)this).characterBody.footPosition + val2; } else if (currentState == DrillBurrowState.Telegraphing) { val._origin = targetPos + val2; } else if (currentState == DrillBurrowState.Burrowed) { Vector3 val3 = ((EntityState)this).characterBody.footPosition; if ((Object)(object)target != (Object)null && (Object)(object)target.healthComponent != (Object)null && (Object)(object)target.healthComponent.body != (Object)null) { val3 = target.healthComponent.body.transform.position; } Vector3 val4 = startPos; if (val3.y > startPos.y) { val4.y = val3.y; } else { val3.y = val4.y; } Vector3 val5 = Vector3.Lerp(val4, val3, Mathf.Clamp01((stopwatch - windupDuration) / burrowDuration)); RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(val5, Vector3.down, ref val6, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { val._origin = ((RaycastHit)(ref val6)).point + val2; TeleportHelper.TeleportBody(((EntityState)this).characterBody, ((RaycastHit)(ref val6)).point, false); } } val.scale = ((currentState == DrillBurrowState.Burrowed) ? 1f : 2f); EffectManager.SpawnEffect(burrowPrefab, val, true); } public override void FixedUpdate() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (currentState == DrillBurrowState.Windup) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (stopwatch > windupDuration && currentState == DrillBurrowState.Windup) { Burrow(); currentState = DrillBurrowState.Burrowed; burrowEffectTimer = 0f; burrowEffectInterval = 0.05f; } if (stopwatch > windupDuration + burrowDuration && currentState == DrillBurrowState.Burrowed) { Telegraph(); burrowEffectTimer = 0f; burrowEffectInterval = 0.2f; currentState = DrillBurrowState.Telegraphing; } if (stopwatch > windupDuration + burrowDuration + telegraphDuration && currentState == DrillBurrowState.Telegraphing) { FireAttack(); currentState = DrillBurrowState.Attacking; } if (currentState == DrillBurrowState.Attacking && !reachedApex) { if (((EntityState)this).characterMotor.velocity.y <= 0f) { reachedApex = true; OnReachedApex(); } else { ((EntityState)this).inputBank.aimDirection = Vector3.up; } } if ((stopwatch > totalDuration && ((EntityState)this).characterMotor.isGrounded) || stopwatch > totalDuration + 3f) { ((EntityState)this).outer.SetNextStateToMain(); } if (currentState == DrillBurrowState.Windup || currentState == DrillBurrowState.Telegraphing || currentState == DrillBurrowState.Burrowed) { burrowEffectTimer -= Time.fixedDeltaTime; if (burrowEffectTimer < 0f) { burrowEffectTimer += burrowEffectInterval; SpawnDirtEffect(); } } } public void OnReachedApex() { SetSprintEffectState(active: false); } public void Burrow() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((EntityState)this).characterBody == (Object)null) && !((Object)(object)((EntityState)this).characterMotor == (Object)null)) { ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 0f; if (((EntityState)this).characterBody.GetBuffCount(Buffs.HiddenInvincibility.buffIndex) < 1) { ((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility.buffIndex); } ((EntityState)this).gameObject.layer = LayerIndex.GetAppropriateFakeLayerForTeam(((EntityState)this).teamComponent.teamIndex).intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); if ((Object)(object)((EntityState)this).modelLocator != (Object)null && (Object)(object)((EntityState)this).modelLocator.modelTransform != (Object)null) { ((Component)((EntityState)this).modelLocator.modelTransform).gameObject.SetActive(false); } } } public void Telegraph() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) targetPos = ((EntityState)this).transform.position; if ((Object)(object)target != (Object)null && (Object)(object)target.healthComponent != (Object)null && (Object)(object)target.healthComponent.body != (Object)null) { targetPos = target.healthComponent.body.footPosition; Util.PlaySound("Play_GildedElite_Pillar_Spawn", ((Component)target.healthComponent.body).gameObject); } RaycastHit val = default(RaycastHit); if (Physics.Raycast(targetPos, Vector3.down, ref val, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { targetPos = ((RaycastHit)(ref val)).point; } indicatorInstance = Object.Instantiate(indicatorPrefab, targetPos, Util.QuaternionSafeLookRotation(Vector3.up)); indicatorInstance.transform.localScale = Vector3.one * blastRadius; TeamAreaIndicator component = indicatorInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.teamComponent = ((EntityState)this).teamComponent; } } private void SetSprintEffectState(bool active) { if (Object.op_Implicit((Object)(object)childLocator)) { Transform obj = childLocator.FindChild("SprintEffect"); if (obj != null) { ((Component)obj).gameObject.SetActive(active); } } } public void FireAttack() { //IL_0008: 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_006b: 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_0078: 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_0080: Expected O, but got Unknown //IL_008e: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) TeleportHelper.TeleportBody(((EntityState)this).characterBody, targetPos, false); Util.PlaySound("Play_MULT_m2_secondary_explode", ((EntityState)this).gameObject); AkSoundEngine.StopPlayingID(soundID); Emerge(); SetSprintEffectState(active: true); ((EntityState)this).PlayAnimation("Gesture, Additive", "FrenziedMeleeAttack", "attack.playbackRate", 1f, 0f); DamageTypeCombo val = default(DamageTypeCombo); val.damageSource = (DamageSource)2; val.damageType = (DamageType)0; DamageTypeCombo damageType = val; BlastAttack val2 = new BlastAttack(); val2.attacker = ((EntityState)this).gameObject; val2.attackerFiltering = (AttackerFiltering)2; val2.baseDamage = damageCoefficient * ((BaseState)this).damageStat; val2.baseForce = force; val2.bonusForce = bonusForce; val2.crit = ((BaseState)this).RollCrit(); val2.damageColorIndex = (DamageColorIndex)0; val2.damageType = damageType; val2.falloffModel = (FalloffModel)2; val2.inflictor = ((EntityState)this).gameObject; val2.position = targetPos; val2.procCoefficient = 1f; val2.procChainMask = default(ProcChainMask); val2.radius = blastRadius; val2.teamIndex = ((EntityState)this).teamComponent.teamIndex; val2.Fire(); if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.velocity = new Vector3(0f, ((BaseState)this).moveSpeedStat * 2.5f, 0f); } EffectManager.SpawnEffect(explosionPrefab, new EffectData { origin = ((EntityState)this).characterBody.transform.position, scale = blastRadius }, true); } public void Emerge() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((EntityState)this).characterBody == (Object)null) && !((Object)(object)((EntityState)this).characterMotor == (Object)null)) { if ((Object)(object)indicatorInstance != (Object)null) { Object.Destroy((Object)(object)indicatorInstance); } ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f; ((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility.buffIndex); ((EntityState)this).gameObject.layer = originalLayerIndex; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); if ((Object)(object)((EntityState)this).modelLocator != (Object)null && (Object)(object)((EntityState)this).modelLocator.modelTransform != (Object)null) { ((Component)((EntityState)this).modelLocator.modelTransform).gameObject.SetActive(true); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (currentState == DrillBurrowState.Windup || currentState == DrillBurrowState.Attacking) { return (InterruptPriority)2; } return (InterruptPriority)9; } } } namespace EnemyAbilities.Abilities.Vulture { [EnemyAbilities.ModuleInfo("Swoop", "Gives Alloy Vultures a new secondary:\n- Swoop: Allows Alloy Vultures to swoop towards the player in an arc, dealing contact damage.", "Alloy Vulture", true)] public class SwoopModule : BaseModule { private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Vulture.VultureBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Vulture.VultureMaster_prefab).WaitForCompletion(); private static CharacterSpawnCard csc = Addressables.LoadAssetAsync((object)RoR2_Base_Vulture.cscVulture_asset).WaitForCompletion(); internal static ConfigEntry damageCoeff; internal static ConfigEntry hitboxScale; internal static ConfigEntry inflictsBleed; internal static ConfigEntry predictionTime; internal static ConfigEntry selfStunDuration; internal static ConfigEntry cooldown; public override void RegisterConfig() { base.RegisterConfig(); predictionTime = BindFloat("Swoop Prediction Duration", 1.5f, "Affects how far into the future the Alloy Vulture will predict when swooping towards the player. Increasing the value increases the duration of the attack, and slows the speed at which the Vulture travels.", 1f, 3f, 0.1f, PluginConfig.FormatType.Time); hitboxScale = BindFloat("Swoop Hitbox Scale", 100f, "Affects how large the hitbox for swoop is.", 50f, 200f, 1f, PluginConfig.FormatType.Percentage); damageCoeff = BindFloat("Swoop Damage Coefficient", 125f, "The damage coefficient of the swoop attack", 100f, 300f, 5f, PluginConfig.FormatType.Percentage); selfStunDuration = BindFloat("Swoop Stun Duration on Impact", 2f, "How long the Alloy Vulture stuns itself for upon hitting terrain at high speed.", 0f, 4f, 0.1f, PluginConfig.FormatType.Time); inflictsBleed = BindBool("Swoop Inflicts Bleed", defaultValue: true, "Allows Alloy Vultures to inflict 1 stack of bleed for 3 seconds when swoop hits."); cooldown = BindFloat("Swoop Cooldown", 12f, "The cooldown of the swoop ability", 8f, 30f, 0.1f, PluginConfig.FormatType.Time); BindStats(bodyPrefab, new List(1) { csc }); } public override void Initialise() { base.Initialise(); TargetingAndPredictionController val = bodyPrefab.AddComponent(); val.manualTrackingMaxDistance = 100f; val.manualTrackingMaxAngle = 360f; CreateSkill(); AddMeleeHitBox(); } private void AddMeleeHitBox() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) ModelLocator component = bodyPrefab.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.modelTransform != (Object)null) { CreateHitBoxAndGroup(component.modelTransform, "VultureMelee", new Vector3(0f, -2f, 0f), new Vector3(30f, 30f, 30f) * (hitboxScale.Value / 100f)); } } private void CreateHitBoxAndGroup(Transform modelTransform, string hitBoxGroupName, Vector3 localPosition, Vector3 localScale, string hitBoxGroupObjName = "", string hitBoxObjName = "") { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) hitBoxGroupObjName = ((hitBoxGroupObjName == "") ? hitBoxGroupName : hitBoxGroupObjName); hitBoxObjName = ((hitBoxObjName == "") ? hitBoxGroupName : hitBoxObjName); GameObject val = new GameObject(hitBoxGroupObjName); val.transform.SetParent(modelTransform); val.transform.localPosition = localPosition; val.transform.localScale = localScale; val.transform.localRotation = Quaternion.identity; HitBox val2 = val.AddComponent(); ((Object)((Component)val2).gameObject).name = hitBoxObjName; HitBoxGroup val3 = ((Component)modelTransform).gameObject.AddComponent(); val3.groupName = hitBoxGroupName; val3.hitBoxes = (HitBox[])(object)new HitBox[1] { val2 }; } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_00b7: 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) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "VultureBodySwoop", skillName = "VultureSwoop", esmName = "Body", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; SwoopSkillDef swoopSkillDef = CreateSkillDef(data); ContentAddition.AddEntityState(ref flag); CreateGenericSkill(bodyPrefab, (SkillDef)(object)swoopSkillDef, "VultureSecondaryFamily", (SkillSlot)1); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "strafeAndUseSecondary", skillSlot = (SkillSlot)1, requiredSkillDef = (SkillDef)(object)swoopSkillDef, requireReady = true, minDistance = 25f, maxDistance = 50f, targetType = (TargetType)0, movementType = (MovementType)2, desiredIndex = 2 }; CreateAISkillDriver(data2); } } public class SwoopSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { public CharacterBody body; public EntityStateMachine flightEsm; } public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot) { CharacterBody characterBody = skillSlot.characterBody; EntityStateMachine flightEsm = ((IEnumerable)((Component)characterBody).GetComponents()).FirstOrDefault((Func)((EntityStateMachine esm) => esm.customName == "Flight")); return (BaseSkillInstanceData)(object)new InstanceData { body = characterBody, flightEsm = flightEsm }; } public override bool IsReady([NotNull] GenericSkill skillSlot) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) InstanceData instanceData = skillSlot.skillInstanceData as InstanceData; if ((Object)(object)instanceData?.flightEsm == (Object)null || (Object)(object)instanceData.body == (Object)null) { return false; } if (!(instanceData.flightEsm.state is Fly)) { return false; } if (Physics.Raycast(instanceData.body.corePosition, Vector3.down, 8f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return false; } if ((Object)(object)instanceData.body.characterMotor != (Object)null && instanceData.body.characterMotor.isGrounded) { return false; } return ((SkillDef)this).IsReady(skillSlot); } } public class SwoopWindup : BaseSkillState { private float duration; private static float baseDuration = 0.5f; private Vector3 targetLocation; private BaseAI ai; private bool success; private GameObject jumpEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Vulture.VultureJumpEffect_prefab).WaitForCompletion(); public override void OnEnter() { //IL_00c1: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_014f: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).skillLocator.utility.SetSkillOverride((object)((EntityState)this).gameObject, CommonAssets.disabledSkill, (SkillOverridePriority)4); CharacterMaster master = ((EntityState)this).characterBody.master; if ((Object)(object)master != (Object)null) { ai = ((Component)master).gameObject.GetComponent(); } if ((Object)(object)ai != (Object)null && ai.currentEnemy != null && (Object)(object)ai.currentEnemy.characterBody != (Object)null) { targetLocation = ai.currentEnemy.characterBody.transform.position; } Vector3 val = ((EntityState)this).characterBody.corePosition - targetLocation; val.y = 0f; ((Vector3)(ref val)).Normalize(); Util.PlaySound("Play_vulture_attack2_warning", ((EntityState)this).gameObject); if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { EffectManager.SpawnEffect(jumpEffect, new EffectData { scale = 2f, origin = ((EntityState)this).characterBody.footPosition, rotation = Util.QuaternionSafeLookRotation(Vector3.down) }, true); ((EntityState)this).characterMotor.velocity = val * 10f + new Vector3(0f, 25f, 0f); } } public override void OnExit() { ((EntityState)this).OnExit(); if (!success) { ((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).gameObject, CommonAssets.disabledSkill, (SkillOverridePriority)4); } } public override void FixedUpdate() { //IL_0098: 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) ((EntityState)this).FixedUpdate(); if ((Object)(object)((EntityState)this).characterMotor != (Object)null && ((EntityState)this).characterMotor.isGrounded) { ((EntityState)this).outer.SetNextStateToMain(); } else if (((EntityState)this).fixedAge > duration) { if ((Object)(object)ai == (Object)null || ai.currentEnemy == null || (Object)(object)ai.currentEnemy.characterBody == (Object)null || ai.currentEnemy.characterBody.transform.position.y > ((EntityState)this).characterBody.transform.position.y) { ((EntityState)this).outer.SetNextStateToMain(); return; } success = true; ((EntityState)this).outer.SetNextState((EntityState)(object)new Swoop()); } } public override void Update() { ((EntityState)this).Update(); } 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 Swoop : BaseSkillState { public static float predictionDuration = 0.5f; private static float swoopDurationTilTarget = SwoopModule.predictionTime.Value; private static float recoverDuration = 0.5f; private static GameObject slashEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Croco.CrocoSlash_prefab).WaitForCompletion(); private static GameObject hitEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.OmniImpactVFXSlash_prefab).WaitForCompletion(); private GameObject slashEffectInstance; private EffectManagerHelper _emh_slashEffectInstance; private GameObject jumpEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Vulture.VultureJumpEffect_prefab).WaitForCompletion(); private static float effectInterval = 0.25f; private float effectTimer; private static int maxSwingCount = 5; private int swingCount = 0; private bool startLeftFoot; private static float firstSwingDelay = 1.1f; private static float swingInterval = 0.2f; private float nextSwingTime; private float recoverTimer = 0f; private float swoopStopwatch = 0f; private float swoopFullDuration = 3f; private TargetingAndPredictionController targetController; private Transform trackedTarget; private Vector3 vultureStartPosition; private Vector3 finalTarget; private bool madePrediction = false; private bool finishedSwoop = false; private bool pastTarget = false; private float damageCoefficient = SwoopModule.damageCoeff.Value / 100f; private float procCoefficient = 1f; private float crashAngle = 40f; private OverlapAttack attack; private int _origLayer; public override void OnEnter() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); DisableCollision(); if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((EntityState)this).characterMotor.onMovementHit += new MovementHitDelegate(OnMovementHit); } nextSwingTime = firstSwingDelay; if ((Object)(object)((EntityState)this).characterMotor != (Object)null && ((EntityState)this).characterMotor.isGrounded) { ((EntityState)this).outer.SetNextStateToMain(); return; } swoopFullDuration = swoopDurationTilTarget * 2f; targetController = ((EntityState)this).GetComponent(); if ((Object)(object)targetController != (Object)null && ((EntityState)this).isAuthority) { trackedTarget = targetController.StartPredictTarget((Action)OnTargetLost); } startLeftFoot = Random.RandomRangeInt(0, 2) == 1; attack = new OverlapAttack(); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((EntityState)this).teamComponent.teamIndex; attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.hitEffectPrefab = hitEffect; attack.isCrit = ((BaseState)this).RollCrit(); attack.procCoefficient = procCoefficient; DamageTypeCombo val = default(DamageTypeCombo); val.damageSource = (DamageSource)2; val.damageType = (DamageType)(SwoopModule.inflictsBleed.Value ? 1024 : 0); DamageTypeCombo damageType = val; attack.damageType = damageType; attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup("VultureMelee"); attack.forceVector = ((EntityState)this).characterDirection.forward * 500f; } private void OnMovementHit(ref MovementHitInfo movementHitInfo) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0038: Unknown result type (might be due to invalid IL or missing references) if (((Vector3)(ref ((EntityState)this).characterMotor.velocity)).magnitude < 5f) { return; } Vector3 normalized = ((Vector3)(ref ((EntityState)this).characterMotor.velocity)).normalized; Vector3 hitNormal = movementHitInfo.hitNormal; float num = Vector3.Angle(normalized, hitNormal); if (num > 180f - crashAngle) { SetStateOnHurt component = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetStun(SwoopModule.selfStunDuration.Value); } } } public override void OnExit() { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown ((EntityState)this).OnExit(); ((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).gameObject, CommonAssets.disabledSkill, (SkillOverridePriority)4); ((EntityState)this).characterMotor.velocity = new Vector3(0f, 0f, 0f); ((EntityState)this).characterMotor.onMovementHit -= new MovementHitDelegate(OnMovementHit); EnableCollision(); if ((Object)(object)_emh_slashEffectInstance != (Object)null && _emh_slashEffectInstance.OwningPool != null) { ((GenericPool)(object)_emh_slashEffectInstance.OwningPool).ReturnObject(_emh_slashEffectInstance); } else if (Object.op_Implicit((Object)(object)slashEffectInstance)) { EntityState.Destroy((Object)(object)slashEffectInstance); } slashEffectInstance = null; _emh_slashEffectInstance = null; } public override void FixedUpdate() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_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_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); if (!madePrediction) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity /= 1.2f; } if (((EntityState)this).fixedAge > predictionDuration && !madePrediction) { Vector3 position = default(Vector3); if (!targetController.GetPredictionPositionConsumePredictor(swoopDurationTilTarget, ref position)) { position = trackedTarget.position; } finalTarget = position + new Vector3(0f, 4f, 0f); vultureStartPosition = ((EntityState)this).characterBody.corePosition; if (finalTarget.y > vultureStartPosition.y) { ((EntityState)this).outer.SetNextStateToMain(); return; } madePrediction = true; swoopStopwatch = 0f; } if (madePrediction && !finishedSwoop) { if (((EntityState)this).characterMotor.isGrounded) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); } swoopStopwatch += Time.fixedDeltaTime; float num = finalTarget.x - vultureStartPosition.x; float num2 = finalTarget.y - vultureStartPosition.y; float num3 = finalTarget.z - vultureStartPosition.z; float num4 = 2f * num / Mathf.Pow(swoopDurationTilTarget, 2f); float num5 = 2f * num3 / Mathf.Pow(swoopDurationTilTarget, 2f); float num6 = 2f * num2 / Mathf.Pow(swoopDurationTilTarget, 2f); float num7 = 0f; float num8 = 0f; float num9 = 0f; if (!pastTarget) { num7 = num4 * swoopStopwatch; num8 = num6 * (swoopDurationTilTarget - swoopStopwatch); num9 = num5 * swoopStopwatch; } if (pastTarget) { num7 = num4 * (swoopFullDuration - swoopStopwatch); num8 = 0f - num6 * (swoopStopwatch - swoopDurationTilTarget); num9 = num5 * (swoopFullDuration - swoopStopwatch); } if (((EntityState)this).isAuthority && swoopStopwatch > firstSwingDelay && swoopStopwatch < firstSwingDelay + (float)maxSwingCount * swingInterval) { attack.Fire((List)null); } if (swoopStopwatch > nextSwingTime && swingCount < maxSwingCount) { nextSwingTime += swingInterval; swingCount++; SwingEffect(); } Vector3 velocity = default(Vector3); ((Vector3)(ref velocity))..ctor(num7, num8, num9); ((EntityState)this).characterMotor.velocity = velocity; if ((Object)(object)((EntityState)this).characterDirection != (Object)null) { ((EntityState)this).characterDirection.moveVector = ((Vector3)(ref velocity)).normalized; } effectTimer -= Time.fixedDeltaTime; if (effectTimer < 0f) { effectTimer += effectInterval; EffectManager.SpawnEffect(jumpEffect, new EffectData { scale = 2f, origin = ((EntityState)this).characterBody.footPosition, rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity) }, true); } } if (swoopStopwatch > swoopDurationTilTarget) { pastTarget = true; } if (swoopStopwatch > swoopFullDuration) { finishedSwoop = true; CharacterMotor characterMotor2 = ((EntityState)this).characterMotor; characterMotor2.velocity /= 1.2f; recoverTimer += Time.fixedDeltaTime; if (recoverTimer > recoverDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } } private void OnTargetLost() { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void SwingEffect() { //IL_00d0: 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) Util.PlaySound("Play_acrid_m1_slash", ((EntityState)this).gameObject); string text = ""; int num = (swingCount - 1) % 2; text = ((num != ((!startLeftFoot) ? 1 : 0)) ? "FootR" : "FootL"); if (!Object.op_Implicit((Object)(object)slashEffect)) { return; } Transform val = ((BaseState)this).FindModelChild(text); if (!Object.op_Implicit((Object)(object)val)) { return; } if (!EffectManager.ShouldUsePooledEffect(slashEffect)) { if ((Object)(object)slashEffectInstance != (Object)null) { EntityState.Destroy((Object)(object)slashEffectInstance); slashEffectInstance = null; } slashEffectInstance = Object.Instantiate(slashEffect, val); slashEffectInstance.transform.localScale = Vector3.one; } else { if ((Object)(object)_emh_slashEffectInstance != (Object)null && _emh_slashEffectInstance.OwningPool != null) { ((GenericPool)(object)_emh_slashEffectInstance.OwningPool).ReturnObject(_emh_slashEffectInstance); _emh_slashEffectInstance = null; } _emh_slashEffectInstance = EffectManager.GetAndActivatePooledEffect(slashEffect, val, true); slashEffectInstance = ((Component)_emh_slashEffectInstance).gameObject; if ((Object)(object)slashEffectInstance == (Object)null) { return; } slashEffectInstance.transform.localScale = Vector3.one; } ScaleParticleSystemDuration component = slashEffectInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.newDuration = component.initialDuration; } } 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; } private void DisableCollision() { //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) if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { _origLayer = ((EntityState)this).gameObject.layer; ((EntityState)this).gameObject.layer = LayerIndex.GetAppropriateFakeLayerForTeam(((EntityState)this).teamComponent.teamIndex).intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); } } private void EnableCollision() { if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((EntityState)this).gameObject.layer = _origLayer; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); } } } } namespace EnemyAbilities.Abilities.Titan { [EnemyAbilities.ModuleInfo("Seismic Shockwave", "Gives Stone Titans a new Primary ability:\n-Seismic Shockwave: Allows Stone Titans to jump and unleash a slow-moving radial shockwave that deals light damage and knocks up both allies and enemies. Also grants some buffs to Stone Titan's Geode ability.", "Stone Titan", true)] public class ShockwaveModule : BaseModule { public class ShockwaveStomp : BaseSkillState { private static float baseDuration = 5f; private float duration; private GameObject shockwaveInstance; private int frames; private static int framesToWait = 3; private static GameObject chargeEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Golem.GolemClapCharge_prefab).WaitForCompletion(); private GameObject leftFootEffect; private GameObject rightFootEffect; private EffectManagerHelper _emh_leftFootEffect; private EffectManagerHelper _emh_rightFootEffect; private static float effectInterval = 0.25f; private float effectTimer = 0f; private Transform leftFootTransform; private Transform rightFootTransform; private static float jumpVelocity = stompJumpVelocity.Value; public override void OnEnter() { //IL_0042: 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_0060: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlaySound("Play_gravekeeper_jump", ((EntityState)this).gameObject); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (((EntityState)this).characterMotor.isGrounded) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity += new Vector3(0f, jumpVelocity, 0f); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); } ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent(); if (!((Object)(object)component != (Object)null)) { return; } leftFootTransform = component.FindChild("FootL"); rightFootTransform = component.FindChild("FootR"); if ((Object)(object)leftFootTransform != (Object)null) { if (!EffectManager.ShouldUsePooledEffect(chargeEffectPrefab)) { leftFootEffect = Object.Instantiate(chargeEffectPrefab, leftFootTransform); } else { _emh_leftFootEffect = EffectManager.GetAndActivatePooledEffect(chargeEffectPrefab, leftFootTransform, true); leftFootEffect = ((Component)_emh_leftFootEffect).gameObject; } } if ((Object)(object)rightFootTransform != (Object)null) { if (!EffectManager.ShouldUsePooledEffect(chargeEffectPrefab)) { rightFootEffect = Object.Instantiate(chargeEffectPrefab, rightFootTransform); return; } _emh_rightFootEffect = EffectManager.GetAndActivatePooledEffect(chargeEffectPrefab, rightFootTransform, true); rightFootEffect = ((Component)_emh_rightFootEffect).gameObject; } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_015b: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); frames++; effectTimer -= Time.fixedDeltaTime; if (effectTimer < 0f) { effectTimer += effectInterval; Quaternion identity = Quaternion.identity; if ((Object)(object)leftFootTransform != (Object)null) { if (!EffectManager.ShouldUsePooledEffect(pulseEffectPrefab)) { Object.Instantiate(pulseEffectPrefab, leftFootTransform.position, identity); } else { EffectManager.GetAndActivatePooledEffect(pulseEffectPrefab, leftFootTransform.position, identity); } } if ((Object)(object)rightFootTransform != (Object)null) { if (!EffectManager.ShouldUsePooledEffect(pulseEffectPrefab)) { Object.Instantiate(pulseEffectPrefab, rightFootTransform.position, identity); } else { EffectManager.GetAndActivatePooledEffect(pulseEffectPrefab, rightFootTransform.position, identity); } } } if (((EntityState)this).characterMotor.isGrounded && frames > framesToWait) { if (((EntityState)this).isAuthority) { shockwaveInstance = new GameObject(); shockwaveInstance.transform.position = ((EntityState)this).characterBody.footPosition; ShockwaveController shockwaveController = shockwaveInstance.AddComponent(); shockwaveController.owner = ((Component)((EntityState)this).characterBody).gameObject; shockwaveController.ownerDamageStat = ((EntityState)this).characterBody.damage; shockwaveController.teamIndex = ((EntityState)this).characterBody.teamComponent.teamIndex; shockwaveController.Setup(); Util.PlaySound("Play_grandParent_attack1_boulderLarge_impact", ((EntityState)this).gameObject); NetworkServer.Spawn(shockwaveInstance); EffectManager.SpawnEffect(landingEffect, new EffectData { origin = ((EntityState)this).characterBody.footPosition, scale = 3f }, true); if ((Object)(object)leftFootEffect != (Object)null) { if ((Object)(object)_emh_leftFootEffect != (Object)null && _emh_leftFootEffect.OwningPool != null) { ((GenericPool)(object)_emh_leftFootEffect.OwningPool).ReturnObject(_emh_leftFootEffect); } else { EntityState.Destroy((Object)(object)leftFootEffect); } leftFootEffect = null; _emh_leftFootEffect = null; } if ((Object)(object)rightFootEffect != (Object)null) { if ((Object)(object)_emh_rightFootEffect != (Object)null && _emh_rightFootEffect.OwningPool != null) { ((GenericPool)(object)_emh_rightFootEffect.OwningPool).ReturnObject(_emh_rightFootEffect); } else { EntityState.Destroy((Object)(object)rightFootEffect); } rightFootEffect = null; _emh_rightFootEffect = null; } } ((EntityState)this).outer.SetNextStateToMain(); } else if (((EntityState)this).fixedAge > duration) { ((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 ShockwaveController : MonoBehaviour { private class HitInfo { public CharacterBody body; public float timeSinceHit; } public GameObject owner; public float ownerDamageStat; public TeamIndex teamIndex; private float stopwatch; private GameObject indicatorPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion(); private GameObject innerRingInstance; private GameObject outerRingInstance; private static float lifetime = stompRingLifetime.Value; private static float ringWidth = stompRingWidth.Value; private static float height = stompRingHeightCutoff.Value; private static float speed = stompRingSpeed.Value; private static float timeBetweenDamageTicksPerEnemy = 1f; private uint soundID; private float effectTimer; private static float effectInterval = 0.5f; private List recentlyHitEnemies; public void Start() { stopwatch = 0f; recentlyHitEnemies = new List(); soundID = Util.PlaySound("Play_moonBrother_phaseJump_shockwave_loop", ((Component)this).gameObject); } public void Setup() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00c1: Unknown result type (might be due to invalid IL or missing references) innerRingInstance = Object.Instantiate(indicatorPrefab, ((Component)this).gameObject.transform.position, Util.QuaternionSafeLookRotation(Vector3.up)); outerRingInstance = Object.Instantiate(indicatorPrefab, ((Component)this).gameObject.transform.position, Util.QuaternionSafeLookRotation(Vector3.up)); TeamAreaIndicator component = innerRingInstance.GetComponent(); TeamAreaIndicator component2 = outerRingInstance.GetComponent(); TeamFilter val = ((Component)this).gameObject.AddComponent(); val.teamIndex = teamIndex; component.teamFilter = val; component2.teamFilter = val; innerRingInstance.transform.localScale = Vector3.zero; outerRingInstance.transform.localScale = Vector3.one * ringWidth; } public void FixedUpdate() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) stopwatch += Time.fixedDeltaTime; float num = stopwatch * speed; Vector3 val = Vector3.one * num; Vector3 val2 = Vector3.one * (num + ringWidth); val.y = height; val2.y = height; innerRingInstance.transform.localScale = Vector3.one * num; outerRingInstance.transform.localScale = Vector3.one * (num + ringWidth); if (stopwatch > lifetime) { AkSoundEngine.StopPlayingID(soundID); Util.PlaySound("Stop_moonBrother_phaseJump_shockwave_loop", ((Component)this).gameObject); Object.Destroy((Object)(object)innerRingInstance); Object.Destroy((Object)(object)outerRingInstance); Object.Destroy((Object)(object)((Component)this).gameObject); } effectTimer -= Time.fixedDeltaTime; if (effectTimer < 0f) { effectTimer += effectInterval; SpawnEffectWheel(num); } CheckForEnemiesWithinRange(num); for (int num2 = recentlyHitEnemies.Count - 1; num2 >= 0; num2--) { HitInfo hitInfo = recentlyHitEnemies[num2]; if (hitInfo != null) { hitInfo.timeSinceHit += Time.fixedDeltaTime; if (hitInfo.timeSinceHit > timeBetweenDamageTicksPerEnemy) { recentlyHitEnemies.Remove(hitInfo); } } } } public void CheckForEnemiesWithinRange(float radius) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Expected O, but got Unknown Vector2 val = default(Vector2); Vector2 val2 = default(Vector2); foreach (CharacterBody body in CharacterBody.instancesList) { if ((Object)(object)body == (Object)null || (Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive) { continue; } ((Vector2)(ref val))..ctor(body.footPosition.x, body.footPosition.z); ((Vector2)(ref val2))..ctor(((Component)this).transform.position.x, ((Component)this).transform.position.z); float num = Vector2.Distance(val, val2); if (num < radius || num > radius + ringWidth) { continue; } float y = body.footPosition.y; float y2 = ((Component)this).transform.position.y; if (!(Mathf.Abs(y - y2) > height) && !((Object)(object)body.characterMotor == (Object)null) && body.characterMotor.isGrounded && !recentlyHitEnemies.Where((HitInfo hitInfo) => (Object)(object)hitInfo.body == (Object)(object)body).Any()) { if ((Object)(object)body == (Object)null) { break; } HitInfo item = new HitInfo { body = body, timeSinceHit = 0f }; if ((Object)(object)body.characterMotor != (Object)null) { body.characterMotor.ApplyForce(new Vector3(0f, stompKnockupForce.Value, 0f), true, false); } recentlyHitEnemies.Add(item); if (!((Object)(object)body.teamComponent == (Object)null) && body.teamComponent.teamIndex != teamIndex) { DamageTypeCombo val3 = default(DamageTypeCombo); val3.damageType = (DamageType)0; val3.damageSource = (DamageSource)1; DamageTypeCombo val4 = val3; DamageInfo val5 = new DamageInfo { damage = ownerDamageStat * stompDamageCoeff.Value / 100f, attacker = (owner ?? ((Component)this).gameObject), inflictor = (owner ?? ((Component)this).gameObject), position = body.transform.position, crit = false, force = new Vector3(0f, 0f, 0f), damageType = DamageTypeCombo.op_Implicit((DamageType)0), procCoefficient = 1f, damageColorIndex = (DamageColorIndex)0 }; body.healthComponent.TakeDamage(val5); } } } } public void SpawnEffectWheel(float radius) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown float num = radius + ringWidth; float num2 = MathF.PI * num * num - MathF.PI * radius * radius; float num3 = Mathf.Min(num2 / 12f, 50f) * stompEffectsMult.Value; Vector3 val = ((Component)this).transform.position + new Vector3(0f, height, 0f); float num4 = Random.Range(0f, MathF.PI * 2f); float num5 = MathF.PI * 2f / num3; float num6 = radius + ringWidth; RaycastHit val3 = default(RaycastHit); for (int i = 0; (float)i < num3; i++) { float num7 = Mathf.Cos(num4 + num5 * (float)i); float num8 = Mathf.Sin(num4 + num5 * (float)i); Vector3 val2 = val + new Vector3(num6 * num7, 0f, num6 * num8); if (Physics.Raycast(val2, Vector3.down, ref val3, height * 2f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { Vector3 point = ((RaycastHit)(ref val3)).point; EffectManager.SpawnEffect(rumbleEffect, new EffectData { origin = point, scale = 1f }, true); } } } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.TitanBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.TitanMaster_prefab).WaitForCompletion(); private static GameObject landingEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_BeetleGuard.BeetleGuardGroundSlam_prefab).WaitForCompletion(), "stoneTitanLandingEffect"); private static GameObject rumbleEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_SurvivorPod.PodGroundImpact_prefab).WaitForCompletion(), "stoneTitanRumbleEffect"); private static GameObject pulseEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Titan.ExplosionGolemClap_prefab).WaitForCompletion(), "pulseEffect"); private static EntityStateConfiguration rechargeRocksESC = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.EntityStates_TitanMonster_RechargeRocks_asset).WaitForCompletion(); private static GameObject titanRockController = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.TitanRockController_prefab).WaitForCompletion(); private static CharacterSpawnCard csc1 = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.cscTitanBlackBeach_asset).WaitForCompletion(); private static CharacterSpawnCard csc2 = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.cscTitanDampCave_asset).WaitForCompletion(); private static CharacterSpawnCard csc3 = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.cscTitanGolemPlains_asset).WaitForCompletion(); private static CharacterSpawnCard csc4 = Addressables.LoadAssetAsync((object)RoR2_Base_Titan.cscTitanGooLake_asset).WaitForCompletion(); private static ConfigEntry stompCooldown; private static ConfigEntry stompJumpVelocity; private static ConfigEntry stompRingLifetime; private static ConfigEntry stompRingWidth; private static ConfigEntry stompRingHeightCutoff; private static ConfigEntry stompRingSpeed; private static ConfigEntry stompKnockupForce; private static ConfigEntry stompDamageCoeff; private static ConfigEntry stompEffectsMult; public override void RegisterConfig() { base.RegisterConfig(); stompCooldown = BindFloat("Shockwave Cooldown", 15f, "The cooldown of the Seismic Shockwave", 8f, 30f, 0.1f, PluginConfig.FormatType.Time); stompJumpVelocity = BindFloat("Shockwave Jump Velocity", 20f, "The jump velocity of the Stone Titan when winding up for Seismic Shockwave. This is proportional to the wind-up duration. Bigger jump => more heads up.", 15f, 30f, 0.1f, PluginConfig.FormatType.Speed); stompRingLifetime = BindFloat("Shockwave Lifetime", 6f, "The lifetime of the shockwave before disappearing. Total shockwave radius is equal to Lifetime * Speed", 3f, 10f, 0.1f, PluginConfig.FormatType.Time); stompRingWidth = BindFloat("Shockwave Ring Width", 1.5f, "The width of the outwardly-expanding damage ring that causes damage and knock-up.", 0.5f, 4f, 0.1f, PluginConfig.FormatType.Distance); stompRingHeightCutoff = BindFloat("Shockwave Height Cutoff", 10f, "The difference in height from the epicenter that the shockwave's damage no longer applies. This can be seen by where particle effects no longer appear.", 5f, 15f, 0.1f, PluginConfig.FormatType.Distance); stompRingSpeed = BindFloat("Shockwave Ring Speed", 6f, "The speed at which the shockwave ring expands outwards.", 4f, 16f, 0.1f, PluginConfig.FormatType.Speed); stompKnockupForce = BindFloat("Shockwave Knockup Force", 4000f, "The force with which the shockwave knocks up both players and monsters.", 1000f, 6000f, 100f); stompDamageCoeff = BindFloat("Shockwave Damage Coefficient", 50f, "The damage coefficient of the shockwave. Stone Titans have very high base damage (40), so this is generally lower than most other skills.", 30f, 200f, 5f, PluginConfig.FormatType.Percentage); stompEffectsMult = BindFloat("Stomp Effects Mutliplier", 1f, "Affects the number of particles that appear when the ring expands outwards. Higher values may cause lag when multiple stone titans are present.", 0f, 1.5f, 0.1f, PluginConfig.FormatType.Multiplier); BindStats(bodyPrefab, new List(4) { csc1, csc2, csc3, csc4 }); } public override void Initialise() { base.Initialise(); CreateSkill(); SetupParticleEffects(); Extensions.TryModifyFieldValue(rechargeRocksESC, "baseDuration", 5f); TitanRockController component = titanRockController.GetComponent(); component.startDelay = 3f; component.fireInterval = 0.75f; } public void SetupParticleEffects() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Invalid comparison between Unknown and I4 //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) landingEffect.GetComponent().applyScale = true; landingEffect.GetComponent().disregardZScale = false; rumbleEffect.GetComponent().applyScale = true; rumbleEffect.GetComponent().disregardZScale = false; ParticleSystem[] componentsInChildren = landingEffect.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).scale = Vector3.one * 3f; SizeOverLifetimeModule sizeOverLifetime = val.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).sizeMultiplier = 3f; } ParticleSystem[] componentsInChildren2 = rumbleEffect.GetComponentsInChildren(); ParticleSystem[] array2 = componentsInChildren2; foreach (ParticleSystem val2 in array2) { ShapeModule shape2 = val2.shape; ((ShapeModule)(ref shape2)).scale = Vector3.one * 1f; SizeOverLifetimeModule sizeOverLifetime2 = val2.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime2)).sizeMultiplier = 0.4f; } ContentAddition.AddEffect(landingEffect); ContentAddition.AddEffect(rumbleEffect); ShakeEmitter component = rumbleEffect.GetComponent(); Light componentInChildren = rumbleEffect.GetComponentInChildren(); LightIntensityCurve componentInChildren2 = rumbleEffect.GetComponentInChildren(); Object.DestroyImmediate((Object)(object)componentsInChildren2.Where((ParticleSystem system) => ((Object)((Component)system).gameObject).name == "Flash").FirstOrDefault()); Object.DestroyImmediate((Object)(object)componentInChildren); Object.DestroyImmediate((Object)(object)componentInChildren2); Object.DestroyImmediate((Object)(object)component); Transform[] componentsInChildren3 = pulseEffectPrefab.GetComponentsInChildren(); Transform[] array3 = componentsInChildren3; foreach (Transform val3 in array3) { if (((Object)((Component)val3).gameObject).name == "Particles") { val3.localRotation = Quaternion.Euler(0f, 0f, 0f); } } ParticleSystem[] componentsInChildren4 = pulseEffectPrefab.GetComponentsInChildren(); ParticleSystem[] array4 = componentsInChildren4; foreach (ParticleSystem val4 in array4) { ShapeModule shape3 = val4.shape; ((ShapeModule)(ref shape3)).rotation = new Vector3(90f, 0f, 0f); ParticleSystemRenderer component2 = ((Component)val4).GetComponent(); if ((Object)(object)component2 != (Object)null && (int)component2.renderMode == 4) { MainModule main = val4.main; ((MainModule)(ref main)).startRotation3D = true; ((MainModule)(ref main)).startRotationX = MinMaxCurve.op_Implicit(MathF.PI / 2f); ((MainModule)(ref main)).startRotationY = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startRotationZ = MinMaxCurve.op_Implicit(0f); } } } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "TitanBodyShockwave", skillName = "TitanShockwave", esmName = "Stomp", activationState = ContentAddition.AddEntityState(ref flag), cooldown = stompCooldown.Value, combatSkill = true }; SkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, skillDef, "TitanPrimaryFamily", (SkillSlot)0); CreateEntityStateMachine(bodyPrefab, "Stomp"); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "usePrimaryAtCloseRange", skillSlot = (SkillSlot)0, minDistance = 0f, maxDistance = 50f, requireReady = true, targetType = (TargetType)0, aimType = (AimType)2, movementType = (MovementType)0, driverUpdateTimerOverride = 2f, desiredIndex = 0 }; CreateAISkillDriver(data2); } } } namespace EnemyAbilities.Abilities.Tanker { [EnemyAbilities.ModuleInfo("Jet Boost", "Gives Solus Scorchers a new Utility:\n-Jet Boost: Allows Solus Scorchers to dash forwards towards their current target. This module also incorporates many changes to the AI of Solus Scorchers, making them prioritise oiled players over their oil blobs. Also fixes numerous odd inconsistencies with Scorcher damage team affiliation and oil blob team affiliation.", "Solus Scorcher", true)] public class JetBoostModule : BaseModule { public class JetBoostSkillDef : SkillDef { public override bool IsReady([NotNull] GenericSkill skillSlot) { return ((SkillDef)this).IsReady(skillSlot); } } public class JetBoost : BaseSkillState { private float duration; private static float baseDuration = 0.5f; private float jetBoostSpeedMultiplier = jetBoostSpeedMult.Value / 100f; private float jetBoostSpeed; private Vector3 startAimVector; private float startMoveSpeed; private static GameObject fireEffect = Addressables.LoadAssetAsync((object)RoR2_DLC2_FalseSon.FalseSonLaserMuzzleFlashFire_prefab).WaitForCompletion(); public override void OnEnter() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlaySound("Play_mage_m1_shoot", ((EntityState)this).gameObject); duration = baseDuration / ((BaseState)this).attackSpeedStat; startMoveSpeed = ((BaseState)this).moveSpeedStat; jetBoostSpeed = startMoveSpeed * jetBoostSpeedMultiplier; if (!((Object)(object)((EntityState)this).inputBank == (Object)null)) { Vector3 val = (startAimVector = ((EntityState)this).inputBank.aimDirection); EffectManager.SimpleEffect(fireEffect, ((EntityState)this).transform.position, Util.QuaternionSafeLookRotation(-val), true); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Mathf.Pow(1f - Mathf.Clamp01(((EntityState)this).fixedAge / duration), 0.5f); if ((Object)(object)((EntityState)this).rigidbody != (Object)null) { Vector3 val = startAimVector * (startMoveSpeed + num * (jetBoostSpeed - startMoveSpeed)); Vector3 velocity = Vector3.Lerp(((EntityState)this).rigidbody.velocity, val, 0.5f); ((EntityState)this).rigidbody.velocity = velocity; } if (((EntityState)this).fixedAge > duration) { ((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 TankerBehaviourController : MonoBehaviour { private CharacterBody tankerBody; private GameObject enemyTarget; private GameObject accelerantTarget; private static float searchInterval = 0.25f; private static float oilCheckDistance = 16f; private float searchTimer; private BaseAI baseAI; private List oilTargetDrivers = new List(); public void Start() { tankerBody = ((Component)this).GetComponent(); searchTimer = searchInterval; CharacterMaster master = tankerBody.master; if (!((Object)(object)master != (Object)null)) { return; } baseAI = ((Component)master).GetComponent(); AISkillDriver[] skillDrivers = baseAI.skillDrivers; AISkillDriver[] array = skillDrivers; foreach (AISkillDriver val in array) { if (val.customName.Contains("OilTarget")) { oilTargetDrivers.Add(val); } } } public void FixedUpdate() { searchTimer -= Time.fixedDeltaTime; if (searchTimer < 0f) { searchTimer += searchInterval; PerformSearch(); } } public void PerformSearch() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0075: 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_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_00d2: 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_00da: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)tankerBody == (Object)null) { return; } TeamComponent teamComponent = tankerBody.teamComponent; if ((Object)(object)teamComponent == (Object)null) { return; } TeamMask enemyTeams = TeamMask.GetEnemyTeams(tankerBody.teamComponent.teamIndex); ((TeamMask)(ref enemyTeams)).RemoveTeam((TeamIndex)0); BullseyeSearch val = new BullseyeSearch(); val.viewer = tankerBody; val.searchOrigin = tankerBody.transform.position; val.filterByLoS = true; val.filterByDistinctEntity = true; val.minAngleFilter = 0f; val.maxAngleFilter = 360f; val.minDistanceFilter = 0f; val.maxDistanceFilter = 60f; val.searchDirection = tankerBody.transform.forward; val.teamMaskFilter = enemyTeams; val.sortMode = (SortMode)3; val.RefreshCandidates(); List source = (from hurtBox in val.GetResults() where HurtBoxValidForCustomTargetSelection(hurtBox) select hurtBox).ToList(); List source2 = source.Where((HurtBox hurtBox) => HurtBoxIsNonFlier(hurtBox)).ToList(); List source3 = source.Where((HurtBox hurtBox) => HurtBoxHasAccelerantDebuff(hurtBox)).ToList(); List source4 = source.Where((HurtBox hurtBox) => HurtBoxInOilRange(hurtBox)).ToList(); HurtBox? obj = source.FirstOrDefault(); GameObject val2 = ((obj != null) ? ((Component)obj.healthComponent.body).gameObject : null); bool flag = false; bool enabled = false; if (source3.Any()) { val2 = ((Component)source3.FirstOrDefault().healthComponent.body).gameObject; enabled = (Object)(object)val2 != (Object)null; } else if (source4.Any()) { flag = true; val2 = ((Component)source4.FirstOrDefault().healthComponent.body).gameObject; } else if (source2.Any()) { val2 = ((Component)source2.FirstOrDefault().healthComponent.body).gameObject; } enemyTarget = val2; if (flag) { GameObject closestOil; bool flag2 = TryFindClosestOil(enemyTarget, out closestOil); enabled = flag2; accelerantTarget = (flag2 ? closestOil : null); } else { accelerantTarget = null; } if ((Object)(object)baseAI == (Object)null || baseAI.customTarget == null) { return; } if ((Object)(object)enemyTarget != (Object)null) { baseAI.SetCustomTargetGameObject(enemyTarget); } if ((Object)(object)accelerantTarget != (Object)null) { baseAI.SetCustomTargetGameObject(accelerantTarget); } foreach (AISkillDriver oilTargetDriver in oilTargetDrivers) { ((Behaviour)oilTargetDriver).enabled = enabled; } AISkillDriver dominantSkillDriver = baseAI.skillDriverEvaluation.dominantSkillDriver; } public bool HurtBoxIsNonFlier(HurtBox hurtBox) { CharacterBody body = hurtBox.healthComponent.body; CharacterMotor characterMotor = body.characterMotor; Rigidbody rigidbody = body.rigidbody; if ((Object)(object)characterMotor == (Object)null && (Object)(object)rigidbody != (Object)null && !rigidbody.useGravity) { return false; } if ((Object)(object)characterMotor != (Object)null && characterMotor.isFlying) { return false; } return true; } public bool HurtBoxInOilRange(HurtBox hurtBox) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Vector3 position = hurtBox.healthComponent.body.transform.position; foreach (AccelerantController instances in InstanceTracker.GetInstancesList()) { Vector3 position2 = ((Component)instances).gameObject.transform.position; float num = Vector3.Distance(position, position2); if (num < oilCheckDistance) { return true; } } return false; } public bool HurtBoxValidForCustomTargetSelection(HurtBox hurtBox) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 if ((Object)(object)hurtBox == (Object)null || (Object)(object)hurtBox.healthComponent == (Object)null) { return false; } CharacterBody body = hurtBox.healthComponent.body; if ((Object)(object)body == (Object)null) { return false; } TeamComponent teamComponent = body.teamComponent; if ((Object)(object)teamComponent == (Object)null) { return false; } TeamIndex teamIndex = teamComponent.teamIndex; if ((int)teamIndex == 0) { return false; } return true; } public bool HurtBoxHasAccelerantDebuff(HurtBox hurtBox) { if (hurtBox.healthComponent.body.HasBuff(Buffs.Accelerant)) { return true; } return false; } public bool TryFindClosestOil(GameObject target, out GameObject closestOil) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Vector3 position = target.transform.position; closestOil = null; float num = float.PositiveInfinity; foreach (AccelerantController instances in InstanceTracker.GetInstancesList()) { Vector3 position2 = ((Component)instances).gameObject.transform.position; float num2 = Vector3.Distance(position2, position); if (num2 < oilCheckDistance && num2 < num) { num = num2; closestOil = ((Component)instances).gameObject; } } if ((Object)(object)closestOil != (Object)null) { return true; } return false; } } public class AccelerantController : MonoBehaviour { public void Start() { TeamComponent component = ((Component)this).GetComponent(); component.teamIndex = (TeamIndex)0; } public void OnEnable() { InstanceTracker.Add(this); } public void OnDisable() { InstanceTracker.Remove(this); } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_Tanker.TankerBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_Tanker.TankerMaster_prefab).WaitForCompletion(); private static EntityStateConfiguration escIgnite = Addressables.LoadAssetAsync((object)RoR2_DLC3_Tanker.EntityStates_Tanker_Ignite_asset).WaitForCompletion(); private static GameObject greaseProjectilePrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_Tanker.TankerAccelerantPuddleBodyProjectile_prefab).WaitForCompletion(); private static CharacterSpawnCard csc = Addressables.LoadAssetAsync((object)RoR2_DLC3_Tanker.cscTanker_asset).WaitForCompletion(); private static SkillDef ignite = Addressables.LoadAssetAsync((object)RoR2_DLC3_Tanker.TankerIgnite_asset).WaitForCompletion(); private static EntityStateConfiguration escSpawn = Addressables.LoadAssetAsync((object)RoR2_DLC3_Tanker.EntityStates_Tanker_SpawnState_asset).WaitForCompletion(); private static readonly string fireAtOilTargetName = "fireAtOilTarget"; private static readonly string fleeOilTargetName = "fleeOilTarget"; private static readonly string chaseOilTargetName = "chaseOilTarget"; private static readonly string strafeOilTargetName = "strafeOilTarget"; private static readonly string fireAtTargetName = "fireAtTarget"; private static readonly string fleeTargetName = "fleeTarget"; private static readonly string fireAccelerantName = "fireAccelerant"; private static readonly string strafeTargetName = "strafeTarget"; private static readonly string chaseTargetName = "chaseTarget"; private static readonly string chaseTargetFarName = "chaseTargetFar"; private static SkillDef jetBoost; private static ConfigEntry jetBoostCooldown; private static ConfigEntry jetBoostSpeedMult; private static ConfigEntry accelerantEnemyDamage; private static ConfigEntry accelerantPlayerDamage; public override void RegisterConfig() { base.RegisterConfig(); BindStats(bodyPrefab, new List(1) { csc }, new StatOverrides { directorCost = 28f }); jetBoostCooldown = BindFloat("Jet Boost Cooldown", 3f, "Cooldown of the skill. Note that Jet Boost is only selected when the Scorcher has an oil target.", 2f, 10f, 0.1f, PluginConfig.FormatType.Time); jetBoostSpeedMult = BindFloat("Jet Boost Speed", 300f, "The Solus Scorcher's top speed compared to it's base movement speed at the start of Jet Boost.", 200f, 400f, 1f, PluginConfig.FormatType.Percentage); accelerantEnemyDamage = BindFloat("Grease Explosion Damage (Enemy)", 200f, "The damage coefficient of grease puddles when ignited by an enemy.", 100f, 400f, 5f, PluginConfig.FormatType.Percentage); accelerantPlayerDamage = BindFloat("Grease Explosion Damage (Player)", 600f, "The damage coefficient of grease puddles when ignited by a player.", 100f, 1000f, 5f, PluginConfig.FormatType.Percentage); } public override void Initialise() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown base.Initialise(); Extensions.TryModifyFieldValue(escSpawn, "duration", 1f); CreateSkillDef(); bodyPrefab.AddComponent(); ProjectileSetOwnerAICustomTarget component = greaseProjectilePrefab.GetComponent(); Object.DestroyImmediate((Object)(object)component); AssignTeamFilterToTeamComponent component2 = greaseProjectilePrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component); } greaseProjectilePrefab.AddComponent(); HealthComponent.TakeDamageProcess += new Manipulator(ModifyAccelerantDamage); Ignite.FireFlamethrower += new Manipulator(ChangeIgniteTeamIndexOverride); Extensions.TryModifyFieldValue(escIgnite, "tickFrequency", 6f); Extensions.TryModifyFieldValue(escIgnite, "totalDamageCoefficient", 2f); CreateNewDrivers(); ignite.baseRechargeInterval = 1f; ignite.beginSkillCooldownOnSkillEnd = true; } private void ChangeIgniteTeamIndexOverride(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "teamIndexOverride") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((TeamIndex? originalValue, EntityState entityState) => (entityState != null && (Object)(object)entityState.characterBody != (Object)null && (Object)(object)entityState.characterBody.teamComponent != (Object)null) ? new TeamIndex?(entityState.characterBody.teamComponent.teamIndex) : originalValue)); } else { Log.Error("ChangeIgniteTeamIndexOverride cursor c1 failed to match!"); } } public void CreateSkillDef() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "TankerBodyJetBoost", skillName = "TankerJetBoost", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = jetBoostCooldown.Value, baseMaxStock = 1, combatSkill = false, intPrio = (InterruptPriority)0 }; jetBoost = (SkillDef)(object)CreateSkillDef(data); CreateGenericSkill(bodyPrefab, jetBoost, "TankerUtilityFamily", (SkillSlot)2); } public void CreateNewDrivers() { //IL_001e: 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_0049: 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_0090: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021b: 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_025f: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) AISkillDriverData data = new AISkillDriverData { masterPrefab = masterPrefab, customName = fireAtOilTargetName, skillSlot = (SkillSlot)0, requireReady = true, minDistance = 0f, maxDistance = 20f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)1, driverUpdateTimerOverride = 2.5f, moveInputScale = 0.5f, desiredIndex = 0 }; AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = fleeOilTargetName, skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 10f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)3, desiredIndex = 1 }; AISkillDriverData data3 = new AISkillDriverData { masterPrefab = masterPrefab, customName = strafeOilTargetName, skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 20f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)2, desiredIndex = 2 }; AISkillDriverData data4 = new AISkillDriverData { masterPrefab = masterPrefab, customName = chaseOilTargetName, skillSlot = (SkillSlot)2, requiredSkillDef = jetBoost, minDistance = 0f, maxDistance = 40f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)1, desiredIndex = 3 }; AISkillDriverData data5 = new AISkillDriverData { masterPrefab = masterPrefab, customName = chaseOilTargetName, skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = float.PositiveInfinity, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)1, desiredIndex = 4 }; AISkillDriverData data6 = new AISkillDriverData { masterPrefab = masterPrefab, customName = fireAtTargetName, skillSlot = (SkillSlot)0, requireReady = true, minDistance = 0f, maxDistance = 20f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)1, driverUpdateTimerOverride = 2.5f, noRepeat = true, desiredIndex = 5 }; AISkillDriverData data7 = new AISkillDriverData { masterPrefab = masterPrefab, customName = fleeTargetName, skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 20f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)3, desiredIndex = 6 }; AISkillDriverData data8 = new AISkillDriverData { masterPrefab = masterPrefab, customName = fireAccelerantName, skillSlot = (SkillSlot)1, requireReady = true, minDistance = 0f, maxDistance = 40f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)2, desiredIndex = 7 }; AISkillDriverData data9 = new AISkillDriverData { masterPrefab = masterPrefab, customName = strafeTargetName, skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 40f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)2, desiredIndex = 8 }; AISkillDriverData data10 = new AISkillDriverData { masterPrefab = masterPrefab, customName = chaseTargetName, skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 60f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)1, desiredIndex = 9 }; AISkillDriverData aISkillDriverData = new AISkillDriverData { masterPrefab = masterPrefab, customName = chaseTargetName, skillSlot = (SkillSlot)2, selectionRequiresTargetLoS = true, minDistance = 60f, maxDistance = 100f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)1, desiredIndex = 10 }; AISkillDriverData data11 = new AISkillDriverData { masterPrefab = masterPrefab, customName = chaseTargetFarName, skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = float.PositiveInfinity, targetType = (TargetType)0, aimType = (AimType)2, movementType = (MovementType)1, desiredIndex = 11 }; CreateAISkillDriver(data); CreateAISkillDriver(data2); CreateAISkillDriver(data3); CreateAISkillDriver(data5); CreateAISkillDriver(data4); CreateAISkillDriver(data6); CreateAISkillDriver(data7); CreateAISkillDriver(data8); CreateAISkillDriver(data9); CreateAISkillDriver(data10); CreateAISkillDriver(data11); } private void ModifyAccelerantDamage(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "accelerantBlastBaseDamage"), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "baseDamage") })) { val.Index += 3; val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float originalValue, HealthComponent healthComponent, DamageInfo damageInfo) { GameObject attacker = null; if (damageInfo != null && (Object)(object)damageInfo.attacker != (Object)null) { attacker = damageInfo.attacker; } float damage; return ((Object)(object)healthComponent != (Object)null && (Object)(object)healthComponent.body != (Object)null && TryCalculateIgnitionDamage(attacker, out damage)) ? damage : originalValue; }); } else { Log.Error("ModifyAccelerantDamage ILCursor c1 failed to match!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 62), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 32768) })) { val2.Index += 3; val2.EmitDelegate>((Func)delegate { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) DamageTypeCombo result = default(DamageTypeCombo); result.damageSource = (DamageSource)2; result.damageType = (DamageType)128; return result; }); } else { Log.Error("ModifyAccelerantDamage ILCursor c2 failed to match!"); } } public bool TryCalculateIgnitionDamage(GameObject attacker, out float damage) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 damage = 0f; if ((Object)(object)attacker == (Object)null) { return false; } CharacterBody component = attacker.GetComponent(); TeamComponent component2 = ((Component)component).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component2 != (Object)null) { bool flag = (int)component2.teamIndex == 1; damage = component.damage * (flag ? (accelerantPlayerDamage.Value / 100f) : (accelerantEnemyDamage.Value / 100f)); return true; } return false; } } } namespace EnemyAbilities.Abilities.Nullifier { [EnemyAbilities.ModuleInfo("Summon Void Angler", "Gives Void Reavers a new Special Ability:\n-Summon Void Angler: This summons forth a Void Angler that takes incredibly long range shots at the player. Void Anglers provide vision for their summoning Reavers, allowing the Void Reaver to use it's primary without direct line of sight. Nuxlar's AugmentedVoidReaver pairs well with this module, and is fully compatible!", "Void Reaver", true)] public class SummonAnglerEyeModule : BaseModule { public class SummonAnglerEye : BaseSkillState { private static float baseDuration = 0.25f; private float duration; private NullifierSummonController controller; private int maxSummons = (int)maxAnglers.Value; public override void OnEnter() { ((BaseState)this).OnEnter(); controller = ((Component)((EntityState)this).characterBody).GetComponent(); if (controller.summons.Count >= maxSummons) { ((EntityState)this).outer.SetNextStateToMain(); return; } duration = baseDuration / ((BaseState)this).attackSpeedStat; SpawnVoidEye(); } public void SpawnVoidEye() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0048: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) MasterSummon val = new MasterSummon { masterPrefab = anglerEyeMasterPrefab, ignoreTeamMemberLimit = true, position = ((EntityState)this).characterBody.transform.position + new Vector3(0f, 12f, 0f) }; val.rotation = Util.QuaternionSafeLookRotation(((EntityState)this).inputBank.aimDirection); val.summonerBodyObject = ((EntityState)this).gameObject; val.inventoryToCopy = ((EntityState)this).characterBody.inventory; val.useAmbientLevel = null; CharacterMaster val2 = val.Perform(); CharacterBody body = val2.GetBody(); controller.AddSummon(body); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration) { ((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 AnglerEyeSpawnState : BaseState { public static float duration = 2.75f; public static string spawnSoundString = "Play_nullifier_spawn"; public static string spawnStateString = "Spawn"; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).PlayAnimation("Body", spawnStateString); Util.PlayAttackSpeedSound(spawnSoundString, ((EntityState)this).gameObject, 2f); EffectManager.SimpleMuzzleFlash(portalVFX, ((EntityState)this).gameObject, "PortalMuzzle", true); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } public class AnglerEyeFlyState : FlyState { private BaseAI baseAI; private EntityStateMachine weaponESM; private bool currentlyAttacking; private bool canSeeTarget; private bool idle; public override void OnEnter() { ((FlyState)this).OnEnter(); idle = true; baseAI = ((Component)((EntityState)this).characterBody.master).GetComponent(); weaponESM = (from esm in ((Component)((EntityState)this).characterBody).GetComponents() where esm.customName == "Weapon" select esm).FirstOrDefault(); } public override void Update() { ((FlyState)this).Update(); } public override void FixedUpdate() { ((FlyState)this).FixedUpdate(); if ((Object)(object)weaponESM != (Object)null) { if (!(weaponESM.state is Idle)) { currentlyAttacking = true; idle = true; } else { currentlyAttacking = false; } } if ((Object)(object)baseAI != (Object)null && baseAI.currentEnemy != null && baseAI.currentEnemy.hasLoS) { canSeeTarget = true; } else { canSeeTarget = false; } if (!currentlyAttacking) { if (canSeeTarget && idle) { idle = false; ((EntityState)this).PlayCrossfade("Body", "Move", 0.2f); } if (!canSeeTarget && !idle) { idle = true; ((EntityState)this).PlayCrossfade("Body", "Idle", 0.2f); } } } public override bool CanExecuteSkill(GenericSkill skillSlot) { return ((FlyState)this).CanExecuteSkill(skillSlot); } public override void PerformInputs() { ((FlyState)this).PerformInputs(); } } public class AnglerEyeShoot : BaseSkillState { public static float baseAttackDuration = 3f; public float attackDuration; public static float baseTotalDuration = 5.334f; public static float damageCoefficient = anglerBeamDamage.Value / 100f; private float totalDuration; private BaseAI baseAI; private CharacterBody targetBody; private GameObject laserIndicatorInstance; private Transform eyeMuzzle; private LineRenderer laserLineComponent; private Vector3 laserEndPosition; private float maxRange = anglerMaxRange.Value; private bool fired = false; private static GameObject muzzleFlashEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorBeamMuzzleflash_prefab).WaitForCompletion(); private static GameObject impactEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorBeamImpact_prefab).WaitForCompletion(); private static GameObject tracerEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorBeamTracer_prefab).WaitForCompletion(); private uint soundID; private Vector3 currentLaserDirection; private static float stiffness = 30f; private static float damping = 4f; private Vector3 laserAngularVelocity = Vector3.zero; public override void OnEnter() { //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); attackDuration = baseAttackDuration / ((BaseState)this).attackSpeedStat; totalDuration = baseTotalDuration / ((BaseState)this).attackSpeedStat; if ((Object)(object)((EntityState)this).characterBody != (Object)null && (Object)(object)((EntityState)this).characterBody.master != (Object)null) { baseAI = ((Component)((EntityState)this).characterBody.master).GetComponent(); if ((Object)(object)baseAI != (Object)null && baseAI.currentEnemy != null && (Object)(object)baseAI.currentEnemy.characterBody != (Object)null) { targetBody = baseAI.currentEnemy.characterBody; } } ((EntityState)this).PlayCrossfade("Body", "Attack", "PlaybackRate.attack1", totalDuration, 0.2f); ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent(); soundID = Util.PlaySound("Play_voidAngler_attack1_warning", ((EntityState)this).gameObject); if ((Object)(object)component != (Object)null) { eyeMuzzle = component.FindChild("EyeMuzzle"); } if ((Object)(object)eyeMuzzle != (Object)null) { laserIndicatorInstance = Object.Instantiate(anglerEyeLaserIndicator, eyeMuzzle.position, eyeMuzzle.rotation); } if ((Object)(object)laserIndicatorInstance != (Object)null) { if (!laserIndicatorInstance.activeInHierarchy) { laserIndicatorInstance.SetActive(true); } if ((Object)(object)laserIndicatorInstance.transform.parent != (Object)(object)eyeMuzzle) { laserIndicatorInstance.transform.SetParent(eyeMuzzle); } laserLineComponent = laserIndicatorInstance.GetComponent(); laserLineComponent.startWidth = 0.4f; laserLineComponent.endWidth = 0.4f; Ray aimRay = ((BaseState)this).GetAimRay(); currentLaserDirection = ((Ray)(ref aimRay)).direction; UpdateLaserEndPoint(); UpdateLaserVisualPosition(); } } public override void FixedUpdate() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00e5: 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_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) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); UpdateLaserEndPoint(); if (((EntityState)this).fixedAge > attackDuration && !fired) { fired = true; EntityState.Destroy((Object)(object)laserIndicatorInstance); laserIndicatorInstance = null; laserLineComponent = null; Util.PlaySound("Play_anglerEye_shoot_02", ((EntityState)this).gameObject); if ((Object)(object)muzzleFlashEffectPrefab != (Object)null) { EffectManager.SimpleMuzzleFlash(muzzleFlashEffectPrefab, ((EntityState)this).gameObject, "EyeMuzzle", false); } AkSoundEngine.StopPlayingID(soundID); if (((EntityState)this).isAuthority) { DamageTypeCombo val = default(DamageTypeCombo); val.damageSource = (DamageSource)1; val.damageType = (DamageType)0; DamageTypeCombo damageType = val; Ray aimRay = ((BaseState)this).GetAimRay(); BulletAttack val2 = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = currentLaserDirection, muzzleName = "EyeMuzzle", maxDistance = maxRange, minSpread = 0f, maxSpread = 0f, radius = 0.1f, falloffModel = (FalloffModel)0, smartCollision = true, damage = damageCoefficient * ((BaseState)this).damageStat, procCoefficient = 1f, force = 1000f, isCrit = ((BaseState)this).RollCrit(), damageType = damageType, tracerEffectPrefab = tracerEffectPrefab, hitEffectPrefab = impactEffectPrefab }; val2.Fire(); } } if (((EntityState)this).fixedAge > totalDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); UpdateLaserVisualPosition(); } public void UpdateLaserVisualPosition() { //IL_008d: 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) if (!((Object)(object)laserLineComponent == (Object)null) && !((Object)(object)eyeMuzzle == (Object)null)) { if (((EntityState)this).fixedAge > attackDuration / 2f) { float num = ((((EntityState)this).fixedAge % 0.1f > 0.05f) ? 0.1f : 0.5f); laserLineComponent.startWidth = num; laserLineComponent.endWidth = num; } laserLineComponent.SetPosition(0, eyeMuzzle.position); laserLineComponent.SetPosition(1, laserEndPosition); } } public void UpdateLaserEndPoint() { //IL_0047: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00d9: 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_00e8: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetBody != (Object)null && (Object)(object)laserIndicatorInstance != (Object)null) { Vector3 val = (((Object)(object)eyeMuzzle != (Object)null) ? eyeMuzzle.position : ((EntityState)this).transform.position); Vector3 val2 = targetBody.corePosition - val; Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = normalized - currentLaserDirection; Vector3 val4 = val3 * stiffness; Vector3 val5 = -laserAngularVelocity * damping; laserAngularVelocity += (val4 + val5) * Time.fixedDeltaTime; val2 = currentLaserDirection + laserAngularVelocity * Time.fixedDeltaTime; currentLaserDirection = ((Vector3)(ref val2)).normalized; Ray aimRay = ((BaseState)this).GetAimRay(); RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aimRay)).origin, currentLaserDirection, ref val6, maxRange, LayerMask.op_Implicit(CommonMasks.laser))) { laserEndPosition = ((RaycastHit)(ref val6)).point; } else { laserEndPosition = ((Ray)(ref aimRay)).origin + currentLaserDirection * maxRange; } } } public override void OnExit() { ((EntityState)this).OnExit(); if ((Object)(object)laserIndicatorInstance != (Object)null) { EntityState.Destroy((Object)(object)laserIndicatorInstance); } } 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 AnglerEyeDeath : GenericCharacterDeath { private static GameObject deathVFX = Addressables.LoadAssetAsync((object)RoR2_Base_Jellyfish.JellyfishDeath_prefab).WaitForCompletion(); public override void OnEnter() { ((GenericCharacterDeath)this).OnEnter(); GenericCharacterDeath.maxFallDuration = 3f; ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent(); Transform val = component.FindChild("EyeBeam"); Light component2 = ((Component)val).gameObject.GetComponent(); ((Behaviour)component2).enabled = false; } public override void FixedUpdate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterDeath)this).FixedUpdate(); float x = ((EntityState)this).rigidbody.velocity.x; float y = ((EntityState)this).rigidbody.velocity.y; float z = ((EntityState)this).rigidbody.velocity.z; float num = x * 0.8f; float num2 = z * 0.8f; float num3 = ((y < 4f) ? (y + 1f) : y); ((EntityState)this).rigidbody.velocity = new Vector3(num, num3, num2); } public override void OnPreDestroyBodyServer() { //IL_0024: 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) ((GenericCharacterDeath)this).OnPreDestroyBodyServer(); Util.PlaySound("Play_jellyfish_death", ((EntityState)this).gameObject); EffectManager.SimpleEffect(deathVFX, ((EntityState)this).characterBody.corePosition, ((EntityState)this).characterBody.transform.rotation, false); } } public class NullifierSummonController : MonoBehaviour { public class SummonInfo { public CharacterBody body; public BaseAI ai; } public List summons = new List(); public List spiedEnemies = new List(); public float spyCheckTimer; public float spyCheckInterval = 0.25f; private BaseAI reaverAI; public void Start() { CharacterBody component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { CharacterMaster master = component.master; if ((Object)(object)master != (Object)null) { reaverAI = ((Component)master).gameObject.GetComponent(); } } } public void AddSummon(CharacterBody body) { if ((Object)(object)body != (Object)null && (Object)(object)body.master != (Object)null) { BaseAI component = ((Component)body.master).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { SummonInfo item = new SummonInfo { body = body, ai = component }; summons.Add(item); } } } public void FixedUpdate() { //IL_0158: 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) for (int num = summons.Count - 1; num >= 0; num--) { SummonInfo summonInfo = summons[num]; CharacterBody body = summonInfo.body; if ((Object)(object)body == (Object)null || (Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive) { summons.Remove(summonInfo); } } if (!anglersProvideVision.Value) { return; } spyCheckTimer -= Time.fixedDeltaTime; if (!(spyCheckTimer < 0f)) { return; } spyCheckTimer += spyCheckInterval; spiedEnemies = new List(); foreach (SummonInfo summon in summons) { CharacterBody body2 = summon.body; BaseAI ai = summon.ai; if (!((Object)(object)body2 == (Object)null) && !((Object)(object)ai == (Object)null) && ai.currentEnemy != null && (Object)(object)ai.currentEnemy.characterBody != (Object)null) { CharacterBody characterBody = ai.currentEnemy.characterBody; float num2 = Vector3.Distance(body2.corePosition, characterBody.corePosition); if (!(num2 > anglerMaxRange.Value) && ai.currentEnemy.hasLoS && !spiedEnemies.Contains(characterBody)) { spiedEnemies.Add(characterBody); } } } if (spiedEnemies.Count > 0) { if ((Object)(object)reaverAI != (Object)null) { reaverAI.SetCustomTargetGameObject(((Component)spiedEnemies[0]).gameObject); } } else { reaverAI.customTarget.gameObject = null; } foreach (CharacterBody spiedEnemy in spiedEnemies) { if ((Object)(object)spiedEnemy != (Object)null) { spiedEnemy.AddTimedBuff(watchedDebuff, 1f); } } } public void KillAllSumons() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (summons.Count <= 0) { return; } for (int num = summons.Count - 1; num >= 0; num--) { CharacterBody body = summons[num].body; if ((Object)(object)body != (Object)null && (Object)(object)body.healthComponent != (Object)null) { body.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } } } public class EnemyAbilitiesAimPortalBomb : AimPortalBomb { private HurtBox customTargetHurtBox; public override void OnEnter() { ((AimPortalBomb)this).OnEnter(); if (((EntityState)this).isAuthority && !((Object)(object)((EntityState)this).characterBody == (Object)null) && !((Object)(object)((EntityState)this).characterBody.master == (Object)null)) { BaseAI component = ((Component)((EntityState)this).characterBody.master).gameObject.GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.customTarget.bestHurtBox == (Object)null)) { customTargetHurtBox = component.customTarget.bestHurtBox; } } } public override void FixedUpdate() { ((AimPortalBomb)this).FixedUpdate(); if ((Object)(object)customTargetHurtBox != (Object)null) { ((EntityState)this).outer.SetNextState((EntityState)(object)new EnemyAbilitiesFirePortalBomb { customTargetHurtBox = customTargetHurtBox }); } } 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 EnemyAbilitiesFirePortalBomb : FirePortalBomb { public HurtBox customTargetHurtBox; public override void OnEnter() { ((FirePortalBomb)this).OnEnter(); } public override void FixedUpdate() { if ((Object)(object)customTargetHurtBox == (Object)null) { ((FirePortalBomb)this).FixedUpdate(); } else { CustomFixedUpdate(); } } public void CustomFixedUpdate() { ((EntityState)this).fixedAge = ((EntityState)this).fixedAge + ((EntityState)this).GetDeltaTime(); if (((EntityState)this).isAuthority) { base.fireTimer -= Time.fixedDeltaTime; if (base.fireTimer <= 0f) { base.fireTimer += base.fireInterval; FireBomb(); base.bombsFired++; } if (((EntityState)this).fixedAge >= base.duration) { ((EntityState)this).outer.SetNextStateToMain(); } } } public void FireBomb() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00e7: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)customTargetHurtBox != (Object)null) { Vector3 position = ((Component)customTargetHurtBox).transform.position; Vector2 val; if (base.bombsFired != 0) { Vector2 insideUnitCircle = Random.insideUnitCircle; val = ((Vector2)(ref insideUnitCircle)).normalized * 5f * (float)base.bombsFired; } else { val = Vector2.zero; } Vector2 val2 = val; position.x += val2.x; position.z += val2.y; Vector3 val3 = position; Vector3 position2 = val3; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3 + new Vector3(0f, 10f, 0f), Vector3.down, ref val4, 20f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { position2 = ((RaycastHit)(ref val4)).point; } FireProjectileInfo val5 = default(FireProjectileInfo); val5.projectilePrefab = FirePortalBomb.portalBombProjectileEffect; val5.position = position2; val5.rotation = Quaternion.identity; val5.owner = ((EntityState)this).gameObject; val5.damage = ((BaseState)this).damageStat * FirePortalBomb.damageCoefficient; val5.force = FirePortalBomb.force; val5.crit = ((EntityState)this).characterBody.RollCrit(); ProjectileManager.instance.FireProjectile(val5); } } 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; } } private static GameObject anglerEyeBodyPrefab = EnemyAbilities.Instance.assetBundle.LoadAsset("AnglerEyeBody"); private static GameObject anglerEyeMasterPrefab = EnemyAbilities.Instance.assetBundle.LoadAsset("AnglerEyeMaster"); private static GameObject nullifierBodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Nullifier.NullifierBody_prefab).WaitForCompletion(); private static GameObject nullifierMasterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Nullifier.NullifierMaster_prefab).WaitForCompletion(); private static GameObject anglerEyeLaserIndicator = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Golem.LaserGolem_prefab).WaitForCompletion(), "VoidAnglerLaserIndicator"); private static GameObject portalVFX = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Nullifier.NullifierSpawnEffect_prefab).WaitForCompletion(), "AnglerEyeSpawnEffect"); private static CharacterSpawnCard cscNullifier = Addressables.LoadAssetAsync((object)RoR2_Base_Nullifier.cscNullifier_asset).WaitForCompletion(); private static SkillDef firePortalBombSkillDef = Addressables.LoadAssetAsync((object)RoR2_Base_Nullifier.FireNullifier_asset).WaitForCompletion(); private static ConfigEntry summonCooldown; private static ConfigEntry anglersProvideVision; private static ConfigEntry maxAnglers; private static ConfigEntry anglerHealth; private static ConfigEntry anglerMovespeed; private static ConfigEntry anglerMaxRange; private static ConfigEntry anglerBeamDamage; private static ConfigEntry anglerBeamCooldown; private static BuffDef watchedDebuff; public override void RegisterConfig() { base.RegisterConfig(); summonCooldown = BindFloat("Summon Cooldown", 12f, "The cooldown of the Summon Void Angler ability.", 6f, 30f, 0.1f, PluginConfig.FormatType.Time); anglersProvideVision = BindBool("Anglers Provide Vision", defaultValue: true, "Void Anglers provide vision to their parent Void Reavers, allowing the Void Reavers to use their portal bombs without direct line-of-sight."); maxAnglers = BindFloat("Max Summons", 2f, "The maximum number of Void Anglers that can be active per Void Reaver.", 1f, 5f, 1f); anglerHealth = BindFloat("Angler Health", 40f, "The base health of Void Anglers at level 1. Increases by 30% per level.", 20f, 100f, 1f); anglerMovespeed = BindFloat("Angler Speed", 18f, "The base movement speed of Void Anglers.", 4f, 20f, 1f, PluginConfig.FormatType.Speed); anglerMaxRange = BindFloat("Angler Max Range", 200f, "The maximum attack range of Void Anglers", 50f, 1000f, 10f, PluginConfig.FormatType.Distance); anglerBeamCooldown = BindFloat("Angler Beam Cooldown", 8f, "The cooldown of the Void Angler's beam attack.", 4f, 12f, 1f, PluginConfig.FormatType.Time); anglerBeamDamage = BindFloat("Angler Beam Damage", 200f, "The damage coefficient of the Void Angler's beam attack.", 100f, 400f, 5f, PluginConfig.FormatType.Percentage); BindStats(nullifierBodyPrefab, new List(1) { cscNullifier }); } public override void Initialise() { //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_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_01c0: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Expected O, but got Unknown base.Initialise(); GlobalEventManager.onCharacterDeathGlobal += KillLinkedAnglerEyes; ContentAddition.AddBody(anglerEyeBodyPrefab); ContentAddition.AddMaster(anglerEyeMasterPrefab); PrefabAPI.RegisterNetworkPrefab(anglerEyeBodyPrefab); PrefabAPI.RegisterNetworkPrefab(anglerEyeMasterPrefab); ContentAddition.AddEffect(portalVFX); nullifierBodyPrefab.AddComponent(); LanguageAPI.Add("SKELETOGNE_ANGLEREYE_BODY_NAME", "Void Angler"); CreateNullifierSkill(); CreateAnglerEyeSkill(); CreateBuffDef(); HurtBox componentInChildren = anglerEyeBodyPrefab.GetComponentInChildren(); ((Component)componentInChildren).gameObject.layer = LayerIndex.entityPrecise.intVal; CharacterBody component = anglerEyeBodyPrefab.GetComponent(); component.baseMaxHealth = anglerHealth.Value; component.levelMaxHealth = anglerHealth.Value * 0.3f; component.baseMoveSpeed = anglerMovespeed.Value; component.baseAcceleration = anglerMovespeed.Value * 2f; EntityStateMachine val = (from esm in anglerEyeBodyPrefab.GetComponents() where esm.customName == "Body" select esm).FirstOrDefault(); if ((Object)(object)val != (Object)null) { val.initialStateType = new SerializableEntityStateType(typeof(AnglerEyeSpawnState)); val.mainStateType = new SerializableEntityStateType(typeof(AnglerEyeFlyState)); } CharacterDeathBehavior component2 = anglerEyeBodyPrefab.GetComponent(); component2.deathState = new SerializableEntityStateType(typeof(AnglerEyeDeath)); EntityStateMachine component3 = anglerEyeMasterPrefab.GetComponent(); component3.customName = "AI"; component3.initialStateType = new SerializableEntityStateType(typeof(Wander)); component3.mainStateType = new SerializableEntityStateType(typeof(Wander)); BaseAI component4 = anglerEyeMasterPrefab.GetComponent(); component4.scanState = new SerializableEntityStateType(typeof(Wander)); RigidbodyMotor component5 = anglerEyeBodyPrefab.GetComponent(); RigidbodyDirection component6 = anglerEyeBodyPrefab.GetComponent(); VectorPID[] components = anglerEyeBodyPrefab.GetComponents(); QuaternionPID component7 = anglerEyeBodyPrefab.GetComponent(); component5.forcePID = components[0]; component6.torquePID = components[1]; component6.angularVelocityPID = component7; LineRenderer component8 = anglerEyeLaserIndicator.GetComponent(); component8.startWidth = 0.5f; component8.endWidth = 0.5f; Material val2 = new Material(Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.matVoidBlinkTrail_mat).WaitForCompletion()); val2.SetColor("_TintColor", new Color(1f, 0f, 1f, 1f)); ((Renderer)component8).material = val2; ((Renderer)component8).materials = (Material[])(object)new Material[1] { val2 }; CharacterModel componentInChildren2 = anglerEyeBodyPrefab.GetComponentInChildren(); portalVFX.GetComponent().localScale = new Vector3(0.5f, 0.5f, 0.5f); if (EnemyAbilities.AVRInstalled && anglersProvideVision.Value) { BullseyeSearch.GetResults += new hook_GetResults(ModifyReaverBullseyeSearchResults); return; } bool flag = default(bool); firePortalBombSkillDef.activationState = ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); } private IEnumerable ModifyReaverBullseyeSearchResults(orig_GetResults orig, BullseyeSearch self) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 //IL_0051: 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) IEnumerable result = orig.Invoke(self); if (self.maxDistanceFilter != FirePortalBomb.maxDistance) { return result; } if ((int)self.sortMode != 3) { return result; } if ((Object)(object)self.viewer != (Object)null && self.viewer.bodyIndex == BodyPrefabs.NullifierBody.bodyIndex) { CharacterMaster master = self.viewer.master; if ((Object)(object)master == (Object)null) { return result; } BaseAI component = ((Component)master).gameObject.GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.customTarget.mainHurtBox == (Object)null) { return result; } HurtBox mainHurtBox = component.customTarget.mainHurtBox; return new <>z__ReadOnlySingleElementList(mainHurtBox); } return result; } private void CreateBuffDef() { //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) Texture2D texture = EnemyAbilities.Instance.assetBundle.LoadAsset("texYouAreBeingWatchedIcon"); watchedDebuff = ScriptableObject.CreateInstance(); watchedDebuff.isDebuff = true; watchedDebuff.canStack = false; watchedDebuff.isHidden = false; watchedDebuff.iconSprite = Utils.CreateSprite(texture); watchedDebuff.buffColor = new Color(1f, 0f, 1f, 1f); ((Object)watchedDebuff).name = "YOU_ARE_BEING_WATCHED"; ContentAddition.AddBuffDef(watchedDebuff); } private void KillLinkedAnglerEyes(DamageReport report) { if (report != null && (Object)(object)report.victimBody != (Object)null) { NullifierSummonController component = ((Component)report.victimBody).GetComponent(); if ((Object)(object)component != (Object)null) { component.KillAllSumons(); } } } public void CreateNullifierSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "NullifierBodySummonAnglerEye", skillName = "NullifierSummonAnglerEye", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = summonCooldown.Value, combatSkill = true }; SkillDef val = CreateSkillDef(data); CreateGenericSkill(nullifierBodyPrefab, val, "NullifierSpecialFamily", (SkillSlot)3); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = nullifierMasterPrefab, customName = "useSpecial", skillSlot = (SkillSlot)3, requireReady = true, requiredSkillDef = val, minDistance = 0f, maxDistance = float.PositiveInfinity, selectionRequiresTargetLoS = false, aimType = (AimType)2, movementType = (MovementType)1, targetType = (TargetType)0, desiredIndex = 0 }; CreateAISkillDriver(data2); if (anglersProvideVision.Value) { AISkillDriverData data3 = new AISkillDriverData { masterPrefab = nullifierMasterPrefab, customName = "usePrimaryOnSpiedTarget", skillSlot = (SkillSlot)0, minDistance = 0f, maxDistance = float.PositiveInfinity, activationRequiresTargetLoS = false, activationRequiresAimTargetLoS = false, activationRequiresAimConfirmation = false, driverUpdateTimerOverride = 1f, aimType = (AimType)1, movementType = (MovementType)2, targetType = (TargetType)3, buttonPressType = (ButtonPressType)0, desiredIndex = 0 }; CreateAISkillDriver(data3); } } public void CreateAnglerEyeSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "AnglerEyeBodyShoot", skillName = "AnglerEyeShoot", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = anglerBeamCooldown.Value, combatSkill = true }; SkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(anglerEyeBodyPrefab, skillDef, "AnglerEyePrimaryFamily", (SkillSlot)0); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = anglerEyeMasterPrefab, customName = "fleeTarget", skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 30f, selectionRequiresTargetLoS = false, aimType = (AimType)2, movementType = (MovementType)3, targetType = (TargetType)0, desiredIndex = 0 }; AISkillDriverData data3 = new AISkillDriverData { masterPrefab = anglerEyeMasterPrefab, customName = "usePrimary", skillSlot = (SkillSlot)0, requireReady = true, minDistance = 0f, maxDistance = anglerMaxRange.Value, selectionRequiresTargetLoS = true, selectionRequiresAimTarget = true, aimType = (AimType)2, movementType = (MovementType)0, targetType = (TargetType)0, desiredIndex = 1, driverUpdateTimerOverride = 3.5f }; AISkillDriverData data4 = new AISkillDriverData { masterPrefab = anglerEyeMasterPrefab, customName = "strafeAndWaitForPrimary", skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = anglerMaxRange.Value, selectionRequiresTargetLoS = true, selectionRequiresAimTarget = true, aimType = (AimType)2, movementType = (MovementType)2, targetType = (TargetType)0, moveInputScale = 0.5f, desiredIndex = 2 }; AISkillDriverData data5 = new AISkillDriverData { masterPrefab = anglerEyeMasterPrefab, customName = "chaseTarget", skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = float.PositiveInfinity, selectionRequiresTargetLoS = false, selectionRequiresAimTarget = false, aimType = (AimType)2, movementType = (MovementType)1, targetType = (TargetType)0, desiredIndex = 3 }; CreateAISkillDriver(data2); CreateAISkillDriver(data3); CreateAISkillDriver(data4); CreateAISkillDriver(data5); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); } } } namespace EnemyAbilities.Abilities.MinorConstruct { [EnemyAbilities.ModuleInfo("Alpha Tripwire", "Gives Alpha Constructs a new passive ability:\n-Alpha Tripwire: Causes Alpha Constructs to passively create tripwires between themselves and other nearby Alpha Constructs. Walking into the tripwires deals a burst of damage and inflicts a brief root. Watch your step!", "Alpha Construct", true)] public class AreaDenialModule : BaseModule { public class AreaDenialConnection { public enum ConnectionState { Warning, Active, PostTrigger } public AreaDenialComponent transmitterComponent; public AreaDenialComponent receiverComponent; public float lifetime; public bool damageActive; public GameObject laserInstance; public LineRenderer laserLineComponent; public ConnectionState state; public static float connectionRadius = tripwireRadius.Value; public static float damageCoefficient = tripwireDamageCoefficient.Value / 100f; public static float postTriggerDuration = tripwireRechargeTime.Value; public float postTriggerTimer; } public class AreaDenialComponent : MonoBehaviour { public CharacterBody body; private static int maxConnections = (int)maxTripwires.Value; private TetherVfxOrigin tetherVfxOrigin; public static int indexCounter = 0; private int index; private float checkConnectionTimer; public static float checkConnectionInterval = 0.1f; private static float maxDistance = tripwireMaxLength.Value; private static float minDistance = 3f; private static float laserActivateDelay = tripwireActivationDelay.Value; private float flashInterval = 0.1f; private List outgoingConnections = new List(); private List incomingConnections = new List(); private static GameObject explosionEffect = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.OmniExplosionVFXMajorConstruct_prefab).WaitForCompletion(); public int Connections => outgoingConnections.Count + incomingConnections.Count; public void Start() { checkConnectionTimer = checkConnectionInterval; index = indexCounter; indexCounter++; body = ((Component)this).GetComponent(); if (!((Object)(object)body == (Object)null)) { HealthComponent healthComponent = body.healthComponent; if (!((Object)(object)healthComponent == (Object)null)) { tetherVfxOrigin = ((Component)healthComponent).gameObject.AddComponent(); tetherVfxOrigin.tetherPrefab = tetherPrefab; tetherVfxOrigin.transform = body.aimOriginTransform; } } } public void OnEnable() { InstanceTracker.Add(this); } public void OnDisable() { if (outgoingConnections.Count > 0) { for (int num = outgoingConnections.Count - 1; num >= 0; num--) { AreaDenialConnection connection = outgoingConnections[num]; BreakConnection(connection); } } InstanceTracker.Remove(this); } public void FixedUpdate() { //IL_00fc: 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_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) checkConnectionTimer -= Time.fixedDeltaTime; for (int num = outgoingConnections.Count - 1; num >= 0; num--) { AreaDenialConnection areaDenialConnection = outgoingConnections[num]; areaDenialConnection.lifetime += Time.fixedDeltaTime; if (areaDenialConnection.state == AreaDenialConnection.ConnectionState.Warning) { if (areaDenialConnection.lifetime >= laserActivateDelay) { Util.PlaySound("Play_voidman_m1_shoot", ((Component)body).gameObject); areaDenialConnection.state = AreaDenialConnection.ConnectionState.Active; if ((Object)(object)areaDenialConnection.laserInstance != (Object)null) { areaDenialConnection.laserInstance.SetActive(false); } } else if ((Object)(object)areaDenialConnection.laserLineComponent != (Object)null && (Object)(object)areaDenialConnection.receiverComponent != (Object)null && (Object)(object)areaDenialConnection.receiverComponent.body != (Object)null) { areaDenialConnection.laserLineComponent.SetPosition(0, body.aimOriginTransform.position); areaDenialConnection.laserLineComponent.SetPosition(1, areaDenialConnection.receiverComponent.body.aimOriginTransform.position); if (areaDenialConnection.lifetime > laserActivateDelay / 2f) { float num2 = ((areaDenialConnection.lifetime % flashInterval > flashInterval / 2f) ? 0.1f : 0.4f); areaDenialConnection.laserLineComponent.startWidth = num2; areaDenialConnection.laserLineComponent.endWidth = num2; } } } if (areaDenialConnection.state == AreaDenialConnection.ConnectionState.Active) { CheckConnectionForCollision(areaDenialConnection); } if (areaDenialConnection.state == AreaDenialConnection.ConnectionState.PostTrigger) { areaDenialConnection.postTriggerTimer += Time.fixedDeltaTime; if (areaDenialConnection.postTriggerTimer >= AreaDenialConnection.postTriggerDuration) { areaDenialConnection.state = AreaDenialConnection.ConnectionState.Warning; areaDenialConnection.lifetime = 0f; areaDenialConnection.postTriggerTimer = 0f; if ((Object)(object)areaDenialConnection.laserLineComponent != (Object)null) { areaDenialConnection.laserInstance.SetActive(true); areaDenialConnection.laserLineComponent.startWidth = 0.4f; areaDenialConnection.laserLineComponent.endWidth = 0.4f; } } } } if (!(checkConnectionTimer < 0f)) { return; } List list = new List(); checkConnectionTimer += checkConnectionInterval; if (Connections > 0) { for (int num3 = outgoingConnections.Count - 1; num3 >= 0; num3--) { AreaDenialConnection areaDenialConnection2 = outgoingConnections[num3]; AreaDenialComponent receiverComponent = areaDenialConnection2.receiverComponent; if (IsConnectionValid(receiverComponent, newConnection: false)) { if (areaDenialConnection2.state == AreaDenialConnection.ConnectionState.Active) { list.Add(receiverComponent.body.aimOriginTransform); } } else { BreakConnection(areaDenialConnection2); } } tetherVfxOrigin.SetTetheredTransforms(list); } List instancesList = InstanceTracker.GetInstancesList(); foreach (AreaDenialComponent item in instancesList) { if (!IsConnectionValid(item, newConnection: true)) { continue; } AreaDenialConnection areaDenialConnection3 = new AreaDenialConnection(); areaDenialConnection3.lifetime = 0f; areaDenialConnection3.state = AreaDenialConnection.ConnectionState.Warning; areaDenialConnection3.transmitterComponent = this; areaDenialConnection3.receiverComponent = item; outgoingConnections.Add(areaDenialConnection3); item.incomingConnections.Add(areaDenialConnection3); if ((Object)(object)areaDenialConnection3.laserInstance == (Object)null) { areaDenialConnection3.laserInstance = Object.Instantiate(laserPrefab, body.aimOriginTransform.position, Quaternion.identity); } if ((Object)(object)areaDenialConnection3.laserInstance != (Object)null) { if (!areaDenialConnection3.laserInstance.activeInHierarchy) { areaDenialConnection3.laserInstance.SetActive(true); } if (!Object.op_Implicit((Object)(object)areaDenialConnection3.laserInstance.transform.parent) != Object.op_Implicit((Object)(object)body.aimOriginTransform)) { areaDenialConnection3.laserInstance.transform.parent = body.aimOriginTransform; } areaDenialConnection3.laserLineComponent = areaDenialConnection3.laserInstance.GetComponent(); } } } private void CheckConnectionForCollision(AreaDenialConnection connection) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)body == (Object)null || connection == null || (Object)(object)connection.receiverComponent == (Object)null || (Object)(object)connection.receiverComponent.body == (Object)null) { return; } Vector3 position = body.aimOriginTransform.position; Vector3 position2 = connection.receiverComponent.body.aimOriginTransform.position; TeamMask enemyTeams = TeamMask.GetEnemyTeams(body.teamComponent.teamIndex); Team[] teamsList = TeamComponent.teamsList; foreach (Team val in teamsList) { TeamIndex teamIndex = val.teamIndex; if (!((TeamMask)(ref enemyTeams)).HasTeam(teamIndex)) { continue; } foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(teamIndex)) { CharacterBody val2 = teamMember.body; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2.healthComponent == (Object)null) && val2.healthComponent.alive) { float num = DistanceToLineSegment(val2.corePosition, position, position2); if (num < AreaDenialConnection.connectionRadius) { TriggerConnectionDamage(connection, val2); return; } } } } } private float DistanceToLineSegment(Vector3 targetPosition, Vector3 connectionStart, Vector3 connectionEnd) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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) Vector3 val = connectionEnd - connectionStart; float magnitude = ((Vector3)(ref val)).magnitude; float num = Mathf.Clamp01(Vector3.Dot(targetPosition - connectionStart, val) / (magnitude * magnitude)); Vector3 val2 = connectionStart + num * val; return Vector3.Distance(targetPosition, val2); } private void TriggerConnectionDamage(AreaDenialConnection connection, CharacterBody target) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0061: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_009c: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)body == (Object)null) { return; } DamageInfo val = new DamageInfo { damage = body.damage * AreaDenialConnection.damageCoefficient, attacker = ((Component)body).gameObject, inflictor = ((Component)body).gameObject, position = target.corePosition, crit = body.RollCrit(), force = Vector3.zero, damageType = DamageTypeCombo.op_Implicit((DamageType)0), procCoefficient = 1f, damageColorIndex = (DamageColorIndex)0 }; EffectManager.SpawnEffect(explosionEffect, new EffectData { origin = target.corePosition, rotation = target.transform.rotation, scale = 1f }, true); target.healthComponent.TakeDamage(val); float value = tripwireRootDuration.Value; float value2 = tripwireSlowDuration.Value; if (value2 > 0f) { target.AddTimedBuff(Buffs.Slow60, value2); } if (value > 0f) { target.AddTimedBuff(Buffs.LunarSecondaryRoot, value); if ((Object)(object)target.rigidbody != (Object)null) { target.rigidbody.velocity = Vector3.zero; } } if ((Object)(object)target.characterMotor != (Object)null) { target.characterMotor.velocity = Vector3.zero; } connection.state = AreaDenialConnection.ConnectionState.PostTrigger; connection.postTriggerTimer = 0f; if ((Object)(object)connection.laserInstance != (Object)null) { connection.laserInstance.SetActive(false); } } private void BreakConnection(AreaDenialConnection connection) { if (connection != null) { outgoingConnections.Remove(connection); connection.receiverComponent.incomingConnections.Remove(connection); } if ((Object)(object)connection.laserInstance != (Object)null) { Object.Destroy((Object)(object)connection.laserInstance); } } private bool IsConnectionValid(AreaDenialComponent receiverComponent, bool newConnection) { //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: 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_01df: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)this == (Object)(object)receiverComponent) { return false; } if ((Object)(object)this == (Object)null || (Object)(object)receiverComponent == (Object)null) { return false; } if (index >= receiverComponent.index) { return false; } if (newConnection) { if (Connections >= maxConnections || receiverComponent.Connections >= maxConnections) { return false; } foreach (AreaDenialConnection outgoingConnection in outgoingConnections) { if ((Object)(object)outgoingConnection.receiverComponent == (Object)(object)receiverComponent) { return false; } } } CharacterBody val = receiverComponent.body; if ((Object)(object)body == (Object)null || (Object)(object)val == (Object)null) { return false; } if ((Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive || (Object)(object)val.healthComponent == (Object)null || !val.healthComponent.alive) { return false; } Vector3 position = body.aimOriginTransform.position; Vector3 position2 = val.aimOriginTransform.position; float num = Vector3.Distance(position, position2); if (num > maxDistance || num < minDistance) { return false; } if ((Object)(object)val.currentVehicle != (Object)null || (Object)(object)body.currentVehicle != (Object)null) { return false; } Vector3 val2 = position2 - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (Physics.Raycast(position, normalized, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return false; } return true; } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.MinorConstructBody_prefab).WaitForCompletion(); private static Material laserMaterial = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.matMajorConstructBeam_mat).WaitForCompletion(); public static GameObject tetherPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_moon2.BloodSiphonTetherVFX_prefab).WaitForCompletion(), "areaDenialTetherVFX"); private static GameObject laserPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Golem.LaserGolem_prefab).WaitForCompletion(), "areaDenialWarningLaser"); private static CharacterSpawnCard cscMinorConstruct = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.cscMinorConstruct_asset).WaitForCompletion(); private static ConfigEntry tripwireMaxLength; private static ConfigEntry maxTripwires; private static ConfigEntry tripwireActivationDelay; private static ConfigEntry tripwireRechargeTime; private static ConfigEntry tripwireRadius; private static ConfigEntry tripwireDamageCoefficient; private static ConfigEntry tripwireRootDuration; private static ConfigEntry tripwireSlowDuration; public override void RegisterConfig() { base.RegisterConfig(); tripwireMaxLength = BindFloat("Max Tripwire Length", 50f, "The maximum distance two alpha constructs can be apart and still form a tripwire.", 25f, 100f, 1f, PluginConfig.FormatType.Distance); maxTripwires = BindFloat("Max Tripwires", 2f, "The maximum number of tripwires that can be connected to one Alpha Construct.", 1f, 4f, 1f); tripwireActivationDelay = BindFloat("Tripwire Activation Delay", 2f, "The warning duration before tripwires become live.", 0.5f, 4f, 0.1f, PluginConfig.FormatType.Time); tripwireRechargeTime = BindFloat("Tripwire Recharge Time", 4f, "The duration of time after a tripwire is triggered that the tripwire will reappear.", 1f, 10f, 0.1f, PluginConfig.FormatType.Time); tripwireRadius = BindFloat("Tripwire Radius", 2f, "How close a target has to be to the nearest point on the tripwire in order to trigger it.", 1f, 3f, 0.1f, PluginConfig.FormatType.Distance); tripwireDamageCoefficient = BindFloat("Tripwire Damage Coefficient", 250f, "The damage coefficient of the tripwire.", 100f, 500f, 5f, PluginConfig.FormatType.Percentage); tripwireRootDuration = BindFloat("Tripwire Root Duration", 1f, "The duration of the root upon triggering a tripwire.", 0f, 5f, 0.1f, PluginConfig.FormatType.Time); tripwireSlowDuration = BindFloat("Tripwire Slow Duration", 2f, "The duration of the slow upon triggering a tripwire.", 0f, 5f, 0.1f, PluginConfig.FormatType.Time); BindStats(bodyPrefab, new List(1) { cscMinorConstruct }); } public override void Initialise() { base.Initialise(); SetupTetherPrefab(); ModifyLaserPrefab(); bodyPrefab.AddComponent(); Stage.onStageStartGlobal += ResetIndexCounter; } private void ResetIndexCounter(Stage obj) { if ((Object)(object)obj != (Object)null) { AreaDenialComponent.indexCounter = 0; } } public void SetupTetherPrefab() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) LineRenderer component = tetherPrefab.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("TractorBeamModule.SetupTetherPrefab failed - tetherPrefab has no LineRenderer!"); return; } Material val = new Material(laserMaterial); val.mainTextureScale = Vector2.one; ((Renderer)component).material = val; } public void ModifyLaserPrefab() { LineRenderer component = laserPrefab.GetComponent(); component.startWidth = 0.4f; component.endWidth = 0.4f; } } } namespace EnemyAbilities.Abilities.XiConstruct { [EnemyAbilities.ModuleInfo("Core Launch", "Gives Xi Constructs a new Secondary:\n-Core Launch: The Xi Construct spins up to launch it's core at a player, then retracts it after a short delay. Damaging the core returns the damage to the Xi Construct.", "Xi Construct", true)] public class DetachEyeModule : BaseModule { public class DetachEyeDamageEffectOrb : GenericDamageOrb { public override void Begin() { base.speed = 240f; base.damageValue = 0f; base.procCoefficient = 0f; ((GenericDamageOrb)this).Begin(); } public override GameObject GetOrbEffect() { return OrbStorageUtility.Get("Prefabs/Effects/OrbEffects/ClayGooOrbEffect"); } public override void OnArrival() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown EffectManager.SpawnEffect(transferDamageImpactEffect, new EffectData { scale = 4f, origin = ((Component)((Orb)this).target).transform.position }, true); } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.MegaConstructBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.MegaConstructMaster_prefab).WaitForCompletion(); private static GameObject projectileGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBarrelGhost_prefab).WaitForCompletion(), "MegaConstructEyeProjectileGhost"); private static Material eyeMaterial = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.matMegaConstructEye_mat).WaitForCompletion(); private static GameObject impactEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Parent.ParentSlamEffect_prefab).WaitForCompletion(); public static GameObject vagrantProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Vagrant.VagrantTrackingBomb_prefab).WaitForCompletion(), "ClonedVagrantProjectile"); private static Material trailMaterial = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.matConstructBeamInitial_mat).WaitForCompletion(); public static GameObject transferDamageImpactEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.OmniImpactVFXLarge_prefab).WaitForCompletion(), "scalableImpactEffect"); private static GameObject megaConstructModel = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.mdlMegaConstruct_fbx).WaitForCompletion(); public static GameObject pulseEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.MajorConstructMuzzleflashSpawnMinorConstruct_prefab).WaitForCompletion(), "megaConstructBeaconEffect"); private static CharacterSpawnCard cscMegaConstruct = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.cscMegaConstruct_asset).WaitForCompletion(); internal static ConfigEntry damageCoeff; internal static ConfigEntry explosionRadius; internal static ConfigEntry waitDuration; internal static ConfigEntry windupDuration; internal static ConfigEntry cooldown; internal static ConfigEntry disableMainBodyHurtbox; public override void RegisterConfig() { base.RegisterConfig(); damageCoeff = BindFloat("Core Damage Coefficient", 250f, "The damage coefficient of the core attack", 100f, 500f, 5f, PluginConfig.FormatType.Percentage); explosionRadius = BindFloat("Core Explosion Radius", 10f, "The damage radius of the core attack", 6f, 20f, 0.1f, PluginConfig.FormatType.Distance); waitDuration = BindFloat("Core Wait Duration", 3.5f, "The amount of time that the Xi Construct will wait between firing and recalling it's Core.", 1f, 6f, 0.01f, PluginConfig.FormatType.Time); windupDuration = BindFloat("Core Windup Duration", 0.75f, "The amount of time the Xi Construct will spin up for before firing it's core.", 0.5f, 2f, 0.01f, PluginConfig.FormatType.Time); cooldown = BindFloat("Core Cooldown", 15f, "The cooldown of the core launch", 10f, 30f, 0.1f, PluginConfig.FormatType.Time); disableMainBodyHurtbox = BindBool("Core Disable Main Body Hurtbox", defaultValue: false, "If enabled, disables the Xi Construct's hurtbox whilst it's Core is ejected."); BindStats(bodyPrefab, new List(1) { cscMegaConstruct }); } public override void Initialise() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown base.Initialise(); ModifyProjectilePrefab(); CreateSkill(); bodyPrefab.AddComponent(); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(CreateDamageEffectOrb); transferDamageImpactEffect.GetComponent().applyScale = true; ContentAddition.AddEffect(transferDamageImpactEffect); EffectComponent component = pulseEffect.GetComponent(); component.applyScale = true; component.positionAtReferencedTransform = false; component.parentToReferencedTransform = false; ContentAddition.AddEffect(pulseEffect); } private void CreateDamageEffectOrb(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)self != (Object)null && damageInfo != null && damageInfo.damage > 0f && (Object)(object)self.body != (Object)null && self.body.bodyIndex == BodyPrefabs.MegaConstructBody.bodyIndex && (Object)(object)damageInfo.inflictedHurtbox != (Object)null && ((Behaviour)damageInfo.inflictedHurtbox).enabled) { MegaConstructUtilityController component = ((Component)self.body).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.eyeProjectile != (Object)null) { DetachEyeDamageEffectOrb detachEyeDamageEffectOrb = new DetachEyeDamageEffectOrb(); ((Orb)detachEyeDamageEffectOrb).origin = component.eyeProjectile.transform.position; ((Orb)detachEyeDamageEffectOrb).target = self.body.mainHurtBox; OrbManager.instance.AddOrb((Orb)(object)detachEyeDamageEffectOrb); } } orig.Invoke(self, damageInfo); } public void ModifyProjectilePrefab() { //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) ProjectileDirectionalTargetFinder component = vagrantProjectile.GetComponent(); Object.Destroy((Object)(object)component); ProjectileSteerTowardTarget component2 = vagrantProjectile.GetComponent(); Object.Destroy((Object)(object)component2); ProjectileTargetComponent component3 = vagrantProjectile.GetComponent(); Object.Destroy((Object)(object)component3); Transform[] componentsInChildren = vagrantProjectile.GetComponentsInChildren(); List list = new List(3) { "ProximityDetonator", "AuthorityEffect", "PredictionEffect" }; if (componentsInChildren != null && componentsInChildren.Length != 0) { for (int num = componentsInChildren.Length - 1; num >= 0; num--) { if ((Object)(object)componentsInChildren[num] != (Object)null && list.Contains(((Object)((Component)componentsInChildren[num]).gameObject).name)) { Object.Destroy((Object)(object)((Component)componentsInChildren[num]).gameObject); } } } Transform[] componentsInChildren2 = megaConstructModel.GetComponentsInChildren(); GameObject gameObject = ((Component)componentsInChildren2.Where((Transform transform) => ((Object)((Component)transform).gameObject).name == "MegaConstructEyeMesh").FirstOrDefault()).gameObject; GameObject val = PrefabAPI.InstantiateClone(gameObject, "eyeObjectClone"); MeshRenderer component4 = val.GetComponent(); ((Renderer)component4).lightProbeUsage = (LightProbeUsage)1; ((Renderer)component4).material = eyeMaterial; PrintController val2 = val.AddComponent(); val2.printTime = 0f; val2.disableWhenFinished = true; val2.maxPrintHeight = -10f; val2.startingPrintHeight = 4f; val2.printCurve = bodyPrefab.GetComponentInChildren().printCurve; val2.materialPrintCutoffPostSkinApplying = true; Transform component5 = vagrantProjectile.GetComponent(); component5.localScale = Vector3.one; ProjectileController component6 = vagrantProjectile.GetComponent(); ParticleSystem[] componentsInChildren3 = projectileGhost.GetComponentsInChildren(); Rigidbody component7 = vagrantProjectile.GetComponent(); SphereCollider component8 = ((Component)component7).GetComponent(); Transform[] componentsInChildren4 = projectileGhost.GetComponentsInChildren(); GameObject gameObject2 = ((Component)componentsInChildren4.Where((Transform transform) => ((Object)((Component)transform).gameObject).name == "mdlTarball").FirstOrDefault()).gameObject; if ((Object)(object)gameObject2 != (Object)null) { Object.DestroyImmediate((Object)(object)gameObject2); } Transform component9 = projectileGhost.GetComponent(); if ((Object)(object)component9 != (Object)null) { Transform component10 = val.GetComponent(); component10.parent = component9; component10.localPosition = Vector3.zero; } else { Log.Error("ghostBaseTransform is null!"); } component8.radius = 0.2f; component7.mass = 1f; component6.ghostPrefab = projectileGhost; component6.flightSoundLoop = null; component6.cannotBeDeleted = true; for (int num2 = componentsInChildren3.Length - 1; num2 >= 0; num2--) { Object.Destroy((Object)(object)componentsInChildren3[num2]); } Transform component11 = projectileGhost.GetComponent(); ProjectileSimple component12 = vagrantProjectile.GetComponent(); component12.lifetime = 20f; ProjectileImpactExplosion component13 = vagrantProjectile.GetComponent(); Object.Destroy((Object)(object)component13); EnemiesPlusUtils.ProjectileDetonateOnImpact projectileDetonateOnImpact = vagrantProjectile.AddComponent(); ((Component)projectileDetonateOnImpact).gameObject.layer = LayerIndex.projectileWorldOnly.intVal; if ((Object)(object)projectileDetonateOnImpact != (Object)null) { projectileDetonateOnImpact.impactEffect = impactEffect; ((ProjectileExplosion)projectileDetonateOnImpact).blastRadius = explosionRadius.Value; ((ProjectileExplosion)projectileDetonateOnImpact).blastDamageCoefficient = 1f; ((ProjectileExplosion)projectileDetonateOnImpact).falloffModel = (FalloffModel)2; ((ProjectileExplosion)projectileDetonateOnImpact).bonusBlastForce = new Vector3(0f, 2000f, 0f); projectileDetonateOnImpact.destroyOnEnemy = false; projectileDetonateOnImpact.destroyOnWorld = false; projectileDetonateOnImpact.impactOnWorld = true; projectileDetonateOnImpact.lifetimeAfterImpact = 60f; projectileDetonateOnImpact.timerAfterImpact = true; projectileDetonateOnImpact.detonateOnEnemy = false; projectileDetonateOnImpact.detonateOnWorld = true; projectileDetonateOnImpact.lifetime = 60f; ((ProjectileExplosion)projectileDetonateOnImpact).explosionEffect = impactEffect; ((ProjectileExplosion)projectileDetonateOnImpact).blastProcCoefficient = 1f; projectileDetonateOnImpact.transformSpace = EnemiesPlusUtils.ProjectileDetonateOnImpact.TransformSpace.World; projectileDetonateOnImpact.explodeOnLifeTimeExpiration = false; } ProjectileStickOnImpact val3 = vagrantProjectile.AddComponent(); val3.ignoreCharacters = true; val3.ignoreWorld = false; val3.ignoreSteepSlopes = false; val3.alignNormals = true; CharacterBody component14 = bodyPrefab.GetComponent(); LanguageAPI.Add("SKELETOGNE_MEGACONSTRUCTCORE_BODY_NAME", "Xi Core"); CharacterBody component15 = vagrantProjectile.GetComponent(); component15.baseMaxHealth = component14.baseMaxHealth; component15.levelMaxHealth = component14.levelMaxHealth; component15.baseArmor = component14.baseArmor; component15.isChampion = component14.isChampion; component15.baseNameToken = "SKELETOGNE_MEGACONSTRUCTCORE_BODY_NAME"; ProjectileMegaConstructEye projectileMegaConstructEye = vagrantProjectile.AddComponent(); HurtBox componentInChildren = vagrantProjectile.GetComponentInChildren(); componentInChildren.healthComponent = null; TrailRenderer val4 = projectileGhost.AddComponent(); ((Renderer)val4).bounds = default(Bounds); ((Renderer)val4).localBounds = default(Bounds); ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)val4).lightProbeUsage = (LightProbeUsage)0; ((Renderer)val4).reflectionProbeUsage = (ReflectionProbeUsage)0; val4.time = 0.2f; val4.minVertexDistance = 0.1f; val4.startWidth = 1f; val4.endWidth = 0.2f; ((Renderer)val4).material = trailMaterial; ((Renderer)val4).sharedMaterial = trailMaterial; val4.emitting = true; val4.textureMode = (LineTextureMode)0; val4.shadowBias = 0.5f; ((Renderer)val4).lightProbeUsage = (LightProbeUsage)0; ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val4).motionVectorGenerationMode = (MotionVectorGenerationMode)0; ((Renderer)val4).allowOcclusionWhenDynamic = true; Light val5 = projectileGhost.AddComponent(); val5.type = (LightType)2; val5.spotAngle = 30f; val5.innerSpotAngle = 21.80208f; val5.color = new Color(1f, 0.509f, 0f, 1f); val5.colorTemperature = 6570f; val5.intensity = 242.27f; val5.bounceIntensity = 1f; val5.shadowBias = 0.05f; val5.shadowNormalBias = 0.4f; val5.shadowNearPlane = 0.2f; val5.range = 7.62f; val5.shadowStrength = 1f; val5.shadowResolution = (LightShadowResolution)(-1); ContentAddition.AddBody(vagrantProjectile); } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "MegaConstructBodyDetachEye", skillName = "MegaConstructDetachEye", esmName = "Body", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; DetachEyeSkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, (SkillDef)(object)skillDef, "MegaConstructSecondaryFamily", (SkillSlot)1); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSecondary", skillSlot = (SkillSlot)1, requireReady = true, minDistance = 0f, maxDistance = 150f, targetType = (TargetType)3, aimType = (AimType)1, movementType = (MovementType)0, desiredIndex = 7 }; AISkillDriver nextHighPriorityOverride = CreateAISkillDriver(data2); AISkillDriver[] components = masterPrefab.GetComponents(); foreach (AISkillDriver val in components) { val.aimType = (AimType)1; val.moveTargetType = (TargetType)3; if (val.customName == "StopStep") { val.nextHighPriorityOverride = nextHighPriorityOverride; } if (val.customName == "ShootStep") { val.selectionRequiresTargetLoS = false; val.activationRequiresTargetLoS = true; } } } } public class DetachEyeSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { public CharacterBody body; public EntityStateMachine weaponESM; public MegaConstructUtilityController utilController; } public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot) { CharacterBody characterBody = skillSlot.characterBody; EntityStateMachine weaponESM = ((IEnumerable)((Component)characterBody).GetComponents()).FirstOrDefault((Func)((EntityStateMachine esm) => esm.customName == "Weapon")); MegaConstructUtilityController component = ((Component)characterBody).gameObject.GetComponent(); return (BaseSkillInstanceData)(object)new InstanceData { body = characterBody, weaponESM = weaponESM, utilController = component }; } public override bool IsReady([NotNull] GenericSkill skillSlot) { InstanceData instanceData = skillSlot.skillInstanceData as InstanceData; if ((Object)(object)instanceData?.weaponESM == (Object)null || (Object)(object)instanceData.body == (Object)null) { return false; } if (instanceData.weaponESM.state is FireLaser || instanceData.weaponESM.state is ChargeLaser || instanceData.weaponESM.state is TerminateLaser) { return false; } if (!instanceData.utilController.validToUseSkill) { return false; } return ((SkillDef)this).IsReady(skillSlot); } } public class DetachEye : BaseSkillState { private enum AbilityState { None, Windup, Wait, Recall } private float duration; private static float baseDuration = 1f; private static float speedOverride = 100f; private static float force = 2000f; private GameObject projectilePrefab = DetachEyeModule.vagrantProjectile; private static float baseWindupDuration = DetachEyeModule.windupDuration.Value; private float windupDuration; private float windupTimer; private static float baseWaitDuration = DetachEyeModule.waitDuration.Value; private float waitDuration; private float waitTimer; private AbilityState abilityState; private Vector3 rotationAxis; private QuaternionPID angularPID; private VectorPID torquePID; private float spinSpeedPerFixedUpdate = 0.5f; private Transform modelEyeTransform; private MegaConstructUtilityController utilController; public override void OnEnter() { //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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (Random.RandomRangeInt(0, 2) == 1) { spinSpeedPerFixedUpdate = 0f - spinSpeedPerFixedUpdate; } duration = baseDuration / ((BaseState)this).attackSpeedStat; if ((Object)(object)((EntityState)this).modelLocator != (Object)null && (Object)(object)((EntityState)this).modelLocator.modelTransform != (Object)null) { rotationAxis = ((EntityState)this).inputBank.aimDirection; } abilityState = AbilityState.Windup; windupDuration = baseWindupDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("Gesture, Additive", "ChargeLaser", "Laser.playbackRate", windupDuration, 0f); waitDuration = baseWaitDuration; utilController = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent(); if ((Object)(object)component != (Object)null) { NameTransformPair[] transformPairs = component.transformPairs; foreach (NameTransformPair val in transformPairs) { if (val.name == "Eye") { modelEyeTransform = val.transform; } } } torquePID = (from pid in ((Component)((EntityState)this).characterBody).GetComponents() where pid.customName == "torquePID" select pid).FirstOrDefault(); angularPID = ((Component)((EntityState)this).characterBody).GetComponent(); if ((Object)(object)torquePID != (Object)null) { torquePID.ResetPID(); ((Behaviour)torquePID).enabled = false; } if ((Object)(object)angularPID != (Object)null) { angularPID.ResetPID(); ((Behaviour)angularPID).enabled = false; } } public override void OnExit() { ((EntityState)this).OnExit(); if ((Object)(object)utilController != (Object)null) { if ((Object)(object)utilController.eyeProjectile != (Object)null) { Object.Destroy((Object)(object)utilController.eyeProjectile); utilController.eyeProjectile = null; } utilController.recalled = false; } if ((Object)(object)((EntityState)this).healthComponent != (Object)null && ((EntityState)this).healthComponent.health > 0f) { ToggleEyeVisual(state: true); } if (DetachEyeModule.disableMainBodyHurtbox.Value) { ToggleHurtBoxes(state: true); } if ((Object)(object)torquePID != (Object)null) { ((Behaviour)torquePID).enabled = true; } if ((Object)(object)angularPID != (Object)null) { ((Behaviour)angularPID).enabled = true; } ((EntityState)this).PlayAnimation("Gesture, Additive", "TerminateLaser", "Laser.playbackRate", 1f, 0f); } public override void FixedUpdate() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if ((abilityState == AbilityState.Windup || abilityState == AbilityState.Wait) && (Object)(object)((EntityState)this).rigidbody != (Object)null) { ((EntityState)this).rigidbody.maxAngularVelocity = 15f; Rigidbody rigidbody = ((EntityState)this).rigidbody; rigidbody.angularVelocity += spinSpeedPerFixedUpdate * rotationAxis; } if (abilityState == AbilityState.Recall && (Object)(object)((EntityState)this).rigidbody != (Object)null) { ((EntityState)this).rigidbody.maxAngularVelocity = Mathf.Max(((EntityState)this).rigidbody.maxAngularVelocity - Mathf.Abs(spinSpeedPerFixedUpdate), 5f); Rigidbody rigidbody2 = ((EntityState)this).rigidbody; rigidbody2.angularVelocity -= spinSpeedPerFixedUpdate * rotationAxis; } if (abilityState == AbilityState.Windup) { windupTimer += Time.fixedDeltaTime; if (windupTimer > windupDuration) { Fire(); abilityState = AbilityState.Wait; ((EntityState)this).PlayAnimation("Gesture, Additive", "FireLaser", "Laser.playbackRate", 5f, 0f); } } if (abilityState == AbilityState.Wait && (Object)(object)utilController != (Object)null && (Object)(object)utilController.eyeProjectile != (Object)null) { waitTimer += Time.fixedDeltaTime; if (waitTimer > waitDuration) { StartRecall(); } if ((Object)(object)utilController.eyeProjectile.transform == (Object)null || (Object)(object)((EntityState)this).characterBody == (Object)null) { ((EntityState)this).outer.SetNextStateToMain(); return; } if (Vector3.Distance(utilController.eyeProjectile.transform.position, ((EntityState)this).characterBody.transform.position) > 150f) { StartRecall(); } } if (abilityState == AbilityState.Recall && utilController.recalled) { ((EntityState)this).outer.SetNextStateToMain(); } } public void StartRecall() { if ((Object)(object)utilController != (Object)null && (Object)(object)utilController.eyeProjectile != (Object)null) { EnemiesPlusUtils.ProjectileDetonateOnImpact component = utilController.eyeProjectile.GetComponent(); if ((Object)(object)component != (Object)null) { component.nullifyExplosions = true; } ProjectileStickOnImpact component2 = utilController.eyeProjectile.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = false; } ProjectileMegaConstructEye component3 = utilController.eyeProjectile.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.recalling = true; } abilityState = AbilityState.Recall; } } public void Fire() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Quaternion rotation = ((EntityState)this).modelLocator.modelTransform.rotation; DamageTypeCombo val = default(DamageTypeCombo); val.damageSource = (DamageSource)2; val.damageType = (DamageType)0; DamageTypeCombo value = val; ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, rotation, ((Component)((EntityState)this).characterBody).gameObject, DetachEyeModule.damageCoeff.Value / 100f * ((BaseState)this).damageStat, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, speedOverride, (DamageTypeCombo?)value); } ToggleEyeVisual(state: false); if (DetachEyeModule.disableMainBodyHurtbox.Value) { ToggleHurtBoxes(state: false); } } public void ToggleEyeVisual(bool state) { ((Component)modelEyeTransform).gameObject.SetActive(state); } public void ToggleHurtBoxes(bool state) { HurtBox[] hurtBoxes = ((EntityState)this).characterBody.hurtBoxGroup.hurtBoxes; foreach (HurtBox val in hurtBoxes) { ((Behaviour)val).enabled = state; } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } public class ProjectileMegaConstructEye : MonoBehaviour { private ProjectileController controller; private GameObject owner; private HealthComponent healthComponent; public HealthComponent ownerHealthComponent; public bool recalling; public CharacterBody ownerBody; private MegaConstructUtilityController utilController; private Rigidbody projectileRigidbody; private float retractTimer; private static GameObject explosionEffect = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.MegaConstructDeathExplosion_prefab).WaitForCompletion(); private float effectTimer; private float effectInterval = 0.75f; private ProjectileStickOnImpact stick; public void Awake() { controller = ((Component)this).GetComponent(); healthComponent = ((Component)this).GetComponent(); stick = ((Component)this).GetComponent(); } public void Start() { owner = controller.owner; if ((Object)(object)owner == (Object)null) { return; } ownerBody = owner.GetComponent(); if ((Object)(object)ownerBody == (Object)null) { return; } ownerHealthComponent = ownerBody.healthComponent; if ((Object)(object)ownerHealthComponent == (Object)null) { return; } CharacterBody body = healthComponent.body; if (!((Object)(object)body == (Object)null)) { body.RecalculateStats(); body.hurtBoxGroup.hurtBoxes[0].healthComponent = ownerHealthComponent; healthComponent.health = ownerHealthComponent.health; utilController = ((Component)ownerBody).gameObject.GetComponent(); if (!((Object)(object)utilController == (Object)null)) { utilController.OnProjectileSetup(((Component)this).gameObject); } } } public void FixedUpdate() { //IL_0075: 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_0081: 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_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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_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_01b8: 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_01d2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)stick != (Object)null && stick.stuck) { effectTimer -= Time.fixedDeltaTime; if (effectTimer < 0f) { effectTimer += effectInterval; Util.PlaySound("Play_majorConstruct_R_pulse", ((Component)this).gameObject); EffectManager.SpawnEffect(DetachEyeModule.pulseEffect, new EffectData { origin = ((Component)this).transform.position, rotation = Util.QuaternionSafeLookRotation(((Component)this).transform.forward) }, false); } } if ((Object)(object)healthComponent != (Object)null && healthComponent.health <= 0f) { EffectManager.SpawnEffect(explosionEffect, new EffectData { scale = 10f, origin = ((Component)this).transform.position }, true); Object.Destroy((Object)(object)((Component)this).gameObject); } if (recalling) { retractTimer += Time.fixedDeltaTime; if ((Object)(object)projectileRigidbody == (Object)null) { projectileRigidbody = ((Component)this).GetComponent(); projectileRigidbody.useGravity = false; ProjectileSimple component = ((Component)this).GetComponent(); component.desiredForwardSpeed = 0f; } Vector3 position = projectileRigidbody.position; Vector3 position2 = ownerBody.transform.position; float num = Vector3.Distance(position, position2); if (num >= 1f) { projectileRigidbody.MovePosition(Vector3.MoveTowards(position, position2, Mathf.Min(retractTimer * 0.5f, 2f))); } else if ((Object)(object)utilController != (Object)null) { utilController.recalled = true; } } } } public class MegaConstructUtilityController : MonoBehaviour { private CharacterBody body; public bool recalled; public GameObject eyeProjectile; private BaseAI baseAI; public bool validToUseSkill; private float targetCheckTimer; private static float targetCheckInterval = 0.25f; public void Awake() { body = ((Component)this).GetComponent(); } public void Start() { if ((Object)(object)body != (Object)null) { CharacterMaster master = body.master; if ((Object)(object)master != (Object)null) { baseAI = ((Component)master).gameObject.GetComponent(); } } } public void OnProjectileSetup(GameObject projectile) { eyeProjectile = projectile; } public void FixedUpdate() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_0133: Unknown result type (might be due to invalid IL or missing references) targetCheckTimer -= Time.fixedDeltaTime; if (!(targetCheckTimer < 0f)) { return; } targetCheckTimer += targetCheckInterval; if ((Object)(object)body == (Object)null || (Object)(object)body.inputBank == (Object)null || (Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive || (Object)(object)body.teamComponent == (Object)null) { return; } Ray aimRay = body.inputBank.GetAimRay(); BullseyeSearch val = new BullseyeSearch(); val.viewer = body; val.filterByDistinctEntity = true; val.filterByLoS = true; val.maxDistanceFilter = float.PositiveInfinity; val.minDistanceFilter = 0f; val.searchOrigin = ((Ray)(ref aimRay)).origin; val.searchDirection = ((Ray)(ref aimRay)).direction; val.maxAngleFilter = 360f; val.sortMode = (SortMode)1; val.queryTriggerInteraction = (QueryTriggerInteraction)0; TeamMask enemyTeams = TeamMask.GetEnemyTeams(body.teamComponent.teamIndex); val.teamMaskFilter = enemyTeams; val.RefreshCandidates(); IEnumerable source = from hurtBox in val.GetResults() where (Object)(object)hurtBox != (Object)null && (Object)(object)hurtBox.healthComponent != (Object)null && (Object)(object)hurtBox.healthComponent.body != (Object)null && hurtBox.healthComponent.body.isPlayerControlled select hurtBox; if (source.Any()) { if (baseAI.customTarget != null) { Target customTarget = baseAI.customTarget; HurtBox? obj = source.FirstOrDefault(); customTarget.gameObject = ((obj != null) ? ((Component)obj.healthComponent.body).gameObject : null); validToUseSkill = true; } } else { validToUseSkill = false; } } } } namespace EnemyAbilities.Abilities.LunarGolem { [EnemyAbilities.ModuleInfo("Laser Sweep", "Gives Lunar Golems a new Special ability:\n- Laser Sweep: Fires a sweeping laser towards its target that ignites terrain. Ignited terrain explodes after a few seconds.", "Lunar Golem", true)] public class LaserSweepModule : BaseModule { public class LaserSweep : BaseSkillState { private static float baseWindupDuration = LaserSweepModule.windupDuration.Value; private float windupDuration; private static float baseSweepDuration = LaserSweepModule.sweepDuration.Value; private float sweepDuration; private static float laserMaxDistance = 200f; private int cannonIndex; private static float overshootAngle = 35f; private GameObject impactEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.OmniImpactVFXLarge_prefab).WaitForCompletion(); private GameObject laserInstance; private LineRenderer laserLineComponent; private Vector3 targetPos; private Vector3 startDirection; private Vector3 targetDirection; private Vector3 laserEndPosition; private bool sweeping = false; private TrailDetonate trailDetonate; private bool shouldAddPoint; private BaseAI baseAI; private GameObject chargeEffect; public override void OnEnter() { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0216: 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_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); sweepDuration = baseSweepDuration / ((BaseState)this).attackSpeedStat; windupDuration = baseWindupDuration / ((BaseState)this).attackSpeedStat; Util.PlaySound("Play_roboBall_attack2_mini_laser_start", ((Component)((EntityState)this).characterBody).gameObject); if ((Object)(object)((EntityState)this).characterBody.master == (Object)null) { return; } baseAI = ((Component)((EntityState)this).characterBody.master).GetComponent(); if ((Object)(object)((BaseSkillState)this).activatorSkillSlot != (Object)null) { int maxStock = ((BaseSkillState)this).activatorSkillSlot.maxStock; if (maxStock >= 3) { cannonIndex = ((BaseSkillState)this).activatorSkillSlot.stock % 4; } else { switch (maxStock) { case 2: cannonIndex = ((BaseSkillState)this).activatorSkillSlot.stock % 2; break; case 1: cannonIndex = Random.RandomRangeInt(0, 4); break; } } } Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; float num = 25f; if (cannonIndex % 2 == 1) { num = 0f - num; } Vector3 val = Quaternion.AngleAxis(num, ((EntityState)this).characterBody.transform.up) * direction; laserEndPosition = ((Ray)(ref aimRay)).origin + val * laserMaxDistance; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aimRay)).origin, val, ref val2, laserMaxDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { laserEndPosition = ((RaycastHit)(ref val2)).point; } string text = FindMuzzleName(); if (text == "") { Log.Error("cannonIndex out of bounds!"); } Transform modelTransform = ((EntityState)this).GetModelTransform(); if (!((Object)(object)modelTransform != (Object)null)) { return; } ChildLocator component = ((Component)modelTransform).GetComponent(); if (!((Object)(object)component != (Object)null)) { return; } Transform val3 = component.FindChild(text); if ((Object)(object)val3 != (Object)null) { laserInstance = Object.Instantiate(laserPrefab, val3.position, val3.rotation); chargeEffect = Object.Instantiate(chargeEffectPrefab, val3.position, val3.rotation); } if ((Object)(object)laserInstance != (Object)null) { if (!laserInstance.activeInHierarchy) { laserInstance.SetActive(true); } if ((Object)(object)laserInstance.transform.parent != (Object)(object)val3) { laserInstance.transform.parent = val3; } laserLineComponent = laserInstance.GetComponent(); } if ((Object)(object)chargeEffect != (Object)null) { chargeEffect.transform.parent = val3; ScaleParticleSystemDuration component2 = chargeEffect.GetComponent(); component2.newDuration = windupDuration + sweepDuration; } } public override void OnExit() { ((EntityState)this).OnExit(); if ((Object)(object)laserInstance != (Object)null) { EntityState.Destroy((Object)(object)laserInstance); } if ((Object)(object)chargeEffect != (Object)null) { EntityState.Destroy((Object)(object)chargeEffect); } Util.PlaySound("Play_roboBall_attack2_mini_laser_stop", ((Component)((EntityState)this).characterBody).gameObject); } public override void Update() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (!((Object)(object)laserInstance == (Object)null) && !((Object)(object)laserLineComponent == (Object)null)) { Vector3 position = laserInstance.transform.parent.position; laserLineComponent.SetPosition(0, position); laserLineComponent.SetPosition(1, laserEndPosition); } } public override void FixedUpdate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); EffectManager.SpawnEffect(impactEffect, new EffectData { scale = 1f, origin = laserEndPosition }, true); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 normal = Vector3.zero; Vector3 val2; if (((EntityState)this).fixedAge > windupDuration && !sweeping) { sweeping = true; targetPos = ((Ray)(ref aimRay)).GetPoint(laserMaxDistance); RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction, ref val, laserMaxDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { targetPos = ((RaycastHit)(ref val)).point; } if ((Object)(object)baseAI != (Object)null && baseAI.currentEnemy != null && (Object)(object)baseAI.currentEnemy.characterBody != (Object)null) { targetPos = baseAI.currentEnemy.characterBody.footPosition; } val2 = laserEndPosition - ((Ray)(ref aimRay)).origin; startDirection = ((Vector3)(ref val2)).normalized; val2 = targetPos - ((Ray)(ref aimRay)).origin; targetDirection = ((Vector3)(ref val2)).normalized; GameObject val3 = new GameObject(); trailDetonate = val3.AddComponent(); trailDetonate.owner = ((Component)((EntityState)this).characterBody).gameObject; trailDetonate.teamIndex = ((EntityState)this).characterBody.teamComponent.teamIndex; trailDetonate.ownerDamage = ((EntityState)this).characterBody.damage; } if (sweeping) { shouldAddPoint = true; val2 = targetPos - ((Ray)(ref aimRay)).origin; targetDirection = ((Vector3)(ref val2)).normalized; Vector3 val4 = RotateAndOvershoot(((EntityState)this).fixedAge - windupDuration); Vector3 val5 = ((Ray)(ref aimRay)).origin + val4 * laserMaxDistance; RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aimRay)).origin, val4, ref val6, laserMaxDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { val5 = ((RaycastHit)(ref val6)).point; normal = ((RaycastHit)(ref val6)).normal; } else { shouldAddPoint = false; } laserEndPosition = val5; } if (sweeping && (Object)(object)trailDetonate != (Object)null && shouldAddPoint) { trailDetonate.UpdateTrailWithNewPoint(laserEndPosition, normal); } if (((EntityState)this).fixedAge > sweepDuration + windupDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public string FindMuzzleName() { return cannonIndex switch { 0 => "MuzzleRT", 1 => "MuzzleLT", 2 => "MuzzleRB", 3 => "MuzzleLB", _ => "", }; } 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 Vector3 RotateAndOvershoot(float time) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp01(time / sweepDuration); Vector3 val = Vector3.Cross(startDirection, targetDirection); Vector3 val2 = ((Vector3)(ref val)).normalized; if (val2 == Vector3.zero) { val2 = Vector3.up; } float num2 = Vector3.Angle(startDirection, targetDirection) + overshootAngle; float num3 = num * num; float num4 = num2 * num3; Quaternion val3 = Quaternion.AngleAxis(num4, val2); return val3 * startDirection; } } public class TrailDetonate : MonoBehaviour { private struct TrailPoint { public Vector3 position; public float localStartTime; public float localEndTime; public Transform segmentTransform; } public GameObject owner; public float damageTickInterval = 0.2f; public float radius = 2.5f; public float height = 0.5f; private float pointLifeTime = explosionDelay.Value; private float stopwatch = 0f; private static float dotDamageCoefficient = dotDamageCoeff.Value / 100f; private static float explosionDamageCoefficient = explosionDamageCoeff.Value / 100f; private float nextDamageTrailUpdate; private List ignoredObjects = new List(); public TeamIndex teamIndex; public float ownerDamage; private static GameObject explosionEffect = Addressables.LoadAssetAsync((object)RoR2_Junk_ArchWisp.OmniExplosionVFXArchWispCannonImpact_prefab).WaitForCompletion(); private List trailPoints = new List(); public void Start() { stopwatch = 0f; nextDamageTrailUpdate = damageTickInterval; } public void FixedUpdate() { stopwatch += Time.fixedDeltaTime; while (trailPoints.Count > 0 && trailPoints[0].localEndTime <= stopwatch) { RemovePoint(0); } if (nextDamageTrailUpdate <= stopwatch) { nextDamageTrailUpdate += damageTickInterval; DoDamage(); } if (stopwatch > 3f && trailPoints.Count == 0) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void DoDamage() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00ce: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_022c: 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || trailPoints.Count == 0) { return; } ignoredObjects.Clear(); List list = trailPoints; Vector3 val = list[list.Count - 1].position; TeamIndex val2 = teamIndex; if ((Object)(object)owner != (Object)null) { ignoredObjects.Add(owner); } DamageInfo val3 = new DamageInfo(); val3.attacker = owner; val3.inflictor = ((Component)this).gameObject; val3.crit = false; val3.damage = ownerDamage * dotDamageCoefficient; val3.damageColorIndex = (DamageColorIndex)0; val3.damageType = new DamageTypeCombo { damageType = (DamageType)0, damageSource = (DamageSource)8 }; val3.force = Vector3.zero; val3.procCoefficient = 0f; Vector3 val5 = default(Vector3); Collider[] array = default(Collider[]); for (int num = trailPoints.Count - 1; num >= 0; num--) { Vector3 position = trailPoints[num].position; Vector3 val4 = position - val; ((Vector3)(ref val5))..ctor(radius, height, ((Vector3)(ref val4)).magnitude); Vector3 val6 = Vector3.Lerp(position, val, 0.5f); Quaternion val7 = Util.QuaternionSafeLookRotation(val4); int num2 = HGPhysics.OverlapBox(ref array, val6, val5, val7, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)0); for (int i = 0; i < num2; i++) { HurtBox component = ((Component)array[i]).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { continue; } HealthComponent healthComponent = component.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { GameObject gameObject = ((Component)healthComponent).gameObject; if (!ignoredObjects.Contains(gameObject) && FriendlyFireManager.ShouldSplashHitProceed(healthComponent, val2)) { ignoredObjects.Add(gameObject); val3.position = ((Component)array[i]).transform.position; val3.inflictedHurtbox = component; healthComponent.TakeDamage(val3); } } } HGPhysics.ReturnResults(array); val = position; } } public void UpdateTrailWithNewPoint(Vector3 position, Vector3 normal) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (trailPoints.Count > 0) { List list = trailPoints; float num = Vector3.Distance(position, list[list.Count - 1].position); if ((double)num > 3.5) { AddPoint(position, normal); } } else { AddPoint(position, normal); } } public void AddPoint(Vector3 position, Vector3 normal) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) TrailPoint item = default(TrailPoint); item.position = position; item.localStartTime = stopwatch; item.localEndTime = stopwatch + pointLifeTime; Vector3 val = Vector3.ProjectOnPlane(Vector3.forward, normal); if ((Object)(object)segmentPrefab != (Object)null) { if (!EffectManager.ShouldUsePooledEffect(segmentPrefab)) { item.segmentTransform = Object.Instantiate(segmentPrefab, position, Util.QuaternionSafeLookRotation(val)).transform; } else { EffectManagerHelper andActivatePooledEffect = EffectManager.GetAndActivatePooledEffect(segmentPrefab, position, Util.QuaternionSafeLookRotation(val)); item.segmentTransform = ((Component)andActivatePooledEffect).gameObject.transform; } } trailPoints.Add(item); } public void RemovePoint(int pointIndex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) EffectManager.SpawnEffect(explosionEffect, new EffectData { origin = trailPoints[pointIndex].position, scale = 8f }, true); if (NetworkServer.active) { BlastAttack val = new BlastAttack(); val.attacker = owner; val.baseDamage = ownerDamage * explosionDamageCoefficient; val.baseForce = 3000f; val.damageColorIndex = (DamageColorIndex)0; val.position = trailPoints[pointIndex].position; val.radius = explosionRadius.Value; val.damageType = new DamageTypeCombo { damageSource = (DamageSource)8, damageType = (DamageType)0 }; val.procCoefficient = 0f; val.crit = false; val.falloffModel = (FalloffModel)2; val.teamIndex = teamIndex; val.Fire(); } if ((Object)(object)trailPoints[pointIndex].segmentTransform != (Object)null) { if (!EffectManager.UsePools) { Object.Destroy((Object)(object)((Component)trailPoints[pointIndex].segmentTransform).gameObject); } else { GameObject gameObject = ((Component)trailPoints[pointIndex].segmentTransform).gameObject; EffectManagerHelper component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.OwningPool != null) { ((GenericPool)(object)component.OwningPool).ReturnObject(component); } else { Object.Destroy((Object)(object)gameObject); } } } trailPoints.RemoveAt(pointIndex); } public void DestroyTrail() { Object.Destroy((Object)(object)((Component)this).gameObject); } } private static GameObject laserPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Golem.LaserGolem_prefab).WaitForCompletion(), "laserLunarGolem"); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_LunarGolem.LunarGolemMaster_prefab).WaitForCompletion(); private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_LunarGolem.LunarGolemBody_prefab).WaitForCompletion(); public static GameObject segmentPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Common.FireTrailSegment_prefab).WaitForCompletion(), "lunarGolemFireTrail"); private static GameObject chargeEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_LunarGolem.ChargeLunarGolemTwinShot_prefab).WaitForCompletion(); private static CharacterSpawnCard cscLunarGolem = Addressables.LoadAssetAsync((object)RoR2_Base_LunarGolem.cscLunarGolem_asset).WaitForCompletion(); internal static ConfigEntry cooldown; internal static ConfigEntry charges; internal static ConfigEntry healthThreshold; internal static ConfigEntry windupDuration; internal static ConfigEntry sweepDuration; internal static ConfigEntry explosionDelay; internal static ConfigEntry explosionRadius; internal static ConfigEntry dotDamageCoeff; internal static ConfigEntry explosionDamageCoeff; public override void RegisterConfig() { base.RegisterConfig(); cooldown = BindFloat("Laser Cooldown", 20f, "Cooldown of the laser sweep ability", 10f, 40f, 0.1f, PluginConfig.FormatType.Time); charges = BindFloat("Laser Charges", 2f, "Number of charges of the laser sweep", 1f, 4f, 1f); healthThreshold = BindFloat("Laser Health Threshold", 90f, "Max health percentage that the ability can be used", 0f, 100f, 1f, PluginConfig.FormatType.Percentage); windupDuration = BindFloat("Laser Windup Duration", 0.75f, "Duration of the windup before the sweep begins", 0.25f, 2f, 0.01f, PluginConfig.FormatType.Time); sweepDuration = BindFloat("Laser Sweep Duration", 1f, "Duration of the laser sweep", 0.25f, 3f, 0.01f, PluginConfig.FormatType.Time); explosionDelay = BindFloat("Laser Explosion Delay", 2f, "Time between the laser hitting and the trail exploding", 0.5f, 3f, 0.1f, PluginConfig.FormatType.Time); explosionRadius = BindFloat("Laser Explosion Radius", 8f, "Radius of the trail explosion", 4f, 12f, 0.1f, PluginConfig.FormatType.Distance); dotDamageCoeff = BindFloat("Laser DoT Damage Coefficient", 10f, "Damage coefficient of the fire trail DoT, as a percentage of the explosion's total damage.", 1f, 50f, 1f, PluginConfig.FormatType.Percentage); explosionDamageCoeff = BindFloat("Laser Explosion Damage Coefficient", 150f, "Damage coefficient of each trail explosion", 100f, 300f, 5f, PluginConfig.FormatType.Percentage); BindStats(bodyPrefab, new List(1) { cscLunarGolem }); } public override void Initialise() { base.Initialise(); CreateSkill(); ModifyLaserPrefab(); ModifyFireSegmentPrefab(); } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "LunarGolemBodyLaserSweep", skillName = "LunarGolemLaserSweep", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true, baseMaxStock = (int)charges.Value, rechargeStock = (int)charges.Value, requiredStock = 1, stockToConsume = 1, resetCdOnUse = false }; SkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, skillDef, "LunarGolemSpecialFamily", (SkillSlot)3); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "UseSpecialAndStrafe", skillSlot = (SkillSlot)3, minDistance = 0f, maxDistance = 100f, maxHealthFraction = healthThreshold.Value / 100f, requireReady = true, targetType = (TargetType)0, aimType = (AimType)2, movementType = (MovementType)2, driverUpdateTimerOverride = 1f, selectionRequiresTargetNonFlier = true, desiredIndex = 0 }; CreateAISkillDriver(data2); } public void ModifyLaserPrefab() { //IL_0034: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) LineRenderer component = laserPrefab.GetComponent(); component.startWidth = 0.5f; component.endWidth = 0.5f; component.startColor = new Color(0f, 0.8f, 1f); component.endColor = new Color(0f, 0.8f, 1f); Material val2 = (((Renderer)component).material = Addressables.LoadAssetAsync((object)RoR2_Junk_OrbitalLaser.matOrbitalLaserFiring_mat).WaitForCompletion()); ((Renderer)component).materials = (Material[])(object)new Material[1] { val2 }; } public void ModifyFireSegmentPrefab() { //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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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_0071: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_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) ParticleSystem component = segmentPrefab.GetComponent(); MainModule main = component.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetimeMultiplier = ((MainModule)(ref main)).startLifetimeMultiplier * 5f; ((MainModule)(ref main)).maxParticles = 15; EmissionModule emission = component.emission; ((EmissionModule)(ref emission)).rateOverDistanceMultiplier = ((EmissionModule)(ref emission)).rateOverDistanceMultiplier * 5f; ((EmissionModule)(ref emission)).rateOverTimeMultiplier = ((EmissionModule)(ref emission)).rateOverTimeMultiplier * 5f; SizeOverLifetimeModule sizeOverLifetime = component.sizeOverLifetime; ShapeModule shape = component.shape; ((ShapeModule)(ref shape)).scale = new Vector3(((ShapeModule)(ref shape)).scale.x * 1f, ((ShapeModule)(ref shape)).scale.y * 0.2f, ((ShapeModule)(ref shape)).scale.z * 1f); ((SizeOverLifetimeModule)(ref sizeOverLifetime)).yMultiplier = ((SizeOverLifetimeModule)(ref sizeOverLifetime)).yMultiplier * 2f; ParticleSystemRenderer component2 = segmentPrefab.GetComponent(); ((Renderer)component2).material = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.matFireStaticBlueLarge_mat).WaitForCompletion(); ((Renderer)component2).materials = (Material[])(object)new Material[1] { ((Renderer)component2).material }; } } } namespace EnemyAbilities.Abilities.IronHauler { [EnemyAbilities.ModuleInfo("Tractor Beam & Fling", "Gives Solus Transporters a pair of new utility abilities:\n- Tractor Beam: The Transporter picks up and manoeuvres a unit that is valid for cargo.\n- Fling: Toss it's cargo at it's target. Deals impact damage based on the cargo's weight.\nEnabling this will also grant all Solus Transporters a movespeed and aim-tracking buff.", "Solus Transporter", true)] public class TractorBeamModule : BaseModule { private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_IronHauler.IronHaulerBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_IronHauler.IronHaulerMaster_prefab).WaitForCompletion(); public static SkillDef tractorBeam; public static SkillDef fling; public static BuffDef cargoBuffDef; public static float maxCargoChaseDistance = 125f; public static GameObject tetherPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_moon2.BloodSiphonTetherVFX_prefab).WaitForCompletion(), "tractorBeamTetherVFX"); public static Sprite buffIcon = Addressables.LoadAssetAsync((object)RoR2_DLC2.texBuffDisableAllSkillsIcon_png).WaitForCompletion(); public static GameObject tractorBeamVFX = Addressables.LoadAssetAsync((object)RoR2_DLC3_IronHauler.IronHaulerAirLaunchProjectileGhost_prefab).WaitForCompletion(); public static GameObject gravityWellProjectile = Addressables.LoadAssetAsync((object)RoR2_DLC3_IronHauler.IronHaulerGravityWellProjectile_prefab).WaitForCompletion(); private static Material laserMaterial = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.matMajorConstructBeam_mat).WaitForCompletion(); public static GameObject sphereVFX; private static CharacterSpawnCard cscHauler = Addressables.LoadAssetAsync((object)RoR2_DLC3_IronHauler.cscIronHauler_asset).WaitForCompletion(); internal static ConfigEntry maxRange; internal static ConfigEntry timeToTarget; internal static ConfigEntry baseDamageCoeff; internal static ConfigEntry damageCoeffPerMass; internal static ConfigEntry explosionRadius; internal static ConfigEntry canFlingElites; internal static ConfigEntry canFlingBosses; internal static ConfigEntry cooldown; internal static ConfigEntry watchOut; public override void RegisterConfig() { base.RegisterConfig(); maxRange = BindFloat("Max Fling Range", 150f, "The maximum range at which a Solus Transporter can use it's fling ability", 70f, 200f, 1f, PluginConfig.FormatType.Distance); timeToTarget = BindFloat("Fling Time to Target", 3f, "The amount of time it takes a flung enemy to reach it's intended target. Higher values will yield higher arc heights.", 1f, 5f, 0.1f, PluginConfig.FormatType.Time); explosionRadius = BindFloat("Explosion Radius", 12f, "The explosion radius of a flung enemy landing.", 8f, 20f, 0.1f, PluginConfig.FormatType.Distance); baseDamageCoeff = BindFloat("Fling Damage Coefficient", 300f, "The base explosion damage of a flung enemy hitting the ground.", 100f, 600f, 5f, PluginConfig.FormatType.Percentage); damageCoeffPerMass = BindFloat("Fling Damage Coefficient per Unit Mass", 0.5f, "The value that is multiplied by the weight of the unit, before being added to the percentage damage coefficient. (e.g. a gup weighs 500, so a base damage coefficient of 200% with a damage per unit mass of 0.5 would yield 200% + 0.5 * 500% = 450%.", 0f, 1f, 0.01f, PluginConfig.FormatType.Percentage); canFlingElites = BindBool("Can Fling Elites", defaultValue: true, "Allows Solus Transporters to pick up and fling elite enemies"); canFlingBosses = BindBool("Can Fling Bosses", defaultValue: false, "Allows Solus Transporters to pick up and fling bosses. UNTESTED - ENABLE AT YOUR OWN PERIL!"); cooldown = BindFloat("Tractor Beam Cooldown", 12f, "The Cooldown for the Tractor Beam (which starts after an enemy is flung)", 5f, 30f, 0.1f, PluginConfig.FormatType.Time); watchOut = BindBool("Watch Out!!!", defaultValue: false, "Watch out, watch out, WATCH OUT!"); BindStats(bodyPrefab, new List(1) { cscHauler }, new StatOverrides { baseMoveSpeed = 14f, baseAcceleration = 20f, directorCost = 150f }); } public override void Initialise() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown base.Initialise(); bodyPrefab.AddComponent(); CreateSkills(); CreateBuffDef(); EntityStateMachine.SetState += new hook_SetState(DropCargoOnStun); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(AddArmor); SetupTetherPrefab(); Transform[] componentsInChildren = gravityWellProjectile.GetComponentsInChildren(); if (componentsInChildren.Length != 0) { Transform val = componentsInChildren.Where((Transform t) => ((Object)t).name == "Sphere").FirstOrDefault(); if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)null) { GameObject val2 = PrefabAPI.InstantiateClone(((Component)val).gameObject, "Clone"); sphereVFX = val2; } } if ((Object)(object)sphereVFX != (Object)null) { MeshRenderer component = sphereVFX.GetComponent(); MeshFilter component2 = sphereVFX.GetComponent(); } } private void AddArmor(CharacterBody sender, StatHookEventArgs args) { if (!((Object)(object)sender == (Object)null) && sender.HasBuff(cargoBuffDef)) { args.armorAdd += 30f; } } private void DropCargoOnStun(orig_SetState orig, EntityStateMachine entityStateMachine, EntityState entityState) { orig.Invoke(entityStateMachine, entityState); if (entityState == null || (!(entityState is FrozenState) && !(entityState is StunState))) { return; } CharacterBody characterBody = entityStateMachine.commonComponents.characterBody; if ((Object)(object)characterBody != (Object)null) { IronHaulerDriverController component = ((Component)characterBody).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.hasCargo) { component.DetachCargo(); } } } public void CreateSkills() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: 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_024b: 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_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "IronHaulerBodyTractorBeam", skillName = "IronHaulerTractorBeam", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = false }; tractorBeam = CreateSkillDef(data); SkillDefData data2 = new SkillDefData { objectName = "IronHaulerBodyFling", skillName = "IronHaulerFling", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = 1f, combatSkill = true }; fling = CreateSkillDef(data2); CreateGenericSkill(bodyPrefab, tractorBeam, "IronHaulerUtilityFamily", (SkillSlot)2); AISkillDriverData data3 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "fleeWithCargo", skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 40f, targetType = (TargetType)3, selectionRequiresTargetLoS = false, movementType = (MovementType)3, aimType = (AimType)1, moveInputScale = 0.75f, desiredIndex = 0 }; CreateAISkillDriver(data3); AISkillDriverData data4 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "strafeWithCargo", skillSlot = (SkillSlot)2, minDistance = 0f, maxDistance = 60f, targetType = (TargetType)3, activationRequiresAimTargetLoS = true, selectionRequiresTargetLoS = false, movementType = (MovementType)2, aimType = (AimType)1, moveInputScale = 0.75f, desiredIndex = 1 }; CreateAISkillDriver(data4); AISkillDriverData data5 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "chaseWithCargo", skillSlot = (SkillSlot)2, requiredSkillDef = fling, minDistance = 0f, maxDistance = maxRange.Value, targetType = (TargetType)3, movementType = (MovementType)1, aimType = (AimType)1, activationRequiresAimTargetLoS = true, selectionRequiresTargetLoS = false, moveInputScale = 0.75f, desiredIndex = 2 }; CreateAISkillDriver(data5); AISkillDriverData data6 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "chaseWithCargoFar", skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = float.PositiveInfinity, targetType = (TargetType)3, selectionRequiresTargetLoS = false, movementType = (MovementType)1, aimType = (AimType)1, moveInputScale = 0.75f, desiredIndex = 3 }; CreateAISkillDriver(data6); AISkillDriverData data7 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useUtilityOnCargoTarget", skillSlot = (SkillSlot)2, requiredSkillDef = tractorBeam, requireReady = true, minDistance = 0f, maxDistance = 40f, targetType = (TargetType)3, aimType = (AimType)1, selectionRequiresTargetLoS = false, activationRequiresAimTargetLoS = true, movementType = (MovementType)1, moveInputScale = 0.5f, desiredIndex = 4 }; CreateAISkillDriver(data7); AISkillDriverData data8 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "chaseCargoTarget", skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = maxCargoChaseDistance, aimType = (AimType)1, targetType = (TargetType)3, movementType = (MovementType)1, activationRequiresTargetLoS = false, desiredIndex = 5 }; CreateAISkillDriver(data8); } public void CreateBuffDef() { Texture2D texture = EnemyAbilities.Instance.assetBundle.LoadAsset("texTractorBeamIcon"); cargoBuffDef = ScriptableObject.CreateInstance(); ((Object)cargoBuffDef).name = "CargoBuff"; cargoBuffDef.isDebuff = true; cargoBuffDef.canStack = false; cargoBuffDef.iconSprite = Utils.CreateSprite(texture); cargoBuffDef.isHidden = false; ContentAddition.AddBuffDef(cargoBuffDef); } public void SetupTetherPrefab() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) LineRenderer component = tetherPrefab.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("TractorBeamModule.SetupTetherPrefab failed - tetherPrefab has no LineRenderer!"); return; } Material val = new Material(laserMaterial); val.mainTextureScale = Vector2.one; ((Renderer)component).material = val; } public static bool TargetIsValidForCargoSelection(CharacterBody targetBody, CharacterBody haulerBody) { //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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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) if ((Object)(object)targetBody == (Object)null || (Object)(object)haulerBody == (Object)null) { return false; } if ((Object)(object)targetBody.healthComponent == (Object)null || !targetBody.healthComponent.alive) { return false; } if ((Object)(object)haulerBody.healthComponent == (Object)null || !haulerBody.healthComponent.alive) { return false; } Vector3 corePosition = targetBody.corePosition; Vector3 corePosition2 = haulerBody.corePosition; if (Vector3.Distance(corePosition2, corePosition) > maxCargoChaseDistance) { return false; } if (targetBody.isElite && !canFlingElites.Value) { return false; } if (targetBody.isChampion && !canFlingBosses.Value) { return false; } if (targetBody.bodyIndex == BodyPrefabs.IronHaulerBody.bodyIndex || targetBody.bodyIndex == BodyPrefabs.ScorchlingBody.bodyIndex) { return false; } if (targetBody.isPlayerControlled) { return false; } if ((Object)(object)targetBody.master == (Object)null) { return false; } if ((Object)(object)((Component)targetBody).gameObject.GetComponent() != (Object)null) { return false; } if ((Object)(object)targetBody.rigidbody == (Object)null && (Object)(object)targetBody.characterMotor == (Object)null) { return false; } if ((Object)(object)((Component)targetBody).GetComponent() == (Object)null) { if (!targetBody.isChampion) { return false; } if (!canFlingBosses.Value) { return false; } } return true; } } public class TractorBeam : BaseSkillState { private IronHaulerDriverController driverController; private BaseAI ai; private float duration; public static float baseDuration = 0.5f; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if ((Object)(object)((EntityState)this).characterBody == (Object)null || (Object)(object)((Component)((EntityState)this).characterBody).gameObject == (Object)null || (Object)(object)((EntityState)this).characterBody.master == (Object)null || (Object)(object)((EntityState)this).characterBody.healthComponent == (Object)null || !((EntityState)this).characterBody.healthComponent.alive) { return; } driverController = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); if ((Object)(object)driverController == (Object)null) { return; } ai = ((Component)((EntityState)this).characterBody.master).GetComponent(); if (!((Object)(object)ai == (Object)null) && ai.customTarget != null && !((Object)(object)ai.customTarget.characterBody == (Object)null)) { CharacterBody characterBody = ai.customTarget.characterBody; if (!TractorBeamModule.TargetIsValidForCargoSelection(characterBody, ((EntityState)this).characterBody)) { RefundSkill(); return; } IronHaulerCargoController ironHaulerCargoController = ((Component)characterBody).gameObject.AddComponent(); ironHaulerCargoController.haulerBody = ((EntityState)this).characterBody; ironHaulerCargoController.haulerDriverController = driverController; driverController.cargoBody = characterBody; driverController.cargoController = ironHaulerCargoController; driverController.TryFindCustomTarget(); ((BaseSkillState)this).activatorSkillSlot.SetSkillOverride((object)((Component)((EntityState)this).characterBody).gameObject, TractorBeamModule.fling, (SkillOverridePriority)3); ((BaseSkillState)this).activatorSkillSlot.rechargeStopwatch = 0f; ((BaseSkillState)this).activatorSkillSlot.RemoveAllStocks(); } } public void ExitToMain() { ((EntityState)this).outer.SetNextStateToMain(); } public void RefundSkill() { ((BaseSkillState)this).activatorSkillSlot.AddOneStock(); ((BaseSkillState)this).activatorSkillSlot.baseRechargeStopwatch = ((BaseSkillState)this).activatorSkillSlot._cooldownOverride; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > duration) { ((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 Fling : BaseSkillState { private enum FlingState { None, LockOn, Windup, PostFling } private static float baseDuration = 6f; private float duration; private IronHaulerDriverController driverController; private IronHaulerCargoController cargoController; private CharacterBody cargoBody; private static float baseDamageCoefficient = TractorBeamModule.baseDamageCoeff.Value / 100f; private static float baseForce = 1500f; private static Vector3 bonusForce = new Vector3(0f, 1500f, 0f); private static float procCoefficient = 1f; private static float baseRadius = TractorBeamModule.explosionRadius.Value; private static float lockOnDuration = 1f; private float lockOnTimer = 0f; private static float windupMaxDuration = 5f; private float windUpTimer = 0f; private static float spinDownDuration = 2f; private float spinDownTimer = 0f; private CharacterMaster master; private BaseAI ai; private CharacterBody targetBody; private QuaternionPID angularVelocityPID; private VectorPID torquePID; private VectorPID forcePID; private Vector3 savedTorquePID; private Vector3 savedAngularVelocityPID; private float savedAngularDrag; private float savedMaxAngularVelocity; private static float maxSpinAngularVelocity = 80f; private Vector3 flingVelocity; private bool cargoDetached; private Vector3 randomSpinDownDirection; private bool collidersDisabled; private FlingState flingState; public override void OnEnter() { //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); driverController = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); cargoController = driverController.cargoController; cargoController.tractorBeamBonusDistance = 4f; cargoBody = cargoController.body; duration = baseDuration; lockOnTimer = 0f; master = ((EntityState)this).characterBody.master; driverController.TryFindCustomTarget(); if ((Object)(object)master != (Object)null) { ai = ((Component)master).gameObject.GetComponent(); if ((Object)(object)ai != (Object)null && ai.customTarget != null && (Object)(object)ai.customTarget.characterBody != (Object)null) { targetBody = ai.customTarget.characterBody; } ai.aimVectorMaxSpeed = 180f; } angularVelocityPID = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); torquePID = (from pid in ((Component)((EntityState)this).characterBody).gameObject.GetComponents() where pid.customName == "torquePID" select pid).FirstOrDefault(); forcePID = (from pid in ((Component)((EntityState)this).characterBody).gameObject.GetComponents() where pid.customName == "Force PID" select pid).FirstOrDefault(); if ((Object)(object)torquePID != (Object)null) { savedTorquePID = torquePID.PID; torquePID.PID = new Vector3(8f, 0f, 0f); torquePID.gain = 1f; torquePID.ResetPID(); } if ((Object)(object)angularVelocityPID != (Object)null) { savedAngularVelocityPID = angularVelocityPID.PID; angularVelocityPID.PID = new Vector3(80f, 0f, 4f); angularVelocityPID.ResetPID(); } if ((Object)(object)((EntityState)this).rigidbody != (Object)null) { savedAngularDrag = ((EntityState)this).rigidbody.angularDrag; savedMaxAngularVelocity = ((EntityState)this).rigidbody.maxAngularVelocity; } flingState = FlingState.LockOn; SetColliders(enable: false); } private void SetColliders(bool enable) { Collider[] components = ((Component)((EntityState)this).characterBody).gameObject.GetComponents(); foreach (Collider val in components) { if ((Object)(object)val != (Object)null) { val.enabled = enable; } } collidersDisabled = !enable; } public override void OnExit() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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) ((EntityState)this).OnExit(); if (collidersDisabled) { SetColliders(enable: true); } if ((Object)(object)cargoController != (Object)null) { cargoController.inWindupState = false; cargoController.tractorBeamBonusDistance = 11f; } if ((Object)(object)torquePID != (Object)null) { torquePID.PID = savedTorquePID; torquePID.gain = 3f; ((Behaviour)torquePID).enabled = true; torquePID.ResetPID(); } if ((Object)(object)angularVelocityPID != (Object)null) { angularVelocityPID.PID = savedAngularVelocityPID; angularVelocityPID.ResetPID(); } if ((Object)(object)((EntityState)this).rigidbody != (Object)null) { ((EntityState)this).rigidbody.maxAngularVelocity = savedMaxAngularVelocity; ((EntityState)this).rigidbody.angularDrag = savedAngularDrag; } if ((Object)(object)ai != (Object)null) { ai.aimVectorMaxSpeed = 60f; } } public override void FixedUpdate() { //IL_00a3: 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_01c3: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Expected O, but got Unknown //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((EntityState)this).FixedUpdate(); if ((Object)(object)ai == (Object)null || ai.customTarget == null || (Object)(object)targetBody == (Object)null || (Object)(object)targetBody.healthComponent == (Object)null || !targetBody.healthComponent.alive || (Object)(object)cargoBody == (Object)null) { ((EntityState)this).outer.SetNextStateToMain(); return; } if (flingState == FlingState.LockOn) { if ((Object)(object)((EntityState)this).rigidbody != (Object)null) { ((EntityState)this).rigidbody.velocity = Vector3.zero; } lockOnTimer += Time.fixedDeltaTime; if (lockOnTimer >= lockOnDuration) { ((Behaviour)torquePID).enabled = false; ((EntityState)this).rigidbody.angularVelocity = Vector3.zero; ((EntityState)this).rigidbody.angularDrag = 0f; ((EntityState)this).rigidbody.maxAngularVelocity = maxSpinAngularVelocity / cargoController.hullRadius + 4f; ai.aimVectorMaxSpeed = 180f; flingState = FlingState.Windup; cargoController.inWindupState = true; } } if (flingState == FlingState.Windup) { if (windUpTimer > windupMaxDuration) { ((EntityState)this).outer.SetNextStateToMain(); } if ((Object)(object)((EntityState)this).rigidbody != (Object)null) { ((EntityState)this).rigidbody.velocity = Vector3.zero; } windUpTimer += Time.fixedDeltaTime; Vector3 right = ((EntityState)this).characterBody.transform.right; float num = 0.2f; Vector3 val = cargoBody.transform.position - ((EntityState)this).characterBody.transform.position; Vector3 currentVelocity = Vector3.Cross(((EntityState)this).rigidbody.angularVelocity, val); Vector3 val2 = FindRequiredLaunchVelocity(currentVelocity); float num2 = Vector3.Dot(((Vector3)(ref currentVelocity)).normalized, ((Vector3)(ref val2)).normalized); if (num2 > 0.95f) { flingVelocity = val2; flingState = FlingState.PostFling; cargoController.PrepareForFling(flingVelocity); randomSpinDownDirection = Random.insideUnitSphere; } if (((Vector3)(ref val2)).magnitude > ((Vector3)(ref currentVelocity)).magnitude && flingState == FlingState.Windup) { Rigidbody rigidbody = ((EntityState)this).rigidbody; rigidbody.angularVelocity += right * num; } } if (flingState == FlingState.PostFling && !cargoDetached) { torquePID.PID = new Vector3(0.25f, 0f, 0f); ((Behaviour)torquePID).enabled = true; torquePID.ResetPID(); cargoDetached = true; float num3 = 0f; if ((Object)(object)cargoBody.rigidbody != (Object)null) { num3 = cargoBody.rigidbody.mass; } if ((Object)(object)cargoBody.characterMotor != (Object)null) { num3 = cargoBody.characterMotor.mass; } BlastAttack val3 = new BlastAttack(); val3.attacker = ((Component)((EntityState)this).characterBody).gameObject; val3.attackerFiltering = (AttackerFiltering)2; val3.baseDamage = ((BaseState)this).damageStat * (baseDamageCoefficient + num3 / 100f * TractorBeamModule.damageCoeffPerMass.Value); val3.baseForce = baseForce + num3 * 3f; val3.bonusForce = bonusForce + new Vector3(0f, num3 * 1.5f, 0f); val3.crit = ((BaseState)this).RollCrit(); val3.damageColorIndex = (DamageColorIndex)0; val3.damageType = DamageTypeCombo.Generic; val3.falloffModel = (FalloffModel)2; val3.inflictor = ((Component)((EntityState)this).characterBody).gameObject; val3.procCoefficient = procCoefficient; val3.radius = baseRadius + num3 / 50f; val3.teamIndex = ((EntityState)this).characterBody.teamComponent.teamIndex; cargoController.blastAttack = val3; ((EntityState)this).skillLocator.primary.rechargeStopwatch = ((EntityState)this).skillLocator.primary.cooldownOverride - 3f; driverController.DetachCargo(); if (collidersDisabled) { SetColliders(enable: true); } } if (flingState == FlingState.PostFling) { spinDownTimer += Time.fixedDeltaTime; Rigidbody rigidbody2 = ((EntityState)this).rigidbody; rigidbody2.angularVelocity += randomSpinDownDirection * 0.2f; if (spinDownTimer > spinDownDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } } private Vector3 FindRequiredLaunchVelocity(Vector3 currentVelocity) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_006c: Unknown result type (might be due to invalid IL or missing references) Vector3 gravity = Physics.gravity; Vector3 position = cargoBody.transform.position; Vector3 footPosition = ai.customTarget.characterBody.footPosition; float value = TractorBeamModule.timeToTarget.Value; Vector3 val = (footPosition - position) / value; Vector3 val2 = 0.5f * gravity * value; return val - val2; } 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)5; } } public class IronHaulerCargoController : MonoBehaviour { public class OriginalBehaviours { public bool HasCharMotor; public bool HasRigidBody; public bool HasRigidBodyMotor; public bool CharMotorGravity; public float CharMotorGravityScale; public bool RigidBodyGravity; public bool IgnoreFallDamage; public bool RespectImpactDamage; public bool HasPseudoMotor; public int GravityCount; public int FlightCount; public OriginalBehaviours(bool hasCharMotor = false, bool hasRigidBody = false, bool hasRigidBodyMotor = false, bool characterMotorGravity = false, float characterMotorGravityScale = 0f, bool rigidBodyGravity = false, bool ignoreFallDamage = false, bool respectImpactDamage = false, bool hasPseudoMotor = false, int gravityCount = 0, int flightCount = 0) { HasCharMotor = hasCharMotor; HasRigidBody = hasRigidBody; HasRigidBodyMotor = hasRigidBodyMotor; CharMotorGravity = characterMotorGravity; CharMotorGravityScale = characterMotorGravityScale; RigidBodyGravity = rigidBodyGravity; IgnoreFallDamage = ignoreFallDamage; RespectImpactDamage = respectImpactDamage; HasPseudoMotor = hasPseudoMotor; GravityCount = gravityCount; FlightCount = flightCount; } } public CharacterBody haulerBody; public IronHaulerDriverController haulerDriverController; public CharacterBody body; private int fixedUpdatesWithoutHauler; private int maxFixedUpdatesWithoutHauler = 1; public static float baseTractorBeamBonusDistance = 11f; public float tractorBeamBonusDistance; private float pullStrength; private float stopwatch; public OriginalBehaviours originalBehaviours; private Rigidbody rigid; private RigidbodyMotor rigidMotor; private CharacterMotor motor; private SetStateOnHurt stateOnHurt; private PseudoCharacterMotor pseudoMotor; private bool origBehavioursRecorded; private float stunRefreshTimer; private static float stunRefreshDuration = 0.25f; private bool tempCanBeStunned; public float hullRadius; private ChildMonsterController childMonsterController; public bool inWindupState = false; public bool readyToFling = false; private Vector3 flingVelocity; public bool flung = false; private VectorPID forcePID; public BlastAttack blastAttack; private float drag; private static GameObject explosionPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Loader.LoaderGroundSlam_prefab).WaitForCompletion(); private int _origLayer; private GameObject sphereVFXInstance; private static float delayBeforeRestoring = 0.2f; private float delayTimer = 0f; public bool restore = false; private bool firedBlast = false; private TrailRenderer trailRenderer; private static Material trailMaterial = Addressables.LoadAssetAsync((object)RoR2_DLC3_IronHauler.matIronHaulerBeamTrail_mat).WaitForCompletion(); private GameObject trailObject; public void Awake() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Expected I4, but got Unknown //IL_01eb: 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: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) body = ((Component)this).GetComponent(); body.SetBuffCount(TractorBeamModule.cargoBuffDef.buffIndex, 1); motor = ((Component)this).GetComponent(); rigid = ((Component)this).GetComponent(); rigidMotor = ((Component)this).GetComponent(); stateOnHurt = ((Component)this).GetComponent(); pseudoMotor = ((Component)this).GetComponent(); childMonsterController = ((Component)this).GetComponent(); VectorPID[] components = ((Component)this).GetComponents(); if ((Object)(object)rigid != (Object)null) { drag = rigid.drag; } if (components != null && components.Length != 0) { forcePID = components.Where((VectorPID pid) => pid.customName == "Force PID").FirstOrDefault(); } if ((Object)(object)childMonsterController != (Object)null) { ((Behaviour)childMonsterController).enabled = false; } if ((Object)(object)stateOnHurt != (Object)null) { if (!stateOnHurt.canBeStunned) { stateOnHurt.canBeStunned = true; tempCanBeStunned = true; } stateOnHurt.SetStun(1f); } sphereVFXInstance = Object.Instantiate(TractorBeamModule.sphereVFX, ((Component)body).gameObject.transform); HullClassification hullClassification = body.hullClassification; HullClassification val = hullClassification; switch ((int)val) { case 0: hullRadius = 4f; break; case 1: hullRadius = 8f; break; case 2: hullRadius = 12f; break; default: hullRadius = 10f; break; } float num = Mathf.Max(1f, 1f * (hullRadius + 5f)); sphereVFXInstance.transform.localScale = new Vector3(num, num, num); tractorBeamBonusDistance = baseTractorBeamBonusDistance; trailObject = new GameObject(); trailObject.transform.position = body.corePosition; trailRenderer = trailObject.AddComponent(); if ((Object)(object)trailRenderer != (Object)null) { ((Renderer)trailRenderer).material = trailMaterial; ((Renderer)trailRenderer).materials = (Material[])(object)new Material[1] { trailMaterial }; trailRenderer.startWidth = 0.5f; trailRenderer.endWidth = 0.2f; trailRenderer.emitting = true; trailRenderer.time = 0.4f; trailRenderer.startColor = Color.blue; trailRenderer.endColor = Color.white; } } public void RecordAndSuppressBehaviours() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Invalid comparison between Unknown and I4 //IL_0118: 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_015a: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) originalBehaviours = new OriginalBehaviours { HasCharMotor = ((Object)(object)motor != (Object)null), HasRigidBody = ((Object)(object)rigid != (Object)null), HasRigidBodyMotor = ((Object)(object)rigidMotor != (Object)null), CharMotorGravity = ((Object)(object)motor != (Object)null && motor.useGravity), CharMotorGravityScale = (((Object)(object)motor != (Object)null) ? motor.gravityScale : 0f), RigidBodyGravity = ((Object)(object)rigid != (Object)null && rigid.useGravity), IgnoreFallDamage = ((body.bodyFlags & 1) > 0), RespectImpactDamage = ((Object)(object)rigidMotor != (Object)null && rigidMotor.canTakeImpactDamage), HasPseudoMotor = ((Object)(object)pseudoMotor != (Object)null), GravityCount = (((Object)(object)motor != (Object)null) ? motor.gravityParameters.channeledAntiGravityGranterCount : 0), FlightCount = (((Object)(object)motor != (Object)null) ? motor.flightParameters.channeledFlightGranterCount : 0) }; CharacterBody obj = body; obj.bodyFlags = (BodyFlags)(obj.bodyFlags | 1); if ((Object)(object)motor != (Object)null) { motor.useGravity = false; motor.gravityScale = 0f; CharacterGravityParameters gravityParameters = body.characterMotor.gravityParameters; CharacterFlightParameters flightParameters = body.characterMotor.flightParameters; flightParameters.channeledFlightGranterCount = 0; gravityParameters.channeledAntiGravityGranterCount = 0; motor.gravityParameters = gravityParameters; motor.flightParameters = flightParameters; } if ((Object)(object)rigid != (Object)null) { rigid.useGravity = false; } if ((Object)(object)rigidMotor != (Object)null) { rigidMotor.canTakeImpactDamage = false; } DisableCharacterMotorCollision(); } public void FixedUpdate() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)trailObject != (Object)null) { trailObject.transform.position = body.corePosition; } if (!origBehavioursRecorded) { RecordAndSuppressBehaviours(); origBehavioursRecorded = true; } if (restore) { delayTimer += Time.fixedDeltaTime; } if (restore && delayTimer > delayBeforeRestoring) { RestoreOriginalBehaviours(); } stopwatch += Time.fixedDeltaTime; if (fixedUpdatesWithoutHauler > maxFixedUpdatesWithoutHauler && !flung && !readyToFling) { restore = true; return; } if (((Object)(object)haulerBody == (Object)null || (Object)(object)haulerDriverController == (Object)null) && !flung && !readyToFling) { fixedUpdatesWithoutHauler++; return; } fixedUpdatesWithoutHauler = 0; stunRefreshTimer -= Time.fixedDeltaTime; if (stunRefreshTimer < 0f) { stunRefreshTimer += stunRefreshDuration; RefreshStun(); } if (readyToFling && !flung) { flung = true; EnterFlungState(); } if ((Object)(object)body != (Object)null && (Object)(object)body.healthComponent != (Object)null && body.healthComponent.alive && (Object)(object)haulerBody != (Object)null && (Object)(object)haulerDriverController != (Object)null && !readyToFling) { RepositionCargo(); } } public void EnterFlungState() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown if (TractorBeamModule.watchOut.Value) { Util.PlaySound("Play_ironHaulerWatchOut", ((Component)body).gameObject); } if ((Object)(object)motor != (Object)null) { motor.velocity = flingVelocity; motor.disableAirControlUntilCollision = true; motor.useGravity = true; motor.gravityScale = 1f; motor.onMovementHit += new MovementHitDelegate(OnMovementHitCharacterMotor); } if ((Object)(object)rigid != (Object)null) { rigid.velocity = flingVelocity; rigid.useGravity = true; drag = rigid.drag; rigid.drag = 0f; if ((Object)(object)forcePID != (Object)null) { ((Behaviour)forcePID).enabled = false; } } if ((Object)(object)rigidMotor != (Object)null) { rigidMotor.onMovementHit += new MovementHitDelegate(OnMovementHitRigidbodyMotor); } } private void OnMovementHitRigidbodyMotor(ref MovementHitInfo movementHitInfo) { Detonate(); } private void OnMovementHitCharacterMotor(ref MovementHitInfo movementHitInfo) { Detonate(); } private void Detonate() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_008f: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_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) //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_00f0: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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) //IL_0171: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (firedBlast || (Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive) { return; } if (blastAttack != null) { firedBlast = true; EffectManager.SpawnEffect(explosionPrefab, new EffectData { origin = body.corePosition, scale = blastAttack.radius }, true); blastAttack.position = body.corePosition; if (NetworkServer.active) { blastAttack.Fire(); } DamageTypeCombo val = default(DamageTypeCombo); val.damageSource = (DamageSource)4; val.damageType = (DamageType)0; DamageTypeCombo val2 = val; DamageInfo val3 = new DamageInfo { attacker = ((Component)body).gameObject, inflictor = ((Component)body).gameObject, crit = false, damage = body.healthComponent.fullHealth / 20f, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), procCoefficient = 0f, procChainMask = default(ProcChainMask), force = Vector3.zero, position = body.transform.position }; body.healthComponent.TakeDamage(val3); } restore = true; } public void RepositionCargo() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_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_004a: 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_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) InputBankTest inputBank = haulerBody.inputBank; if ((Object)(object)inputBank == (Object)null) { Log.Error("Hauler has no Input Bank!"); } Ray aimRay = inputBank.GetAimRay(); Vector3 corePosition = body.corePosition; float num = tractorBeamBonusDistance + hullRadius; Vector3 origin = ((Ray)(ref aimRay)).origin; Vector3 val = ((!inWindupState) ? ((Ray)(ref aimRay)).direction : haulerBody.modelLocator.modelBaseTransform.forward); RaycastHit val2 = default(RaycastHit); corePosition = ((!Physics.Raycast(origin, val, ref val2, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) ? (origin + val * num) : (((RaycastHit)(ref val2)).point - val * hullRadius)); Vector3 val3 = body.corePosition - body.transform.position; Vector3 val4 = corePosition; Vector3 val5 = val4 - val3; float num2 = Mathf.Clamp01(stopwatch / 6f); pullStrength = num2 * 0.3f; Vector3 val6 = Vector3.Lerp(body.footPosition, val5, pullStrength); TeleportHelper.TeleportBody(body, val6, true); } public void RestoreOriginalBehaviours() { //IL_0036: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)trailObject != (Object)null) { Object.Destroy((Object)(object)trailRenderer); Object.Destroy((Object)(object)trailObject); } body.SetBuffCount(TractorBeamModule.cargoBuffDef.buffIndex, 0); if (originalBehaviours.HasCharMotor && (Object)(object)motor != (Object)null) { motor.gravityScale = originalBehaviours.CharMotorGravityScale; motor.useGravity = originalBehaviours.CharMotorGravity; CharacterGravityParameters gravityParameters = motor.gravityParameters; CharacterFlightParameters flightParameters = motor.flightParameters; gravityParameters.channeledAntiGravityGranterCount = originalBehaviours.GravityCount; flightParameters.channeledFlightGranterCount = originalBehaviours.FlightCount; motor.gravityParameters = gravityParameters; motor.flightParameters = flightParameters; if (flung) { motor.onMovementHit -= new MovementHitDelegate(OnMovementHitCharacterMotor); } } if (originalBehaviours.HasRigidBodyMotor && Object.op_Implicit((Object)(object)rigidMotor)) { rigidMotor.canTakeImpactDamage = originalBehaviours.RespectImpactDamage; if (flung) { rigidMotor.onMovementHit -= new MovementHitDelegate(OnMovementHitRigidbodyMotor); } } if (originalBehaviours.HasRigidBody && (Object)(object)rigid != (Object)null) { rigid.useGravity = originalBehaviours.RigidBodyGravity; rigid.drag = drag; } if ((Object)(object)forcePID != (Object)null) { ((Behaviour)forcePID).enabled = true; } if (!originalBehaviours.IgnoreFallDamage) { CharacterBody obj = body; obj.bodyFlags = (BodyFlags)(obj.bodyFlags & -2); } if (tempCanBeStunned) { stateOnHurt.canBeStunned = false; } if ((Object)(object)childMonsterController != (Object)null) { ((Behaviour)childMonsterController).enabled = true; } EnableCharacterMotorCollision(); Object.Destroy((Object)(object)sphereVFXInstance); Object.Destroy((Object)(object)this); } public void RefreshStun() { if (!((Object)(object)stateOnHurt != (Object)null)) { return; } EntityState state = stateOnHurt.targetStateMachine.state; StunState val = (StunState)(object)((state is StunState) ? state : null); if (val != null) { if (val.duration - ((EntityState)val).fixedAge <= 1f) { val.duration += stunRefreshDuration; } } else if (stateOnHurt.canBeStunned) { stateOnHurt.SetStun(1f); } } public void PrepareForFling(Vector3 velocity) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) readyToFling = true; flingVelocity = velocity; } private void DisableCharacterMotorCollision() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)motor != (Object)null) { _origLayer = ((Component)body).gameObject.layer; ((Component)body).gameObject.layer = LayerIndex.GetAppropriateFakeLayerForTeam(body.teamComponent.teamIndex).intVal; ((BaseCharacterController)motor).Motor.RebuildCollidableLayers(); } } private void EnableCharacterMotorCollision() { if ((Object)(object)motor != (Object)null) { ((Component)body).gameObject.layer = _origLayer; ((BaseCharacterController)motor).Motor.RebuildCollidableLayers(); } } } public class IronHaulerDriverController : MonoBehaviour { public bool hasCargo; public bool tractorBeamReady; public bool hasValidCargoTarget; public CharacterBody cargoBody; public IronHaulerCargoController cargoController; private TetherVfxOrigin tetherVfxOrigin; public AISkillDriver fleeWithCargoDriver; public AISkillDriver strafeWithCargoDriver; public AISkillDriver chaseWithCargoDriver; public AISkillDriver chaseWithCargoFarDriver; public AISkillDriver chaseCargoTargetDriver; public AISkillDriver useTractorBeamDriver; private CharacterBody body; private SkillLocator skillLocator; private ChildLocator childLocator; private Transform muzzleTransform; public BaseAI ai; public static float targetCheckInterval = 0.25f; private float targetCheckTimer; public void Awake() { body = ((Component)this).GetComponent(); IronHaulerController component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = false; } hasCargo = false; targetCheckTimer = targetCheckInterval; if ((Object)(object)body != (Object)null && (Object)(object)body.modelLocator != (Object)null && (Object)(object)body.modelLocator.modelTransform != (Object)null) { childLocator = ((Component)body.modelLocator.modelTransform).GetComponent(); muzzleTransform = childLocator.FindChild("Muzzle"); tetherVfxOrigin = ((Component)body.healthComponent).gameObject.AddComponent(); tetherVfxOrigin.tetherPrefab = TractorBeamModule.tetherPrefab; tetherVfxOrigin.transform = muzzleTransform; } } public void Start() { if ((Object)(object)body != (Object)null && (Object)(object)body.master != (Object)null) { ai = ((Component)body.master).GetComponent(); } skillLocator = body.skillLocator; AISkillDriver[] skillDrivers = ai.skillDrivers; fleeWithCargoDriver = skillDrivers.Where((AISkillDriver driver) => driver.customName == "fleeWithCargo").FirstOrDefault(); strafeWithCargoDriver = skillDrivers.Where((AISkillDriver driver) => driver.customName == "strafeWithCargo").FirstOrDefault(); chaseWithCargoDriver = skillDrivers.Where((AISkillDriver driver) => driver.customName == "chaseWithCargo").FirstOrDefault(); chaseWithCargoFarDriver = skillDrivers.Where((AISkillDriver driver) => driver.customName == "chaseWithCargoFar").FirstOrDefault(); chaseCargoTargetDriver = skillDrivers.Where((AISkillDriver driver) => driver.customName == "chaseCargoTarget").FirstOrDefault(); useTractorBeamDriver = skillDrivers.Where((AISkillDriver driver) => driver.customName == "useUtilityOnCargoTarget").FirstOrDefault(); } public void FixedUpdate() { if ((Object)(object)ai == (Object)null) { return; } targetCheckTimer -= Time.fixedDeltaTime; if (ai.customTarget == null || (Object)(object)ai.customTarget.gameObject == (Object)null || (Object)(object)ai.customTarget.healthComponent == (Object)null || !ai.customTarget.healthComponent.alive) { targetCheckTimer = targetCheckInterval; TryFindCustomTarget(); } if (targetCheckTimer < 0f) { targetCheckTimer += targetCheckInterval; TryFindCustomTarget(); } tractorBeamReady = (Object)(object)skillLocator.utility.skillDef == (Object)(object)TractorBeamModule.tractorBeam && skillLocator.utility.IsReady(); ((Behaviour)fleeWithCargoDriver).enabled = hasCargo; ((Behaviour)strafeWithCargoDriver).enabled = hasCargo; ((Behaviour)chaseWithCargoDriver).enabled = hasCargo; ((Behaviour)chaseWithCargoFarDriver).enabled = hasCargo; bool enabled = tractorBeamReady && hasValidCargoTarget && !hasCargo; ((Behaviour)chaseCargoTargetDriver).enabled = enabled; ((Behaviour)useTractorBeamDriver).enabled = enabled; if ((Object)(object)cargoBody != (Object)null && (Object)(object)cargoController != (Object)null) { if ((Object)(object)cargoBody.healthComponent == (Object)null || !cargoBody.healthComponent.alive) { DetachCargo(); } else { hasCargo = true; } } else { hasCargo = false; } } public void Update() { if ((Object)(object)cargoBody != (Object)null && hasCargo) { tetherVfxOrigin.SetTetheredTransforms(((Object)(object)cargoBody.coreTransform != (Object)null) ? new List(1) { cargoBody.coreTransform } : new List(1) { cargoBody.transform }); } else { tetherVfxOrigin.SetTetheredTransforms(new List()); } } public void DetachCargo() { if ((Object)(object)cargoController != (Object)null && !cargoController.readyToFling) { cargoController.restore = true; } cargoBody = null; cargoController = null; hasCargo = false; skillLocator.utility.UnsetSkillOverride((object)((Component)body).gameObject, TractorBeamModule.fling, (SkillOverridePriority)3); skillLocator.utility.RemoveAllStocks(); skillLocator.utility.rechargeStopwatch = 0f; } public void TryFindCustomTarget() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ai == (Object)null || (Object)(object)ai.bodyInputBank == (Object)null || (Object)(object)ai.body == (Object)null) { return; } Ray aimRay = ai.bodyInputBank.GetAimRay(); BullseyeSearch val = new BullseyeSearch(); val.viewer = ai.body; val.filterByDistinctEntity = true; val.filterByLoS = false; val.maxDistanceFilter = float.PositiveInfinity; val.minDistanceFilter = 0f; val.maxAngleFilter = 360f; val.searchDirection = ((Ray)(ref aimRay)).direction; val.searchOrigin = ((Ray)(ref aimRay)).origin; val.sortMode = (SortMode)1; val.queryTriggerInteraction = (QueryTriggerInteraction)0; TeamMask allButNeutral = TeamMask.allButNeutral; val.teamMaskFilter = allButNeutral; val.RefreshCandidates(); val.FilterOutGameObject(((Component)ai.body).gameObject); if ((Object)(object)ai.body != (Object)null && (Object)(object)skillLocator != (Object)null && (Object)(object)skillLocator.utility != (Object)null && skillLocator.utility.IsReady() && (Object)(object)skillLocator.utility.skillDef == (Object)(object)TractorBeamModule.tractorBeam && !hasCargo) { IEnumerable source = from hurtBox in val.GetResults() where (Object)(object)hurtBox.healthComponent != (Object)null && (Object)(object)hurtBox.healthComponent.body != (Object)null && TractorBeamModule.TargetIsValidForCargoSelection(hurtBox.healthComponent.body, body) select hurtBox; if (source.Any()) { Target customTarget = ai.customTarget; HurtBox? obj = source.FirstOrDefault(); customTarget.gameObject = ((obj != null) ? ((Component)obj.healthComponent.body).gameObject : null); hasValidCargoTarget = true; return; } } hasValidCargoTarget = false; TryFindDefaultTarget(val); } private void TryFindDefaultTarget(BullseyeSearch search) { IEnumerable source = search.GetResults().Where(TargetValidForNormalSelection); Target customTarget = ai.customTarget; HurtBox? obj = source.FirstOrDefault(); customTarget.gameObject = ((obj != null) ? ((Component)obj.healthComponent.body).gameObject : null); } private bool TargetValidForNormalSelection(HurtBox arg) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 HealthComponent healthComponent = arg.healthComponent; if ((Object)(object)healthComponent == (Object)null) { return false; } if (!healthComponent.alive) { return false; } CharacterBody val = healthComponent.body; if (body.teamComponent.teamIndex == val.teamComponent.teamIndex) { return false; } if ((val.bodyFlags & 0x400000) > 0) { return false; } if ((Object)(object)((Component)val).gameObject.GetComponent() != (Object)null) { return false; } return true; } } } namespace EnemyAbilities.Abilities.GreaterWisp { [EnemyAbilities.ModuleInfo("Inferno Wheel", "Gives Greater Wisps a new special:\n-Inferno Wheel: Charges up a ring of fireballs that spin faster and faster until they fire off at their target. Each fireball leaves behind a large AoE. The fireballs can be destroyed both whilst charging and mid-flight, and will not leave an AoE if destroyed in this manner.\nActivating this module gives Greater Wisps a health boost, and slightly reduces its director cost.", "Greater Wisp", true)] public class FireballCarouselModule : BaseModule { public class FireballCarousel : BaseSkillState { private static float baseSpinupDuration = FireballCarouselModule.spinupDuration.Value; private float spinupDuration; private static float baseFireDuration = 1f; private float fireDuration; private CarouselController controller; private static float fallbackDuration = baseSpinupDuration + baseFireDuration + 3f; private static float recoveryDuration = 0.25f; private static float startRadius = 14f; private static float endRadius = 7f; private float radius; private static float startDegreesPerSecond = 0f; private static float endDegreesPerSecond = 360f; private float degreesPerSecond; private float currentAngle; private bool allFireballsLaunched = false; private float damageCoefficient = damageCoeff.Value / 100f; private float projectileSpeed = FireballCarouselModule.projectileSpeed.Value; private int projectilesReadied; private int projectileCount = (int)FireballCarouselModule.projectileCount.Value; private bool readyToLaunch = false; public override void OnEnter() { //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_008b: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); spinupDuration = baseSpinupDuration / ((BaseState)this).attackSpeedStat; fireDuration = baseFireDuration / ((BaseState)this).attackSpeedStat; for (int i = 0; i < projectileCount; i++) { Vector3 corePosition = ((EntityState)this).characterBody.corePosition; Vector3 aimDirection = ((EntityState)this).inputBank.aimDirection; Vector3 up = ((EntityState)this).characterBody.transform.up; Vector3 right = ((EntityState)this).characterBody.transform.right; float num = 360f / (float)projectileCount; float num2 = num * (float)i * (MathF.PI / 180f); Vector3 val = (right * Mathf.Sin(num2) + up * Mathf.Cos(num2)) * startRadius; Vector3 val2 = corePosition + val; DamageTypeCombo val3 = default(DamageTypeCombo); val3.damageSource = (DamageSource)2; val3.damageType = (DamageType)0; DamageTypeCombo value = val3; if (igniteOnHit.Value) { value.damageType = (DamageType)128; } ProjectileManager.instance.FireProjectile(fireballProjectile, val2, Quaternion.identity, ((Component)((EntityState)this).characterBody).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 0f, (DamageTypeCombo?)value); } controller = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); projectilesReadied = 0; } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > spinupDuration && !readyToLaunch) { readyToLaunch = true; } float num = Mathf.Clamp01(((EntityState)this).fixedAge / spinupDuration); radius = startRadius + (endRadius - startRadius) * num; degreesPerSecond = startDegreesPerSecond + (endDegreesPerSecond - startDegreesPerSecond) * num; if ((Object)(object)controller != (Object)null && controller.fireballs.Count > 0) { float prevAngleDeg = currentAngle; currentAngle += degreesPerSecond * Time.fixedDeltaTime; allFireballsLaunched = true; for (int num2 = controller.fireballs.Count - 1; num2 >= 0; num2--) { ProjectileCarouselFireball projectileCarouselFireball = controller.fireballs[num2]; if ((Object)(object)projectileCarouselFireball == (Object)null) { controller.fireballs.RemoveAt(num2); } else { if (!projectileCarouselFireball.launched) { allFireballsLaunched = false; } UpdateFireballPosition(projectileCarouselFireball, prevAngleDeg, projectileCount - 1); } } } if ((((EntityState)this).fixedAge > spinupDuration + fireDuration + recoveryDuration && allFireballsLaunched) || ((EntityState)this).fixedAge > fallbackDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public void LaunchProjectile(ProjectileCarouselFireball fireball) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("Play_mage_m1_shoot", ((Component)fireball).gameObject); fireball.destroyOnWorld = true; fireball.destroyOnEnemy = true; ((Collider)((Component)fireball).GetComponent()).enabled = true; ((Collider)((Component)fireball).GetComponentInChildren()).enabled = true; fireball.shouldNotExplode = false; ((ProjectileExplosion)fireball).fireChildren = leavesDotZone.Value; Rigidbody component = ((Component)fireball).gameObject.GetComponent(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction, ref val2, 1000f, LayerMask.op_Implicit(CommonMasks.bullet))) { Vector3 val3 = ((RaycastHit)(ref val2)).point - ((Component)fireball).gameObject.transform.position; val = ((Vector3)(ref val3)).normalized; } Vector3 val4 = Util.ApplySpread(val, 0f, 5f, 1f, 1f, 0f, 0f); component.velocity = val4 * projectileSpeed; ((Component)fireball).transform.rotation = Util.QuaternionSafeLookRotation(val4); } public void UpdateFireballPosition(ProjectileCarouselFireball fireball, float prevAngleDeg, int maxIndex) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0189: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_01ae: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if (fireball.launched) { return; } float num = 360f / (float)(maxIndex + 1); float num2 = (float)fireball.fireballIndex * num; Vector3 corePosition = ((EntityState)this).characterBody.corePosition; Vector3 aimDirection = ((EntityState)this).inputBank.aimDirection; Vector3 up = ((EntityState)this).characterBody.transform.up; Vector3 right = ((EntityState)this).characterBody.transform.right; float num3 = (prevAngleDeg + num2) * (MathF.PI / 180f); float num4 = (currentAngle + num2) * (MathF.PI / 180f); if ((int)(num4 / (MathF.PI * 2f)) != (int)(num3 / (MathF.PI * 2f)) && readyToLaunch) { projectilesReadied++; if (projectilesReadied > controller.fireballs.Count) { LaunchProjectile(fireball); fireball.launched = true; return; } Util.PlaySound("Play_lunar_wisp_attack2_launch", ((Component)fireball).gameObject); GameObject val = Object.Instantiate(auraEffect, ((Component)fireball).gameObject.transform.position, Quaternion.identity); val.transform.parent = ((Component)fireball).gameObject.transform; val.transform.localScale = Vector3.one * 4f; } Vector3 val2 = (right * Mathf.Sin(num4) + up * Mathf.Cos(num4)) * radius; Vector3 val3 = corePosition + val2; Vector3 val4 = val3 - ((Component)fireball).transform.position; Quaternion rotation = Util.QuaternionSafeLookRotation(val4); ((Component)fireball).gameObject.transform.rotation = rotation; ((Component)fireball).gameObject.transform.position = val3; } 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; } } public class CarouselController : MonoBehaviour { private CharacterBody body; public List fireballs = new List(); public float stopwatch; public void Awake() { body = ((Component)this).GetComponent(); } public void AddFireball(ProjectileCarouselFireball fireball) { fireballs.Add(fireball); fireball.fireballIndex = fireballs.Count - 1; } public void RemoveFireball(ProjectileCarouselFireball fireball) { fireballs.Remove(fireball); } } [RequireComponent(typeof(ProjectileController))] public class ProjectileCarouselFireball : ProjectileExplosion, IProjectileImpactBehavior { public enum TransformSpace { World, Local, Normal } private Vector3 impactNormal = Vector3.up; public GameObject impactEffect; public string lifetimeExpiredSoundString; public NetworkSoundEventDef lifetimeExpiredSound; public float offsetForLifetimeExpiredSound; public bool destroyOnEnemy = true; public bool detonateOnEnemy; public bool destroyOnWorld; public bool destroyOnDistance; public float maxDistance; private float maxDistanceSqr; public bool impactOnWorld = true; public bool timerAfterImpact; public float lifetime; public float lifetimeAfterImpact; private float stopwatch; public uint minimumPhysicsStepsToKeepAliveAfterImpact; private float stopwatchAfterImpact; private bool hasImpact; private bool hasPlayedLifetimeExpiredSound; public TransformSpace transformSpace; private Vector3 startPos; public bool explodeOnLifeTimeExpiration; private CarouselController carouselController; public bool launched = false; public int fireballIndex; public bool shouldNotExplode = true; private bool inert = false; public override void Awake() { ((ProjectileExplosion)this).Awake(); } public void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) startPos = ((Component)this).transform.position; maxDistanceSqr = maxDistance * maxDistance; if ((Object)(object)base.projectileController != (Object)null && (Object)(object)base.projectileController.owner != (Object)null) { carouselController = base.projectileController.owner.GetComponent(); if ((Object)(object)carouselController != (Object)null) { carouselController.AddFireball(this); } } } public void FixedUpdate() { //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) stopwatch += Time.fixedDeltaTime; if (!NetworkServer.active && !base.projectileController.isPrediction) { return; } if ((Object)(object)base.projectileController == (Object)null || ((Object)(object)base.projectileController.owner == (Object)null && !launched)) { IgnoreProjectileDamageAndChildren(); ((ProjectileExplosion)this).Detonate(); return; } if ((Object)(object)base.projectileController.owner != (Object)null && (Object)(object)base.projectileController.owner != (Object)null) { HealthComponent component = base.projectileController.owner.GetComponent(); if ((Object)(object)component == (Object)null || (!component.alive && !launched)) { IgnoreProjectileDamageAndChildren(); ((ProjectileExplosion)this).Detonate(); return; } } if (explodeOnLifeTimeExpiration && base.alive && stopwatch >= lifetime) { base.explosionEffect = impactEffect ?? base.explosionEffect; ((ProjectileExplosion)this).Detonate(); return; } if (timerAfterImpact && hasImpact) { stopwatchAfterImpact += Time.fixedDeltaTime; } bool flag = stopwatch >= lifetime; bool flag2 = timerAfterImpact && stopwatchAfterImpact > lifetimeAfterImpact; bool flag3 = Object.op_Implicit((Object)(object)base.projectileHealthComponent) && !base.projectileHealthComponent.alive; bool flag4 = false; if (destroyOnDistance) { Vector3 val = ((Component)this).transform.position - startPos; if (((Vector3)(ref val)).sqrMagnitude >= maxDistanceSqr) { flag4 = true; } } if (flag || flag2 || flag3 || flag4) { base.alive = false; } if (flag3) { IgnoreProjectileDamageAndChildren(); } if (timerAfterImpact && hasImpact && minimumPhysicsStepsToKeepAliveAfterImpact != 0) { minimumPhysicsStepsToKeepAliveAfterImpact--; base.alive = true; } if (base.alive && !hasPlayedLifetimeExpiredSound) { bool flag5 = stopwatch > lifetime - offsetForLifetimeExpiredSound; if (timerAfterImpact) { flag5 |= stopwatchAfterImpact > lifetimeAfterImpact - offsetForLifetimeExpiredSound; } if (flag5) { hasPlayedLifetimeExpiredSound = true; if (NetworkServer.active && Object.op_Implicit((Object)(object)lifetimeExpiredSound)) { PointSoundManager.EmitSoundServer(lifetimeExpiredSound.index, ((Component)this).transform.position); } } } if (!base.alive) { base.explosionEffect = impactEffect ?? base.explosionEffect; ((ProjectileExplosion)this).Detonate(); } } public void IgnoreProjectileDamageAndChildren() { //IL_0037: 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_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_004e: Unknown result type (might be due to invalid IL or missing references) if (!inert) { inert = true; ProjectileDamage component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { component.damage = 0f; component.damageType = new DamageTypeCombo { damageType = (DamageType)0, damageSource = (DamageSource)2 }; } base.fireChildren = false; } } public override Quaternion GetRandomDirectionForChild() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0054: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) Quaternion randomChildRollPitch = ((ProjectileExplosion)this).GetRandomChildRollPitch(); TransformSpace transformSpace = this.transformSpace; if (1 == 0) { } Quaternion result = (Quaternion)(transformSpace switch { TransformSpace.Local => ((Component)this).transform.rotation * randomChildRollPitch, TransformSpace.Normal => Quaternion.FromToRotation(Vector3.forward, impactNormal) * randomChildRollPitch, _ => randomChildRollPitch, }); if (1 == 0) { } return result; } public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (shouldNotExplode || !base.alive) { return; } Collider collider = impactInfo.collider; impactNormal = impactInfo.estimatedImpactNormal; if (!Object.op_Implicit((Object)(object)collider)) { return; } DamageInfo val = new DamageInfo(); if (Object.op_Implicit((Object)(object)base.projectileDamage)) { val.damage = base.projectileDamage.damage; val.crit = base.projectileDamage.crit; val.attacker = (Object.op_Implicit((Object)(object)base.projectileController.owner) ? base.projectileController.owner.gameObject : null); val.inflictor = ((Component)this).gameObject; val.damageType = base.projectileDamage.damageType; val.inflictor = ((Component)this).gameObject; val.position = impactInfo.estimatedPointOfImpact; val.force = base.projectileDamage.force * ((Component)this).transform.forward; val.procChainMask = base.projectileController.procChainMask; val.procCoefficient = base.projectileController.procCoefficient; val.damageType = base.projectileDamage.damageType; } HurtBox component = ((Component)collider).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (destroyOnEnemy) { HealthComponent healthComponent = component.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { if ((Object)(object)((Component)healthComponent).gameObject == (Object)(object)base.projectileController.owner || (Object.op_Implicit((Object)(object)base.projectileHealthComponent) && (Object)(object)healthComponent == (Object)(object)base.projectileHealthComponent)) { return; } base.alive = false; } } else if (detonateOnEnemy) { HealthComponent healthComponent2 = component.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent2) && (Object)(object)((Component)healthComponent2).gameObject != (Object)(object)base.projectileController.owner && (Object)(object)healthComponent2 != (Object)(object)base.projectileHealthComponent) { ((ProjectileExplosion)this).DetonateNoDestroy(); } } } else if (destroyOnWorld) { base.alive = false; } hasImpact = Object.op_Implicit((Object)(object)component) || impactOnWorld; if (NetworkServer.active && hasImpact) { GlobalEventManager.instance.OnHitAll(val, ((Component)collider).gameObject); } } public override void OnValidate() { if (!Application.IsPlaying((Object)(object)this)) { ((ProjectileExplosion)this).OnValidate(); } } public void OnDestroy() { if ((Object)(object)carouselController != (Object)null) { carouselController.RemoveFireball(this); } } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_GreaterWisp.GreaterWispBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_GreaterWisp.GreaterWispMaster_prefab).WaitForCompletion(); private static GameObject fireballProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_GreaterWisp.WispCannon_prefab).WaitForCompletion(), "carouselFireballProjectile"); private static GameObject fireballGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC2_Scorchling.ScorchlingBombGhost_prefab).WaitForCompletion(), "carouselFireballGhost"); private static GameObject fireballDotZone = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_LunarExploder.LunarExploderProjectileDotZone_prefab).WaitForCompletion(), "greaterWispCarouselDotZone"); private static CharacterSpawnCard cscGreaterWisp = Addressables.LoadAssetAsync((object)RoR2_Base_GreaterWisp.cscGreaterWisp_asset).WaitForCompletion(); private static GameObject auraEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC3_FriendUnit.FriendUnitChargeEffect_prefab).WaitForCompletion(), "fireballChargeEffect"); internal static ConfigEntry cooldown; internal static ConfigEntry healthThreshold; internal static ConfigEntry blastRadius; internal static ConfigEntry damageCoeff; internal static ConfigEntry childDamageCoeff; internal static ConfigEntry projectileHealth; internal static ConfigEntry projectileCount; internal static ConfigEntry onKillChance; internal static ConfigEntry spinupDuration; internal static ConfigEntry igniteOnHit; internal static ConfigEntry projectileSpeed; internal static ConfigEntry leavesDotZone; public override void RegisterConfig() { base.RegisterConfig(); cooldown = BindFloat("Inferno Wheel Cooldown", 20f, "Cooldown of the ability", 10f, 60f, 1f, PluginConfig.FormatType.Time); healthThreshold = BindFloat("Inferno Wheel Health Threshold", 90f, "Health percentage threshold to use the ability", 0f, 100f, 1f, PluginConfig.FormatType.Percentage); blastRadius = BindFloat("Inferno Wheel Explosion Radius", 12f, "Radius of each fireball explosion", 8f, 16f, 0.1f, PluginConfig.FormatType.Distance); damageCoeff = BindFloat("Inferno Wheel Damage Coefficient", 400f, "Damage coefficient of each fireball", 200f, 600f, 5f, PluginConfig.FormatType.Percentage); childDamageCoeff = BindFloat("Inferno Wheel DoT Damage %", 5f, "Damage per tick of the DoT zone as a percentage", 1f, 10f, 1f, PluginConfig.FormatType.Percentage); projectileHealth = BindFloat("Inferno Wheel Projectile Health", 100f, "Base health of each fireball projectile. Gains 30% of this value per level.", 100f, 200f, 10f); projectileCount = BindFloat("Inferno Wheel Projectile Count", 3f, "Number of fireballs in the ring", 1f, 6f, 1f); spinupDuration = BindFloat("Inferno Wheel Spinup Duration", 7f, "Duration of the spinup phase before fireballs launch", 4f, 10f, 0.1f, PluginConfig.FormatType.Time); igniteOnHit = BindBool("Inferno Wheel Ignite on Hit", defaultValue: true, "Whether fireballs ignite targets on hit"); leavesDotZone = BindBool("Inferno Wheel DoT Zone", defaultValue: true, "Whether fireballs leave behind a damage zone on impact"); projectileSpeed = BindFloat("Inferno Wheel Projectile Speed", 60f, "Speed of fireballs when launched", 40f, 100f, 5f, PluginConfig.FormatType.Speed); onKillChance = BindFloat("Inferno Wheel On-Kill Chance", 100f, "Chance for a fireball to trigger on-kill effects", 0f, 100f, 5f, PluginConfig.FormatType.Percentage); BindStats(bodyPrefab, new List(1) { cscGreaterWisp }, new StatOverrides { baseMaxHealth = 900f, directorCost = 175f }); } public override void Initialise() { base.Initialise(); bodyPrefab.AddComponent(); CreateSkill(); CreateProjectilePrefab(); ModifyProjectileGhost(); Utils.AddHealthOverride(delegate(float originalMaxHealth, CharacterBody body) { if ((Object)(object)body == (Object)null || (Object)(object)body.master != (Object)null) { return originalMaxHealth; } ProjectileCarouselFireball component = ((Component)body).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return originalMaxHealth; } float num = projectileHealth.Value * 0.3f; float ambientLevel = Run.instance.ambientLevel; return projectileHealth.Value + num * (ambientLevel - 1f); }); } public void CreateSkill() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00e0: 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) EntityStateMachine val = CreateEntityStateMachine(bodyPrefab, "Carousel"); bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "GreaterWispBodyFireballCarousel", skillName = "GreaterWispFireballCarousel", esmName = val.customName, activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; SkillDef val2 = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, val2, "GreaterWispSpecialFamily", (SkillSlot)3); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSecondary", skillSlot = (SkillSlot)3, requiredSkillDef = val2, requireReady = true, minDistance = 0f, maxDistance = 75f, maxHealthFraction = healthThreshold.Value / 100f, targetType = (TargetType)0, movementType = (MovementType)0, driverUpdateTimerOverride = 2f, aimType = (AimType)2, desiredIndex = 1 }; CreateAISkillDriver(data2); } public void CreateProjectilePrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00eb: 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_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Expected O, but got Unknown //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_074d: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07ad: Expected O, but got Unknown //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Expected O, but got Unknown //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Expected O, but got Unknown //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Expected O, but got Unknown Texture2D val = Addressables.LoadAssetAsync((object)RoR2_Base_Common_ColorRamps.texRampGreaterWisp_png).WaitForCompletion(); Texture2D val2 = Addressables.LoadAssetAsync((object)RoR2_DLC2_FalseSonBoss.texFSBLunarSpikeRamp_png).WaitForCompletion(); Transform[] componentsInChildren = auraEffect.GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val3 in array) { ParticleSystemRenderer component = ((Component)val3).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).material != (Object)null) { Material val4 = new Material(((Renderer)component).material); val4.SetTexture("_RemapTex", (Texture)(object)val); ((Renderer)component).material = val4; } if (((Object)((Component)val3).gameObject).name == "Damage Field") { ParticleSystem component2 = ((Component)val3).gameObject.GetComponent(); MainModule main = component2.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.25f); EmissionModule emission = component2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(25f); } } ProjectileController component3 = fireballProjectile.GetComponent(); component3.ghostPrefab = fireballGhost; Transform component4 = fireballGhost.GetComponent(); component4.localScale = Vector3.one * 3f; ProjectileImpactExplosion component5 = fireballProjectile.GetComponent(); Object.Destroy((Object)(object)component5); ProjectileSimple component6 = fireballProjectile.GetComponent(); component6.desiredForwardSpeed = 0f; component6.lifetime = 99f; ProjectileCarouselFireball projectileCarouselFireball = fireballProjectile.AddComponent(); ((ProjectileExplosion)projectileCarouselFireball).falloffModel = (FalloffModel)2; ((ProjectileExplosion)projectileCarouselFireball).blastRadius = blastRadius.Value; ((ProjectileExplosion)projectileCarouselFireball).blastDamageCoefficient = 1f; ((ProjectileExplosion)projectileCarouselFireball).blastProcCoefficient = 1f; ((ProjectileExplosion)projectileCarouselFireball).blastAttackerFiltering = (AttackerFiltering)0; ((ProjectileExplosion)projectileCarouselFireball).canRejectForce = true; projectileCarouselFireball.impactEffect = Addressables.LoadAssetAsync((object)RoR2_Base_MagmaWorm.MagmaOrbExplosion_prefab).WaitForCompletion(); ((ProjectileExplosion)projectileCarouselFireball).fireChildren = false; ((ProjectileExplosion)projectileCarouselFireball).childrenCount = 1; ((ProjectileExplosion)projectileCarouselFireball).childrenDamageCoefficient = childDamageCoeff.Value / 100f; ((ProjectileExplosion)projectileCarouselFireball).childrenInheritDamageType = false; ((ProjectileExplosion)projectileCarouselFireball).childrenProjectilePrefab = fireballDotZone; ((ProjectileExplosion)projectileCarouselFireball).useChildRotation = true; projectileCarouselFireball.shouldNotExplode = true; projectileCarouselFireball.lifetime = 99f; projectileCarouselFireball.explodeOnLifeTimeExpiration = false; Transform[] componentsInChildren2 = fireballGhost.GetComponentsInChildren(); Transform[] array2 = componentsInChildren2; foreach (Transform val5 in array2) { if (((Object)((Component)val5).gameObject).name == "MagmaMeatball_Geo") { MeshRenderer component7 = ((Component)val5).gameObject.GetComponent(); if ((Object)(object)component7 != (Object)null) { Material val6 = new Material(((Renderer)component7).material); val6.SetTexture("_RemapTex", (Texture)(object)val); val6.SetColor("_TintColor", new Color(0.4f, 1f, 0.1f, 1f)); ((Renderer)component7).material = val6; } } if (((Object)((Component)val5).gameObject).name == "Point Light") { Light component8 = ((Component)val5).gameObject.GetComponent(); if ((Object)(object)component8 != (Object)null) { component8.color = new Color(0.4f, 1f, 0.1f, 1f); component8.intensity = 3.5f; component8.range = 7f; } } if (((Object)((Component)val5).gameObject).name == "Trail") { TrailRenderer component9 = ((Component)val5).gameObject.GetComponent(); if ((Object)(object)component9 != (Object)null) { Material val7 = new Material(((Renderer)component9).material); val7.SetTexture("_RemapTex", (Texture)(object)val); val7.SetColor("_TintColor", new Color(0.4f, 1f, 0.1f, 1f)); ((Renderer)component9).material = val7; } } } Transform[] componentsInChildren3 = fireballDotZone.GetComponentsInChildren(); for (int num = componentsInChildren3.Length - 1; num >= 0; num--) { Transform val8 = componentsInChildren3[num]; if (((Object)((Component)val8).gameObject).name == "Decal") { Decal component10 = ((Component)val8).gameObject.GetComponent(); if ((Object)(object)component10 != (Object)null) { Material val9 = new Material(Addressables.LoadAssetAsync((object)RoR2_DLC2_Chef.matChefOilPoolFireDecal_mat).WaitForCompletion()); val9.SetTexture("_RemapTex", (Texture)(object)val); component10.Material = val9; } } if (((Object)((Component)val8).gameObject).name == "Point Light") { Light component11 = ((Component)val8).gameObject.GetComponent(); if ((Object)(object)component11 != (Object)null) { component11.color = new Color(0.4f, 1f, 0.1f, 1f); } } if (((Object)((Component)val8).gameObject).name == "Spores") { Object.DestroyImmediate((Object)(object)((Component)val8).gameObject); } else { if (((Object)((Component)val8).gameObject).name == "Fire, Billboard") { ParticleSystemRenderer component12 = ((Component)val8).gameObject.GetComponent(); if ((Object)(object)component12 != (Object)null) { Material val10 = new Material(Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.matGenericFire_mat).WaitForCompletion()); val10.SetTexture("_RemapTex", (Texture)(object)val); ((Renderer)component12).material = val10; ((Renderer)component12).sharedMaterial = val10; } } if (((Object)((Component)val8).gameObject).name == "Fire, Stretched") { ParticleSystemRenderer component13 = ((Component)val8).gameObject.GetComponent(); if ((Object)(object)component13 != (Object)null) { Material val11 = new Material(Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.matFireStaticLarge_mat).WaitForCompletion()); val11.SetTexture("_RemapTex", (Texture)(object)val); ((Renderer)component13).material = val11; ((Renderer)component13).sharedMaterial = val11; } } } } Rigidbody component14 = fireballProjectile.GetComponent(); component14.mass = 9999f; GameObject val12 = new GameObject(); val12.transform.SetParent(fireballProjectile.transform); Transform transform = val12.transform; ModelLocator val13 = fireballProjectile.AddComponent(); val13.modelTransform = transform; val13.autoUpdateModelTransform = true; val13.dontDetatchFromParent = true; val13.noCorpse = true; val13.dontReleaseModelOnDeath = false; val13.normalizeToFloor = false; val13.normalSmoothdampTime = 0.1f; val13.normalMaxAngleDelta = 90f; TeamComponent val14 = fireballProjectile.AddComponent(); val14.hideAllyCardDisplay = true; val14.teamIndex = (TeamIndex)0; LanguageAPI.Add("SKELETOGNE_GWISPFIREBALL_BODY_NAME", "Inferno Wheel Fireball"); CharacterBody val15 = fireballProjectile.AddComponent(); val15.baseVisionDistance = float.PositiveInfinity; val15.sprintingSpeedMultiplier = 1.45f; val15.hullClassification = (HullClassification)0; val15.baseMaxHealth = projectileHealth.Value; val15.levelMaxHealth = projectileHealth.Value * 0.3f; val15.SetSpreadBloom(0f, true); val15.bodyFlags = (BodyFlags)(val15.bodyFlags | 0x80000); val15.baseNameToken = "SKELETOGNE_GWISPFIREBALL_BODY_NAME"; HealthComponent val16 = fireballProjectile.AddComponent(); val16.body = val15; val16.dontShowHealthbar = false; val16.globalDeathEventChanceCoefficient = onKillChance.Value / 100f; ((ProjectileExplosion)projectileCarouselFireball).projectileHealthComponent = val16; GameObject val17 = new GameObject(); val17.transform.SetParent(val13.modelTransform); SphereCollider val18 = val17.AddComponent(); ((Collider)val18).isTrigger = true; ((Collider)val18).contactOffset = 0.01f; val18.radius = 3f; ((Collider)val18).sharedMaterial = Addressables.LoadAssetAsync((object)RoR2_Base_Common.physmatSuperFriction_physicMaterial).WaitForCompletion(); ((Collider)val18).material = ((Collider)val18).sharedMaterial; HurtBox val19 = val17.gameObject.AddComponent(); if ((Object)(object)val19 == (Object)null) { Log.Error("hurtBox is null!"); } if ((Object)(object)((Component)val19).gameObject == (Object)null) { Log.Error("hurtBox.gameObject is null!"); } ((Component)val19).gameObject.layer = LayerIndex.entityPrecise.intVal; val19.healthComponent = val16; val19.isBullseye = true; val19.isSniperTarget = false; val19.damageModifier = (DamageModifier)0; val19.collider = (Collider)(object)val18; val19.hurtBoxGroup = ((Component)val13.modelTransform).gameObject.AddComponent(); val19.hurtBoxGroup.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val19 }; val19.hurtBoxGroup.mainHurtBox = val19; val19.hurtBoxGroup.bullseyeCount = 1; val15.hurtBoxGroup = val19.hurtBoxGroup; DisableCollisionsBetweenColliders val20 = fireballProjectile.AddComponent(); val20.collidersA = (Collider[])(object)new Collider[1] { (Collider)fireballProjectile.GetComponent() }; val20.collidersB = (Collider[])(object)new Collider[1] { (Collider)val18 }; AssignTeamFilterToTeamComponent val21 = fireballProjectile.AddComponent(); } public void ModifyProjectileGhost() { //IL_0063: 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_007e: 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_009b: Expected O, but got Unknown //IL_00a7: 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_00c9: 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_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) //IL_0149: 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) Transform[] componentsInChildren = fireballGhost.GetComponentsInChildren(); Transform val = componentsInChildren.Where((Transform t) => ((Object)((Component)t).gameObject).name == "MagmaMeatball_Geo").FirstOrDefault(); Transform val2 = componentsInChildren.Where((Transform t) => ((Object)((Component)t).gameObject).name == "Point Light").FirstOrDefault(); val2.localScale = Vector3.one; ((Component)val).transform.localScale = Vector3.one * 0.5f; ObjectScaleCurve component = fireballGhost.GetComponent(); AnimationCurve val3 = new AnimationCurve(); Keyframe[] array = new Keyframe[2]; Keyframe val4 = default(Keyframe); ((Keyframe)(ref val4)).time = 0f; ((Keyframe)(ref val4)).value = 0.1f; array[0] = val4; val4 = default(Keyframe); ((Keyframe)(ref val4)).time = 1f; ((Keyframe)(ref val4)).value = 1f; array[1] = val4; val3.keys = (Keyframe[])(object)array; component.curveZ = (component.curveY = (component.curveX = val3)); component.timeMax = 1f; if ((Object)(object)val != (Object)null) { GameObject gameObject = ((Component)val).gameObject; MeshFilter component2 = ((Component)val).GetComponent(); Mesh sharedMesh = (component2.mesh = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.mdlVFXIcosphere_fbx).WaitForCompletion().GetComponent() .mesh); component2.sharedMesh = sharedMesh; } } } } namespace EnemyAbilities.Abilities.Gravekeeper { [EnemyAbilities.ModuleInfo("Mass Resurrect", "Gives Grovetenders a new Special Ability:\n- Mass Resurrect: Grovetenders passively collect Gravestones from nearby fallen enemies. When used, Grovetenders fire the Gravestones at the player, which detonate after a short delay, spawning a ghostly version of the enemy killed. Ghosts provide armour to their Grovetender, and slowly decay over time.", "Grovetender", true)] public class MassResurrectModule : BaseModule { public class ResurrectSkillDef : SkillDef { public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot) { return ((SkillDef)this).OnAssigned(skillSlot); } public override bool IsReady([NotNull] GenericSkill skillSlot) { return ((SkillDef)this).IsReady(skillSlot); } } public class MassResurrect : BaseSkillState { public static float baseDuration = 5f; private float duration; private static float basePrepDuration = 1f; private float prepDuration = 1f; private static float baseFireDuration = 3f; private float fireDuration; private GravekeeperResurrectController resurrectController; private int gravestoneCount; private int currentCount; private float nextFireTime = 0f; private float fireInterval; private static float baseRecoveryDuration = 1f; private float recoveryDuration; private bool firing; public override void OnEnter() { //IL_00b0: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration; resurrectController = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); resurrectController.gravestoneMode = GravekeeperResurrectController.GravestoneMode.Firing; resurrectController.prepStopwatch = 0f; prepDuration = basePrepDuration / ((BaseState)this).attackSpeedStat; fireDuration = baseFireDuration / ((BaseState)this).attackSpeedStat; recoveryDuration = baseRecoveryDuration / ((BaseState)this).attackSpeedStat; int count = resurrectController.gravestoneList.Count; if (count <= 1) { for (int i = 0; i < 2 - count; i++) { GameObject val = Object.Instantiate(gravestonePrefab, ((EntityState)this).characterBody.transform.position + new Vector3(0f, 8f, 0f), Quaternion.identity); FloatingGravestoneController component = val.GetComponent(); component.boundResurrectController = resurrectController; component.bodyIndex = BodyCatalog.FindBodyIndexCaseInsensitive("GreaterWispBody"); resurrectController.gravestoneList.Add(component); } } foreach (FloatingGravestoneController gravestone in resurrectController.gravestoneList) { resurrectController.queuedBodyIndices.Add(gravestone.bodyIndex); } } public override void OnExit() { ((EntityState)this).OnExit(); List gravestoneList = resurrectController.gravestoneList; for (int num = gravestoneList.Count - 1; num >= 0; num--) { EntityState.Destroy((Object)(object)((Component)gravestoneList[num]).gameObject); } resurrectController.gravestoneMode = GravekeeperResurrectController.GravestoneMode.Floating; resurrectController.prepStopwatch = 0f; resurrectController.queuedBodyIndices.Clear(); } public override void FixedUpdate() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > prepDuration && !firing) { firing = true; gravestoneCount = resurrectController.gravestoneList.Count; fireInterval = fireDuration / (float)gravestoneCount; currentCount = 0; } if (firing && ((EntityState)this).fixedAge > nextFireTime + prepDuration && currentCount < gravestoneCount) { FloatingGravestoneController floatingGravestoneController = resurrectController.gravestoneList[currentCount]; Vector3 position = ((Component)floatingGravestoneController).gameObject.transform.position; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).GetPoint(50f); if ((Object)(object)resurrectController != (Object)null && (Object)(object)resurrectController.ai != (Object)null && resurrectController.ai.currentEnemy != null && (Object)(object)resurrectController.ai.currentEnemy.characterBody != (Object)null) { val = resurrectController.ai.currentEnemy.characterBody.transform.position; } Vector3 val2 = val - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; Quaternion rotation = Util.QuaternionSafeLookRotation(normalized + Random.insideUnitSphere * 0.05f); DamageTypeCombo val3 = default(DamageTypeCombo); val3.damageSource = (DamageSource)8; val3.damageType = (DamageType)0; DamageTypeCombo val4 = val3; FireProjectileInfo val5 = default(FireProjectileInfo); val5.projectilePrefab = gravestoneProjectile; val5.crit = ((BaseState)this).RollCrit(); val5.damage = gravestoneDamageCoeff.Value / 100f * ((BaseState)this).damageStat; val5.damageColorIndex = (DamageColorIndex)0; val5.damageTypeOverride = DamageTypeCombo.GenericSpecial; val5.force = 1500f; val5.maxDistance = 125f; val5.owner = ((Component)((EntityState)this).characterBody).gameObject; val5.rotation = rotation; ((FireProjectileInfo)(ref val5)).speedOverride = 120f; val5.useSpeedOverride = true; val5.position = position; FireProjectileInfo val6 = val5; Util.PlaySound("Play_bellBody_attackShoot", ((Component)floatingGravestoneController).gameObject); EffectManager.SpawnEffect(muzzleFlashWinch, new EffectData { rotation = rotation, origin = position, scale = 1f }, true); if (((EntityState)this).isAuthority) { ProjectileManager.instance.FireProjectile(val6); } ((Renderer)((Component)resurrectController.gravestoneList[currentCount]).gameObject.GetComponentInChildren()).enabled = false; nextFireTime += fireInterval; currentCount++; } if (((EntityState)this).fixedAge > prepDuration + fireDuration + recoveryDuration && currentCount == gravestoneCount) { ((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; } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__27_2; public static Func <>9__27_1; public static Manipulator <>9__27_0; public static Func <>9__29_2; public static Func <>9__29_3; public static Func <>9__29_4; public static Func <>9__29_1; public static Manipulator <>9__29_0; public static Func <>9__36_0; internal void b__27_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "sharedMaterialArrays") })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_0); val.EmitDelegate>((Func)delegate(CharacterModel model, Material material) { if ((Object)(object)model != (Object)null && (Object)(object)((Component)model).gameObject.GetComponent() != (Object)null) { material = ghostMaterialClone; } return material; }); val.Emit(OpCodes.Stloc_0); } else { Log.Error("UpdateRendererMaterial ILCursor c1 failed to match!"); } } internal bool b__27_2(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "sharedMaterialArrays"); } internal Material b__27_1(CharacterModel model, Material material) { if ((Object)(object)model != (Object)null && (Object)(object)((Component)model).gameObject.GetComponent() != (Object)null) { material = ghostMaterialClone; } return material; } internal void b__29_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "LunarShell"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "HasBuff"), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "") })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool originalValue, CharacterBody body) => ((Object)(object)body != (Object)null && body.HasBuff(GravekeeperArmorBuff)) || originalValue)); } else { Log.Error("CharacterBody.UpdateAllTemporaryVisualEffects cursor c1 failed to match! Grovetender armor buff VFX affected."); } } internal bool b__29_2(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "LunarShell"); } internal bool b__29_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "HasBuff"); } internal bool b__29_4(Instruction x) { return ILPatternMatchingExt.MatchLdstr(x, ""); } internal bool b__29_1(bool originalValue, CharacterBody body) { if ((Object)(object)body != (Object)null && body.HasBuff(GravekeeperArmorBuff)) { return true; } return originalValue; } internal bool b__36_0(EntityStateMachine esm) { return esm.customName == "Weapon"; } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Gravekeeper.GravekeeperBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Gravekeeper.GravekeeperMaster_prefab).WaitForCompletion(); public static GameObject gravestonePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_wispgraveyard.WPObeliskSmall_prefab).WaitForCompletion(), "gravestonePrefab"); public static GameObject gravestoneProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBarrelProjectile_prefab).WaitForCompletion(), "gravestoneProjectilePrefab"); public static GameObject gravestoneProjectileGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBarrelGhost_prefab).WaitForCompletion(), "gravestoneProjectileGhostPrefab"); public static GameObject gravestoneModel = Addressables.LoadAssetAsync((object)RoR2_Base_Common_Props.mdlIcoRockM_fbx).WaitForCompletion(); public static Material gravestoneMaterial = Addressables.LoadAssetAsync((object)RoR2_Base_wispgraveyard.matTempleObelisk_mat).WaitForCompletion(); public static Material chainMaterial = Addressables.LoadAssetAsync((object)RoR2_Base_Gravekeeper.matGravekeeperHookChain_mat).WaitForCompletion(); public static GameObject tetherPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_moon2.BloodSiphonTetherVFX_prefab).WaitForCompletion(), "grovetenderChainTetherPrefab"); public static GameObject muzzleFlashWinch = Addressables.LoadAssetAsync((object)RoR2_Base_Gravekeeper.MuzzleflashWinch_prefab).WaitForCompletion(); private static CharacterSpawnCard cscGravekeeper = Addressables.LoadAssetAsync((object)RoR2_Base_Gravekeeper.cscGravekeeper_asset).WaitForCompletion(); private static Material defaultGhostMaterial = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.matGhostEffect_mat).WaitForCompletion(); private static Texture2D gravekeeperGhostColourRamp = Addressables.LoadAssetAsync((object)RoR2_DLC3.texRampLightningRed_png).WaitForCompletion(); private static Material ghostMaterialClone; public static ItemDef GravekeeperGhostItem; public static BuffDef GravekeeperArmorBuff; internal static ConfigEntry wispsOnly; internal static ConfigEntry maxGhosts; internal static ConfigEntry maxGravestones; internal static ConfigEntry cooldown; internal static ConfigEntry gravestoneFuse; internal static ConfigEntry gravestoneRadius; internal static ConfigEntry gravestoneDamageCoeff; internal static ConfigEntry ghostLifetime; internal static ConfigEntry healthThreshold; internal static ConfigEntry armorPerGhost; public override void RegisterConfig() { base.RegisterConfig(); wispsOnly = BindBool("Resurrect Spawns Wisps Only", defaultValue: false, "Enemies killed are resurrected as wisps when the Gravestones shatter."); ghostLifetime = BindFloat("Resurrect Ghost Lifetime", 30f, "The duration over which resurrected ghosts will decay from full health to zero.", 10f, 120f, 1f, PluginConfig.FormatType.Time); gravestoneDamageCoeff = BindFloat("Resurrect Gravestone Damage", 200f, "The damage coefficient of the Gravestone explosion.", 100f, 400f, 5f, PluginConfig.FormatType.Percentage); gravestoneFuse = BindFloat("Resurrect Gravestone Fuse Duration", 1.25f, "The time between a gravestone embedding and exploding.", 0.5f, 3f, 0.01f, PluginConfig.FormatType.Time); gravestoneRadius = BindFloat("Resurrect Gravestone Explosion Radius", 9f, "The radius of the gravestone explosion", 5f, 16f, 0.1f, PluginConfig.FormatType.Distance); healthThreshold = BindFloat("Resurrect Health Threshold", 50f, "The health threshold that the Grovetender must be under to use Mass Resurrect", 25f, 100f, 1f, PluginConfig.FormatType.Percentage); maxGhosts = BindFloat("Resurrect Max Ghosts", 8f, "The maximum amount of ghosts a Grovetender can have active at once. Gravestones beyond this limit will fire and explode, but not spawn new enemies.", 2f, 20f, 1f); maxGravestones = BindFloat("Resurrect Max Gravestones", 8f, "The maximum amount of gravestones a Grovetender can have active at once. Enemies that die beyond this limit will not create gravestones.", 2f, 20f, 1f); cooldown = BindFloat("Resurrect Cooldown", 60f, "The cooldown of Mass Resurrect", 30f, 120f, 0.1f, PluginConfig.FormatType.Time); armorPerGhost = BindFloat("Resurrect Armor Per Ghost", 30f, "The amount of armour that the Grovetender gains per active ghost.", 5f, 100f, 1f); BindStats(bodyPrefab, new List(1) { cscGravekeeper }); } public override void Initialise() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown base.Initialise(); CreateSkill(); CreateGhostItem(); CreateGravekeeperBuff(); SetUpTetherPrefab(); SetUpProjectile(); GlobalEventManager.onCharacterDeathGlobal += CheckToSpawnGravestone; bodyPrefab.AddComponent(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GrantArmorStats); ghostMaterialClone = new Material(defaultGhostMaterial); ghostMaterialClone.SetTexture("_RemapTex", (Texture)(object)gravekeeperGhostColourRamp); ghostMaterialClone.SetColor("_TintColor", new Color(1f, 0f, 0f, 1f)); object obj = <>c.<>9__27_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "sharedMaterialArrays") })) { val2.Emit(OpCodes.Ldarg_0); val2.Emit(OpCodes.Ldloc_0); val2.EmitDelegate>((Func)delegate(CharacterModel model, Material material) { if ((Object)(object)model != (Object)null && (Object)(object)((Component)model).gameObject.GetComponent() != (Object)null) { material = ghostMaterialClone; } return material; }); val2.Emit(OpCodes.Stloc_0); } else { Log.Error("UpdateRendererMaterial ILCursor c1 failed to match!"); } }; <>c.<>9__27_0 = val; obj = (object)val; } CharacterModel.UpdateRendererMaterials += (Manipulator)obj; } private void GrantArmorStats(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(GravekeeperArmorBuff)) { int buffCount = sender.GetBuffCount(GravekeeperArmorBuff); if (buffCount > 0) { args.armorAdd += armorPerGhost.Value * (float)buffCount; } } } private void CreateGravekeeperBuff() { //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_0070: Expected O, but got Unknown Texture2D texture = EnemyAbilities.Instance.assetBundle.LoadAsset("texGrovetenderShieldIcon"); GravekeeperArmorBuff = ScriptableObject.CreateInstance(); GravekeeperArmorBuff.canStack = true; GravekeeperArmorBuff.isHidden = false; GravekeeperArmorBuff.iconSprite = Utils.CreateSprite(texture); ContentAddition.AddBuffDef(GravekeeperArmorBuff); object obj = <>c.<>9__29_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "LunarShell"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "HasBuff"), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "") })) { val2.Index += 2; val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)((bool originalValue, CharacterBody body) => ((Object)(object)body != (Object)null && body.HasBuff(GravekeeperArmorBuff)) || originalValue)); } else { Log.Error("CharacterBody.UpdateAllTemporaryVisualEffects cursor c1 failed to match! Grovetender armor buff VFX affected."); } }; <>c.<>9__29_0 = val; obj = (object)val; } CharacterBody.UpdateAllTemporaryVisualEffects += (Manipulator)obj; } private void SetUpTetherPrefab() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) LineRenderer component = tetherPrefab.GetComponent(); Material val = new Material(chainMaterial); val.mainTextureScale = Vector2.one; ((Renderer)component).sharedMaterial = val; } private void CreateGhostItem() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) GravekeeperGhostItem = ScriptableObject.CreateInstance(); ((Object)GravekeeperGhostItem).name = "GravekeeperGhostItem"; GravekeeperGhostItem.tier = (ItemTier)5; GravekeeperGhostItem.deprecatedTier = (ItemTier)5; GravekeeperGhostItem.nameToken = "ITEM_SKELETOGNE_ENEMYGHOST_NAME"; GravekeeperGhostItem.pickupToken = "ITEM_SKELETOGNE_ENEMYGHOST_PICKUP"; GravekeeperGhostItem.descriptionToken = "ITEM_SKELETOGNE_ENEMYGHOST_DESC"; GravekeeperGhostItem.loreToken = "ITEM_SKELETOGNE_ENEMYGHOST_LORE"; GravekeeperGhostItem.pickupIconSprite = null; GravekeeperGhostItem.hidden = true; ContentAddition.AddItemDef(GravekeeperGhostItem); } private void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_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) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "GravekeeperBodyMassResurrect", skillName = "GravekeeperMassResurrect", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; ResurrectSkillDef resurrectSkillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, (SkillDef)(object)resurrectSkillDef, "GravekeeperSpecialFamily", (SkillSlot)3); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSpecial", skillSlot = (SkillSlot)3, requiredSkillDef = (SkillDef)(object)resurrectSkillDef, requireReady = true, minDistance = 0f, maxDistance = 85f, maxHealthFraction = healthThreshold.Value / 100f, targetType = (TargetType)0, movementType = (MovementType)1, aimType = (AimType)1, driverUpdateTimerOverride = 3f, desiredIndex = 0 }; CreateAISkillDriver(data2); } private void SetUpProjectile() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) gravestonePrefab.AddComponent(); Transform component = gravestonePrefab.GetComponent(); component.localScale = Vector3.one; Transform[] componentsInChildren = gravestonePrefab.GetComponentsInChildren(); for (int num = componentsInChildren.Length - 1; num >= 0; num--) { if (((Object)((Component)componentsInChildren[num]).gameObject).name == "FSRuinRingCollision" || ((Object)componentsInChildren[num]).name == "DirtMesh") { Object.DestroyImmediate((Object)(object)((Component)componentsInChildren[num]).gameObject); } } MeshCollider[] componentsInChildren2 = gravestonePrefab.GetComponentsInChildren(); for (int num2 = componentsInChildren2.Length - 1; num2 >= 0; num2--) { Object.DestroyImmediate((Object)(object)componentsInChildren2[num2]); } ParticleSystem[] componentsInChildren3 = gravestoneProjectileGhost.GetComponentsInChildren(); for (int num3 = componentsInChildren3.Length - 1; num3 >= 0; num3--) { Object.DestroyImmediate((Object)(object)componentsInChildren3[num3]); } ParticleSystemRenderer[] componentsInChildren4 = gravestoneProjectileGhost.GetComponentsInChildren(); for (int num4 = componentsInChildren4.Length - 1; num4 >= 0; num4--) { Object.DestroyImmediate((Object)(object)componentsInChildren4[num4]); } RotateAroundAxis componentInChildren = gravestoneProjectileGhost.GetComponentInChildren(); Object.DestroyImmediate((Object)(object)componentInChildren); MeshFilter component2 = gravestoneModel.GetComponent(); MeshFilter componentInChildren2 = gravestoneProjectileGhost.GetComponentInChildren(); componentInChildren2.sharedMesh = component2.sharedMesh; componentInChildren2.mesh = component2.mesh; MeshRenderer componentInChildren3 = gravestoneProjectileGhost.GetComponentInChildren(); ((Renderer)componentInChildren3).material = gravestoneMaterial; ((Renderer)componentInChildren3).sharedMaterial = gravestoneMaterial; Transform component3 = ((Component)componentInChildren2).gameObject.GetComponent(); component3.localScale = new Vector3(0.85f, 0.41f, 0.37f); component3.localRotation = Quaternion.Euler(0f, 90f, 0f); ApplyTorqueOnStart component4 = gravestoneProjectile.GetComponent(); Object.DestroyImmediate((Object)(object)component4); ProjectileController component5 = gravestoneProjectile.GetComponent(); component5.ghostPrefab = gravestoneProjectileGhost; ProjectileImpactExplosion component6 = gravestoneProjectile.GetComponent(); ((Component)component6).gameObject.layer = LayerIndex.projectileWorldOnly.intVal; component6.lifetime = 10f; component6.destroyOnDistance = true; component6.destroyOnWorld = false; component6.destroyOnEnemy = false; component6.impactOnWorld = true; component6.timerAfterImpact = true; component6.lifetimeAfterImpact = gravestoneFuse.Value; component6.impactEffect = Addressables.LoadAssetAsync((object)RoR2_Base_LemurianBruiser.OmniExplosionVFXLemurianBruiserFireballImpact_prefab).WaitForCompletion(); ((ProjectileExplosion)component6).blastRadius = gravestoneRadius.Value; component6.maxDistance = 125f; ProjectileSimple component7 = gravestoneProjectile.GetComponent(); component7.lifetime = 10f; Rigidbody component8 = gravestoneProjectile.GetComponent(); component8.useGravity = true; ProjectileStickOnImpact val = gravestoneProjectile.AddComponent(); val.alignNormals = true; val.ignoreCharacters = true; val.ignoreSteepSlopes = false; val.ignoreWorld = false; ProjectileDamage component9 = gravestoneProjectile.GetComponent(); component9.damageType = DamageTypeCombo.Generic; gravestoneProjectile.AddComponent(); } private void CheckToSpawnGravestone(DamageReport damageReport) { //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) if (damageReport == null) { return; } CharacterBody victimBody = damageReport.victimBody; if ((Object)(object)victimBody == (Object)null || (Object)(object)victimBody.master == (Object)null || victimBody.isChampion || victimBody.isPlayerControlled) { return; } List instancesList = InstanceTracker.GetInstancesList(); if (instancesList.Count == 0) { return; } GravekeeperResurrectController gravekeeperResurrectController = null; float num = float.PositiveInfinity; foreach (GravekeeperResurrectController item in instancesList) { if ((Object)(object)item == (Object)null || (Object)(object)item.body == (Object)null || item.gravestoneList.Count >= (int)maxGravestones.Value) { continue; } CharacterBody body = item.body; if ((Object)(object)victimBody.transform == (Object)null || (Object)(object)body.transform == (Object)null || (Object)(object)victimBody.inventory == (Object)null || victimBody.inventory.GetItemCountPermanent(GravekeeperGhostItem) > 0) { continue; } float num2 = Vector3.Distance(body.transform.position, victimBody.transform.position); if (num2 > 100f || (Object)(object)body.teamComponent == (Object)null || (Object)(object)victimBody.teamComponent == (Object)null || body.teamComponent.teamIndex != victimBody.teamComponent.teamIndex) { continue; } EntityStateMachine val = (from esm in ((Component)body).GetComponents() where esm.customName == "Weapon" select esm).FirstOrDefault(); if (!((Object)(object)val == (Object)null) && !(val.state is MassResurrect)) { SkillLocator skillLocator = body.skillLocator; if (!((Object)(object)skillLocator == (Object)null) && !((Object)(object)skillLocator.special == (Object)null) && !(skillLocator.special.cooldownRemaining > skillLocator.special.rechargeStopwatch) && num2 < num) { gravekeeperResurrectController = item; num = num2; } } } if (!((Object)(object)gravekeeperResurrectController == (Object)null)) { gravekeeperResurrectController.TrySpawnGravestone(victimBody); } } } public class GravekeeperResurrectController : MonoBehaviour { public enum GravestoneMode { None, Floating, Firing } public CharacterBody body; public BaseAI ai; public List gravestoneList = new List(); public float prepStopwatch; public List queuedBodyIndices = new List(); public List boundGhosts = new List(); public TetherVfxOrigin tetherVfxOrigin; public GravestoneMode gravestoneMode; public void Awake() { body = ((Component)this).GetComponent(); gravestoneMode = GravestoneMode.Floating; tetherVfxOrigin = ((Component)body.healthComponent).gameObject.AddComponent(); tetherVfxOrigin.transform = body.transform; tetherVfxOrigin.tetherPrefab = MassResurrectModule.tetherPrefab; } public void Start() { if (!((Object)(object)body == (Object)null) && !((Object)(object)body.master == (Object)null)) { ai = ((Component)body.master).gameObject.GetComponent(); if (!((Object)(object)ai == (Object)null)) { } } } public void OnEnable() { InstanceTracker.Add(this); } public void OnDisable() { InstanceTracker.Remove(this); } public void TrySpawnGravestone(CharacterBody victimBody) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(MassResurrectModule.gravestonePrefab, victimBody.corePosition, Quaternion.identity); FloatingGravestoneController component = val.GetComponent(); component.boundResurrectController = this; BodyIndex bodyIndex = victimBody.bodyIndex; if (MassResurrectModule.wispsOnly.Value) { HullClassification hullClassification = victimBody.hullClassification; bodyIndex = (((int)hullClassification != 1 && (int)hullClassification != 2) ? BodyCatalog.FindBodyIndexCaseInsensitive("WispBody") : BodyCatalog.FindBodyIndexCaseInsensitive("GreaterWispBody")); } component.bodyIndex = bodyIndex; gravestoneList.Add(component); } public void FixedUpdate() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) UpdateTethers(); if ((Object)(object)body == (Object)null || (Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive) { if (boundGhosts.Count <= 0) { return; } for (int num = boundGhosts.Count - 1; num >= 0; num--) { CharacterBody val = boundGhosts[num]; if ((Object)(object)val != (Object)null && (Object)(object)val.healthComponent != (Object)null) { val.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } return; } if (gravestoneMode == GravestoneMode.Floating) { for (int i = 0; i < gravestoneList.Count; i++) { gravestoneList[i].UpdatePositionFloating(); } } if (gravestoneMode == GravestoneMode.Firing) { prepStopwatch += Time.fixedDeltaTime; for (int j = 0; j < gravestoneList.Count; j++) { gravestoneList[j].UpdatePositionPreparingOrFiring(j, gravestoneList.Count, prepStopwatch); } } } public void UpdateTethers() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int num = boundGhosts.Count - 1; num >= 0; num--) { CharacterBody val = boundGhosts[num]; if ((Object)(object)val == (Object)null || (Object)(object)val.healthComponent == (Object)null || !val.healthComponent.alive) { boundGhosts.RemoveAt(num); } else if (Vector3.Distance(body.transform.position, val.transform.position) < 150f) { list.Add(val.transform); } } tetherVfxOrigin.SetTetheredTransforms(list); body.SetBuffCount(MassResurrectModule.GravekeeperArmorBuff.buffIndex, list.Count); } } public class FloatingGravestoneController : MonoBehaviour { public BodyIndex bodyIndex; public GravekeeperResurrectController boundResurrectController; public float stopwatch; private float initialRotation; private float radius; private float height; private float rotationSpeed; public void Awake() { initialRotation = Random.Range(0f, MathF.PI * 2f); radius = Random.Range(8f, 16f); height = Random.Range(8f, 16f); rotationSpeed = Random.Range(MathF.PI / 6f, MathF.PI / 3f); rotationSpeed *= 2 * Random.RandomRangeInt(0, 2) - 1; } public void OnDestroy() { if ((Object)(object)boundResurrectController != (Object)null) { boundResurrectController.gravestoneList.Remove(this); } } public void FixedUpdate() { stopwatch += Time.fixedDeltaTime; if ((Object)(object)boundResurrectController == (Object)null || (Object)(object)boundResurrectController.body == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else if ((Object)(object)boundResurrectController.body.healthComponent == (Object)null || !boundResurrectController.body.healthComponent.alive) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void UpdatePositionFloating() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) Vector3 position = boundResurrectController.body.transform.position; float num = Mathf.Cos(initialRotation + stopwatch * rotationSpeed) * radius; float num2 = Mathf.Sin(initialRotation + stopwatch * rotationSpeed) * radius; float num3 = height; Vector3 val = position + new Vector3(num, num3, num2); Vector3 position2 = ((Component)this).gameObject.transform.position; Vector3 position3 = Vector3.Lerp(position2, val, Mathf.Min(stopwatch * 0.05f * boundResurrectController.body.attackSpeed, 0.5f)); ((Component)this).gameObject.transform.position = position3; } public void UpdatePositionPreparingOrFiring(int index, int total, float prepStopwatch) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = boundResurrectController.body; Vector3 val = Vector3.Cross(Vector3.up, body.inputBank.aimDirection); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = body.transform.position + new Vector3(0f, 6f, 0f); float num = 12f; float num2 = MathF.PI / (float)(total + 1); float num3 = -MathF.PI / 2f; float num4 = num3 + num2 * (float)(index + 1); Vector3 val3 = normalized * Mathf.Sin(num4); Vector3 val4 = Vector3.up * Mathf.Cos(num4); Vector3 position = ((Component)this).gameObject.transform.position; Vector3 val5 = val2 + val3 * num + val4 * num; ((Component)this).gameObject.transform.position = Vector3.Lerp(position, val5, Mathf.Min(prepStopwatch * 0.25f * body.attackSpeed, 0.5f)); if ((Object)(object)boundResurrectController.ai != (Object)null && boundResurrectController.ai.currentEnemy != null && (Object)(object)boundResurrectController.ai.currentEnemy.characterBody != (Object)null) { CharacterBody characterBody = boundResurrectController.ai.currentEnemy.characterBody; Vector3 position2 = characterBody.transform.position; val = position2 - ((Component)this).gameObject.transform.position; Vector3 normalized2 = ((Vector3)(ref val)).normalized; ((Component)this).gameObject.transform.up = normalized2; } } } public class GravekeeperGhostModelComponent : MonoBehaviour { } public class ProjectileGravestone : MonoBehaviour, IProjectileImpactBehavior { public BodyIndex bodyIndex; public GameObject owner; public TeamIndex teamIndex; public GravekeeperResurrectController resurrectController; private ProjectileStickOnImpact stick; private ProjectileController projController; private bool hasMadeImpact = false; public static GameObject impactEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.OmniImpactVFXLarge_prefab).WaitForCompletion(); public static GameObject indicator = Addressables.LoadAssetAsync((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion(); private GameObject indicatorInstance; private Rigidbody rigid; private Vector3 impactNormal = Vector3.up; public void Start() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) projController = ((Component)this).GetComponent(); owner = projController.owner; if ((Object)(object)owner != (Object)null) { teamIndex = owner.GetComponent().teamIndex; GravekeeperResurrectController gravekeeperResurrectController = (resurrectController = owner.GetComponent()); bodyIndex = gravekeeperResurrectController.queuedBodyIndices[0]; gravekeeperResurrectController.queuedBodyIndices.RemoveAt(0); stick = ((Component)this).GetComponent(); rigid = ((Component)this).GetComponent(); } } public void FixedUpdate() { //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rigid != (Object)null && !hasMadeImpact) { Transform transform = ((Component)projController).transform; Vector3 velocity = rigid.velocity; transform.rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref velocity)).normalized); } } public void OnProjectileImpact(ProjectileImpactInfo info) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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) if (!((Behaviour)this).enabled) { return; } HurtBox component = ((Component)info.collider).GetComponent(); if ((Object)(object)component != (Object)null) { return; } impactNormal = info.estimatedImpactNormal; if (!hasMadeImpact) { hasMadeImpact = true; EffectManager.SpawnEffect(impactEffect, new EffectData { origin = ((Component)this).gameObject.transform.position, scale = 8f, rotation = Quaternion.identity }, true); Util.PlaySound("Play_bellBody_attackLand", ((Component)this).gameObject); indicatorInstance = Object.Instantiate(indicator, ((Component)this).gameObject.transform.position, Util.QuaternionSafeLookRotation(impactNormal)); indicatorInstance.transform.localScale = Vector3.one * MassResurrectModule.gravestoneRadius.Value; TeamAreaIndicator component2 = indicatorInstance.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.teamFilter = ((Component)this).gameObject.GetComponent(); } } } public void OnDestroy() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Invalid comparison between Unknown and I4 //IL_015d: 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_0208: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)indicatorInstance != (Object)null) { Object.Destroy((Object)(object)indicatorInstance); indicatorInstance = null; } if (!NetworkServer.active || (int)bodyIndex == -1 || (Object)(object)resurrectController == (Object)null || resurrectController.boundGhosts.Count >= (int)MassResurrectModule.maxGhosts.Value) { return; } string bodyName = BodyCatalog.GetBodyName(bodyIndex); GameObject bodyPrefab = BodyCatalog.FindBodyPrefab(bodyName); if ((Object)(object)bodyPrefab == (Object)null) { return; } CharacterMaster val = MasterCatalog.allAiMasters.FirstOrDefault((Func)((CharacterMaster master) => (Object)(object)master.bodyPrefab == (Object)(object)bodyPrefab)); if ((Object)(object)val == (Object)null) { return; } MasterSummon val2 = new MasterSummon { masterPrefab = ((Component)val).gameObject, ignoreTeamMemberLimit = true, position = ((Component)this).gameObject.transform.position + new Vector3(0f, 1f, 0f) }; val2.summonerBodyObject = (Object.op_Implicit((Object)(object)owner) ? owner : null); val2.teamIndexOverride = (((int)teamIndex == -1) ? null : new TeamIndex?(teamIndex)); val2.ignoreTeamMemberLimit = true; val2.useAmbientLevel = true; val2.preSpawnSetupCallback = (Action)Delegate.Combine(val2.preSpawnSetupCallback, new Action(PreSpawnSetup)); CharacterMaster val3 = val2.Perform(); if ((Object)(object)val3 == (Object)null) { return; } CharacterBody body = val3.GetBody(); if (!((Object)(object)body != (Object)null)) { return; } EntityStateMachine[] components = ((Component)body).GetComponents(); EntityStateMachine[] array = components; foreach (EntityStateMachine val4 in array) { val4.initialStateType = val4.mainStateType; } CharacterMotor component = ((Component)body).GetComponent(); resurrectController.boundGhosts.Add(body); if ((Object)(object)component != (Object)null) { component.velocity = impactNormal * 20f; } else { Rigidbody component2 = ((Component)body).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.velocity = impactNormal * 20f; } } CharacterModel componentInChildren = ((Component)body).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Component)componentInChildren).gameObject.AddComponent(); } static void PreSpawnSetup(CharacterMaster newMaster) { newMaster.inventory.GiveItemPermanent(Items.HealthDecay, (int)MassResurrectModule.ghostLifetime.Value); newMaster.inventory.GiveItemPermanent(MassResurrectModule.GravekeeperGhostItem, 1); } } } } namespace EnemyAbilities.Abilities.FlyingVermin { [EnemyAbilities.ModuleInfo("Thwomp Stomp", "Gives Blind Pests a new secondary:\n- Thwomp Stomp: Allows them to fly downwards quickly, releasing an explosion when they land. They enter a grounded state for 3 seconds afterwards.", "Blind Pest", true)] public class ThwompModule : BaseModule { private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_FlyingVermin.FlyingVerminBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_FlyingVermin.FlyingVerminMaster_prefab).WaitForCompletion(); private static CharacterSpawnCard cscFlyingVermin = Addressables.LoadAssetAsync((object)RoR2_DLC1_FlyingVermin.cscFlyingVermin_asset).WaitForCompletion(); private static CharacterSpawnCard cscFlyingVerminSnowy = Addressables.LoadAssetAsync((object)RoR2_DLC1_FlyingVermin.cscFlyingVerminSnowy_asset).WaitForCompletion(); internal static ConfigEntry warningDuration; internal static ConfigEntry recoveryDuration; internal static ConfigEntry groundedDuration; internal static ConfigEntry damageCoeff; internal static ConfigEntry radius; internal static ConfigEntry cooldown; public override void RegisterConfig() { base.RegisterConfig(); warningDuration = BindFloat("Warning Duration", 0.85f, "The duration that the indicator appears before the Blind Pest begins it's attack.", 0.5f, 1.5f, 0.05f, PluginConfig.FormatType.Time); recoveryDuration = BindFloat("Recovery Duration", 1.25f, "The duration that the Blind Pest is unable to select another attack for after landing", 0.5f, 1.5f, 0.05f, PluginConfig.FormatType.Time); groundedDuration = BindFloat("Grounded Duration", 3f, "The duration that the Blind Pest is forced into its grounded state for, before it becomes able to fly again", 1f, 10f, 0.1f, PluginConfig.FormatType.Time); damageCoeff = BindFloat("Damage Coefficient", 250f, "The damage multiplier to the Blind Pest's damage to get explosion damage. Uses falloff model sweet spot", 100f, 500f, 5f, PluginConfig.FormatType.Percentage); radius = BindFloat("Radius", 6f, "The explosion radius of the poison blast", 4f, 12f, 1f, PluginConfig.FormatType.Distance); cooldown = BindFloat("Cooldown", 8f, "The cooldown of the ability", 4f, 20f, 0.1f, PluginConfig.FormatType.Time); BindStats(bodyPrefab, new List(2) { cscFlyingVermin, cscFlyingVerminSnowy }); } public override void Initialise() { base.Initialise(); bodyPrefab.AddComponent(); CreateSkill(); } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "FlyingVerminBodyThwompStomp", skillName = "FlyingVerminThwompStomp", esmName = "Body", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; ThwompSkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, (SkillDef)(object)skillDef, "FlyingVerminSecondaryFamily", (SkillSlot)1); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSecondary", skillSlot = (SkillSlot)1, requireReady = true, minDistance = 10f, maxDistance = 40f, movementType = (MovementType)2, aimType = (AimType)2, targetType = (TargetType)0, desiredIndex = 1 }; CreateAISkillDriver(data2); AISkillDriverData data3 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "fleeAtCloseRange", skillSlot = (SkillSlot)(-1), minDistance = 0f, maxDistance = 5f, targetType = (TargetType)0, movementType = (MovementType)3, aimType = (AimType)2, desiredIndex = 0 }; CreateAISkillDriver(data3); } } public class ThwompSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { public ThwompController controller; } public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { controller = ((Component)skillSlot.characterBody).gameObject.GetComponent() }; } public override bool IsReady([NotNull] GenericSkill skillSlot) { InstanceData instanceData = skillSlot.skillInstanceData as InstanceData; if ((Object)(object)instanceData?.controller == (Object)null) { return false; } return instanceData.controller.foundTarget && ((SkillDef)this).IsReady(skillSlot); } } public class ThwompStomp : BaseSkillState { private float warningDuration; private static float baseWarningDuration = ThwompModule.warningDuration.Value; private bool thwompingIt; private bool hitGround; private static float baseRecoveryDuration = ThwompModule.recoveryDuration.Value; private float recoveryDuration; private float recoveryStopwatch = 0f; private static float damageCoefficient = ThwompModule.damageCoeff.Value / 100f; private static float force = 1000f; private static Vector3 bonusForce = new Vector3(0f, 1000f, 0f); private static float procCoefficient = 1f; private static float radius = ThwompModule.radius.Value; private ThwompController controller; private static GameObject blastEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Croco.CrocoLeapExplosion_prefab).WaitForCompletion(); private static GameObject indicatorPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion(); private GameObject indicatorInstance; public override void OnEnter() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlaySound("Play_flyingVermin_spawn", ((EntityState)this).gameObject); warningDuration = baseWarningDuration / ((BaseState)this).attackSpeedStat; recoveryDuration = baseRecoveryDuration / ((BaseState)this).attackSpeedStat; controller = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); indicatorInstance = Object.Instantiate(indicatorPrefab, GetIndicatorPos(), Util.QuaternionSafeLookRotation(Vector3.up)); UpdateIndicator(); TeamAreaIndicator component = indicatorInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.teamComponent = ((EntityState)this).teamComponent; } } public override void OnExit() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown ((EntityState)this).OnExit(); if (thwompingIt) { ((EntityState)this).characterMotor.onMovementHit -= new MovementHitDelegate(OnMovementHit); } TryDestroyIndicator(); } public void TryDestroyIndicator() { if ((Object)(object)indicatorInstance != (Object)null) { Object.Destroy((Object)(object)indicatorInstance); } } public void UpdateIndicator() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0064: 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) if ((Object)(object)indicatorInstance != (Object)null) { Vector3 indicatorPos = GetIndicatorPos(); indicatorInstance.transform.position = indicatorPos; float num = 0.1f + Mathf.Sqrt(0.9f * Mathf.Clamp01(((EntityState)this).fixedAge / warningDuration)); indicatorInstance.transform.localScale = Vector3.one * radius * num; } } public Vector3 GetIndicatorPos() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0058: Unknown result type (might be due to invalid IL or missing references) Vector3 result = ((EntityState)this).characterBody.transform.position; RaycastHit val = default(RaycastHit); if (Physics.Raycast(((EntityState)this).characterBody.transform.position, Vector3.down, ref val, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { result = ((RaycastHit)(ref val)).point; } return result; } public override void FixedUpdate() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); if ((Object)(object)indicatorInstance != (Object)null) { UpdateIndicator(); } if (((EntityState)this).fixedAge > warningDuration && !thwompingIt) { thwompingIt = true; ((EntityState)this).characterMotor.onMovementHit += new MovementHitDelegate(OnMovementHit); } if (thwompingIt && !hitGround && ((EntityState)this).characterMotor.velocity.y > -50f) { ((EntityState)this).characterMotor.velocity.y -= 5f; } if (hitGround) { recoveryStopwatch += Time.fixedDeltaTime; if (recoveryStopwatch > recoveryDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } } private void OnMovementHit(ref MovementHitInfo movementHitInfo) { //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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_01a7: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) if (thwompingIt && !hitGround) { TryDestroyIndicator(); hitGround = true; ((EntityState)this).characterMotor.velocity = Vector3.zero; if (((EntityState)this).isAuthority) { DamageTypeCombo val = default(DamageTypeCombo); val.damageSource = (DamageSource)2; val.damageType = (DamageType)0; DamageTypeCombo damageType = val; BlastAttack val2 = new BlastAttack(); val2.attacker = ((Component)((EntityState)this).characterBody).gameObject; val2.inflictor = ((Component)((EntityState)this).characterBody).gameObject; val2.position = ((EntityState)this).characterBody.corePosition; val2.baseForce = force; val2.bonusForce = bonusForce; val2.radius = radius; val2.attackerFiltering = (AttackerFiltering)2; val2.procCoefficient = procCoefficient; val2.baseDamage = damageCoefficient * ((BaseState)this).damageStat; val2.crit = ((BaseState)this).RollCrit(); val2.damageColorIndex = (DamageColorIndex)0; val2.damageType = damageType; val2.teamIndex = ((EntityState)this).teamComponent.teamIndex; val2.falloffModel = (FalloffModel)2; val2.Fire(); } controller.savedBaseJumpCount = ((EntityState)this).characterBody.baseJumpCount; controller.savedMaxJumpCount = ((EntityState)this).characterBody.maxJumpCount; ((EntityState)this).characterBody.baseJumpCount = 0; ((EntityState)this).characterBody.maxJumpCount = 0; ((EntityState)this).characterMotor.useGravity = true; controller.shouldObeyGravity = true; EffectManager.SpawnEffect(blastEffect, new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = radius }, true); } } 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 ThwompController : MonoBehaviour { private CharacterBody pestBody; private float checkTimer = 1f; private float checkInterval = 0.1f; private float minimumDistance = 10f; private float maximumDistance = 40f; public bool foundTarget = false; private float radius = 3f + ThwompModule.radius.Value; private float gravityTimer; private float gravityDuration = ThwompModule.groundedDuration.Value; public int savedBaseJumpCount; public int savedMaxJumpCount; public bool shouldObeyGravity; public void Awake() { pestBody = ((Component)this).GetComponent(); } public void FixedUpdate() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00ca: 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_00e1: 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_0109: Unknown result type (might be due to invalid IL or missing references) checkTimer -= Time.fixedDeltaTime; if (checkTimer < 0f) { foundTarget = false; bool flag = false; checkTimer += checkInterval; RaycastHit val = default(RaycastHit); if (Physics.Raycast(pestBody.transform.position, Vector3.down, ref val, maximumDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && ((RaycastHit)(ref val)).distance > minimumDistance) { flag = true; } if (flag) { Vector3 point = ((RaycastHit)(ref val)).point; TeamMask enemyTeams = TeamMask.GetEnemyTeams(pestBody.teamComponent.teamIndex); SphereSearch val2 = new SphereSearch(); val2.origin = point; val2.radius = radius; val2.queryTriggerInteraction = (QueryTriggerInteraction)1; val2.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; val2.RefreshCandidates(); val2.FilterCandidatesByDistinctHurtBoxEntities(); val2.FilterCandidatesByHurtBoxTeam(enemyTeams); HurtBox[] hurtBoxes = val2.GetHurtBoxes(); if (hurtBoxes.Length != 0) { foundTarget = true; } } } if (shouldObeyGravity) { gravityTimer += Time.fixedDeltaTime; if (gravityTimer > gravityDuration) { gravityTimer = 0f; pestBody.characterMotor.useGravity = false; shouldObeyGravity = false; ((BaseCharacterController)pestBody.characterMotor).Motor.ForceUnground(0.1f); pestBody.characterMotor.velocity = new Vector3(0f, 25f, 0f); pestBody.baseJumpCount = savedBaseJumpCount; pestBody.maxJumpCount = savedMaxJumpCount; } } } } } namespace EnemyAbilities.Abilities.ExtractorUnit { [EnemyAbilities.ModuleInfo("Tendril Tether", "Gives Solus Extractors a new Utility:\n-Tendril Tether: The Extractor shoots out a long mechanical tendril that attaches to both units and terrain and pulls the extractor towards the point of impact. If it hits an enemy, it deals damage, slows and provides the Extractor an attack speed buff. Enabling this module also slightly increases Solus Extractor move speed, and makes them prioritise enemies with items that they can steal.", "Solus Extractor", true)] public class HookModule : BaseModule { public class Hook : BaseSkillState { private static float baseDuration = telegraphDuration.Value; private float duration; private static float hookProjectileSpeed = projectileSpeed.Value; private static float hookDamageCoefficient = damageCoeff.Value / 100f; private bool hookIsPredictive = isPredictive.Value; private BaseAI baseAI; private static GameObject chargePrefab = Addressables.LoadAssetAsync((object)RoR2_Base_RoboBallBoss.ChargeEyeBlast_prefab).WaitForCompletion(); private GameObject chargeEffectInstance; private EffectManagerHelper _emh_chargeEffectInstance; private Transform muzzleTransform; public override void OnEnter() { //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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) ((BaseState)this).OnEnter(); Util.PlaySound("Play_MULT_m1_snipe_charge", ((EntityState)this).gameObject); Transform modelTransform = ((EntityState)this).GetModelTransform(); if ((Object)(object)((EntityState)this).modelLocator != (Object)null) { ChildLocator component = ((Component)modelTransform).GetComponent(); if ((Object)(object)component != (Object)null) { muzzleTransform = component.FindChild("Muzzle"); } } duration = baseDuration / ((BaseState)this).attackSpeedStat; if (hookIsPredictive && (Object)(object)((EntityState)this).characterBody != (Object)null && (Object)(object)((EntityState)this).characterBody.master != (Object)null) { baseAI = ((Component)((EntityState)this).characterBody.master).GetComponent(); } if ((Object)(object)chargePrefab != (Object)null && (Object)(object)muzzleTransform != (Object)null && (Object)(object)chargePrefab != (Object)null) { if (!EffectManager.ShouldUsePooledEffect(chargePrefab)) { chargeEffectInstance = Object.Instantiate(chargePrefab, muzzleTransform.position, muzzleTransform.rotation); } else { _emh_chargeEffectInstance = EffectManager.GetAndActivatePooledEffect(chargePrefab, muzzleTransform.position, muzzleTransform.rotation); chargeEffectInstance = ((Component)_emh_chargeEffectInstance).gameObject; } chargeEffectInstance.transform.parent = muzzleTransform; ScaleParticleSystemDuration component2 = chargeEffectInstance.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.newDuration = duration; } } } public override void OnExit() { ((EntityState)this).OnExit(); if ((Object)(object)chargeEffectInstance != (Object)null) { EffectManager.ReturnToPoolOrDestroyInstance(_emh_chargeEffectInstance, ref chargeEffectInstance); chargeEffectInstance = null; _emh_chargeEffectInstance = null; } } public void OnTargetLost() { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void FixedUpdate() { //IL_001f: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_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_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!(((EntityState)this).fixedAge > duration)) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 origin = ((Ray)(ref aimRay)).origin; Vector3 val = ((Ray)(ref aimRay)).direction; if (hookIsPredictive && (Object)(object)baseAI != (Object)null && baseAI.customTarget != null) { CharacterBody characterBody = baseAI.customTarget.characterBody; if ((Object)(object)characterBody != (Object)null) { Rigidbody component = ((Component)characterBody).gameObject.GetComponent(); CharacterMotor component2 = ((Component)characterBody).gameObject.GetComponent(); Vector3 val2 = Vector3.zero; if ((Object)(object)component != (Object)null) { val2 = component.velocity; } if ((Object)(object)component2 != (Object)null) { val2 = component2.velocity; } Vector3 position = characterBody.transform.position; Vector3 val3 = position - origin; float a = Vector3.Dot(val2, val2) - hookProjectileSpeed * hookProjectileSpeed; float b = 2f * Vector3.Dot(val3, val2); float c = Vector3.Dot(val3, val3); float num = SolveQuadratic(a, b, c); if (num > 0f) { Vector3 val4 = position + val2 * num; Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(val4.x, val4.y + 20f, val4.z); RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(val5, Vector3.down, ref val6, 100f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { val4 = ((RaycastHit)(ref val6)).point + Vector3.up * characterBody.radius * 2f; } else { val4.y = position.y; } Vector3 val7 = val4 - origin; val = ((Vector3)(ref val7)).normalized; } } } DamageTypeCombo val8 = default(DamageTypeCombo); val8.damageType = (DamageType)0; val8.damageSource = (DamageSource)4; DamageTypeCombo value = val8; Util.PlaySound("Play_MULT_m1_grenade_launcher_shoot", ((EntityState)this).gameObject); ProjectileManager.instance.FireProjectile(projectilePrefab, origin, Util.QuaternionSafeLookRotation(val), ((Component)((EntityState)this).characterBody).gameObject, hookDamageCoefficient * ((BaseState)this).damageStat, 500f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, hookProjectileSpeed, (DamageTypeCombo?)value); ((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 float SolveQuadratic(float a, float b, float c) { if (Mathf.Approximately(a, 0f)) { if (Mathf.Approximately(b, 0f)) { return -1f; } float num = (0f - c) / b; return (num > 0f) ? num : (-1f); } float num2 = b * b - 4f * a * c; if (num2 < 0f) { return -1f; } float num3 = Mathf.Sqrt(num2); float num4 = (0f - b - num3) / (2f * a); float num5 = (0f - b + num3) / (2f * a); if (num4 > 0f && num5 > 0f) { return Mathf.Min(num4, num5); } if (num4 > 0f) { return num4; } if (num5 > 0f) { return num5; } return -1f; } } public class ProjectileExtractorHook : MonoBehaviour, IProjectileImpactBehavior { private ProjectileController controller; private CharacterBody ownerBody; private static float maxHookRange = projectileDistanceLimit.Value; private GameObject hookTetherObject; private HookTether hookTether; private float dropStopwatch; private static float projectileDropStartTime = 0.5f; private Rigidbody rigidbody; private static GameObject speedBoostEffect = Addressables.LoadAssetAsync((object)RoR2_DLC3_FriendUnit.KineticAuraLaunch_prefab).WaitForCompletion(); public void Start() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown controller = ((Component)this).GetComponent(); if ((Object)(object)controller != (Object)null && (Object)(object)controller.owner != (Object)null) { ownerBody = controller.owner.GetComponent(); } hookTetherObject = new GameObject(); hookTether = hookTetherObject.AddComponent(); if ((Object)(object)ownerBody != (Object)null && Object.op_Implicit((Object)(object)ownerBody.master)) { hookTether.ownerTransform = ownerBody.transform; hookTether.ownerBody = ownerBody; BaseAI component = ((Component)ownerBody.master).GetComponent(); if ((Object)(object)component != (Object)null && component.customTarget != null) { hookTether.ownerTargetBody = component.customTarget.characterBody; } } rigidbody = ((Component)this).GetComponent(); } public void OnProjectileImpact(ProjectileImpactInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_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_016e: Expected O, but got Unknown hookTether.AttachHookEndOnImpact(info); Util.PlaySound("Play_gravekeeper_attack2_impact", ((Component)this).gameObject); if ((Object)(object)info.collider == (Object)null) { return; } HurtBox component = ((Component)info.collider).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)controller == (Object)null || (Object)(object)controller.owner == (Object)null || !((Object)(object)ownerBody != (Object)null) || !((Object)(object)component.healthComponent != (Object)null) || !((Object)(object)component.healthComponent.body != (Object)null)) { return; } CharacterBody body = component.healthComponent.body; if ((Object)(object)body.teamComponent != (Object)null && (Object)(object)ownerBody.teamComponent != (Object)null && ownerBody.teamComponent.teamIndex != body.teamComponent.teamIndex) { EffectData val = new EffectData { origin = ownerBody.transform.position, scale = ownerBody.radius, rotation = Util.QuaternionSafeLookRotation(ownerBody.inputBank.aimDirection) }; val.SetHurtBoxReference(ownerBody.mainHurtBox); EffectManager.SpawnEffect(speedBoostEffect, val, true); ownerBody.AddTimedBuff(extractorBuff, berserkBuffDuration.Value); if (resetPrimary.Value) { ownerBody.skillLocator.primary.Reset(); } } } public void FixedUpdate() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) dropStopwatch += Time.fixedDeltaTime; if (dropStopwatch > projectileDropStartTime && (Object)(object)rigidbody != (Object)null && !rigidbody.useGravity) { rigidbody.useGravity = true; } if ((Object)(object)hookTetherObject != (Object)null) { hookTetherObject.transform.position = ((Component)this).transform.position; } if ((Object)(object)ownerBody != (Object)null) { float num = Vector3.Distance(ownerBody.transform.position, ((Component)this).gameObject.transform.position); if (num > maxHookRange) { Object.Destroy((Object)(object)hookTetherObject); Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public class HookTether : MonoBehaviour { public Transform ownerTransform; public CharacterBody ownerBody; public CharacterBody ownerTargetBody; private TetherVfxOrigin tetherVFXOrigin; private bool impact; private static float timeAfterImpact = 3f; private float impactStopwatch; private CharacterBody hitBody; private static float hookSpeed = pullSpeed.Value; private static float rangeToUntether = 6f; private static float maxLifetime = 8f; private float stopwatch; private bool tetherCreated; public void Start() { tetherVFXOrigin = ((Component)this).gameObject.AddComponent(); tetherVFXOrigin.transform = ((Component)this).gameObject.transform; tetherVFXOrigin.tetherPrefab = hookTetherPrefab; } public void AttachHookEndOnImpact(ProjectileImpactInfo info) { //IL_0008: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) impact = true; if (!((Object)(object)info.collider == (Object)null)) { HurtBox component = ((Component)info.collider).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.healthComponent != (Object)null && (Object)(object)component.healthComponent.body != (Object)null) { hitBody = component.healthComponent.body; } ((Component)this).transform.position = info.estimatedPointOfImpact; } } public void FixedUpdate() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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_0162: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) stopwatch += Time.fixedDeltaTime; if (stopwatch > maxLifetime || (Object)(object)ownerBody == (Object)null || (Object)(object)ownerTransform == (Object)null || (Object)(object)((Component)this).gameObject == (Object)null || (Object)(object)((Component)this).gameObject.transform == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } if ((Object)(object)ownerTransform != (Object)null && (Object)(object)tetherVFXOrigin != (Object)null && !tetherCreated) { tetherVFXOrigin.SetTetheredTransforms(new List(1) { ownerTransform }); tetherCreated = true; } if (!impact || !((Object)(object)ownerBody != (Object)null)) { return; } Vector3 val = ((Component)this).gameObject.transform.position - ownerBody.transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = normalized * hookSpeed; bool flag = false; if ((Object)(object)ownerTargetBody != (Object)null) { Vector3 position = ownerTargetBody.transform.position; Vector3 val3 = position - ownerBody.transform.position; float num = Vector3.Dot(val2, val3); if (num < 0f) { flag = true; } } float num2 = Vector3.Distance(((Component)this).transform.position, ownerBody.transform.position); CharacterMotor characterMotor = ownerBody.characterMotor; if ((Object)(object)characterMotor != (Object)null) { ((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f); float num3 = 1f - rangeToUntether / num2; float num4 = 0.25f + 0.75f * Mathf.Pow(num3, 1f); characterMotor.velocity = val2 * num4; } if ((Object)(object)hitBody != (Object)null) { ((Component)this).transform.position = hitBody.transform.position; if (applySlow.Value) { hitBody.AddTimedBuff(Buffs.Slow60, 0.5f); } } impactStopwatch += Time.fixedDeltaTime; bool flag2 = (Object)(object)ownerTargetBody != (Object)null && Vector3.Distance(ownerTargetBody.transform.position, ownerBody.transform.position) < rangeToUntether; bool flag3 = num2 < rangeToUntether; if (impactStopwatch > timeAfterImpact || flag2 || flag3 || flag) { if ((Object)(object)characterMotor != (Object)null) { characterMotor.velocity = Vector3.zero; } Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class ExtractorUnitTargetController : MonoBehaviour { private BaseAI baseAI; private CharacterBody body; private static float searchInterval = 0.25f; private float timer; public void Start() { body = ((Component)this).GetComponent(); if ((Object)(object)body == (Object)null) { return; } CharacterMaster master = body.master; if (!((Object)(object)master == (Object)null)) { baseAI = ((Component)master).gameObject.GetComponent(); if (!((Object)(object)baseAI == (Object)null)) { } } } public void FixedUpdate() { //IL_00b9: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) timer -= Time.fixedDeltaTime; if (!(timer < 0f)) { return; } timer += searchInterval; if ((Object)(object)body == (Object)null || (Object)(object)body.inputBank == (Object)null || (Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive || (Object)(object)baseAI == (Object)null || (Object)(object)body.teamComponent == (Object)null) { return; } TeamMask enemyTeams = TeamMask.GetEnemyTeams(body.teamComponent.teamIndex); Ray aimRay = body.inputBank.GetAimRay(); BullseyeSearch val = new BullseyeSearch(); val.viewer = body; val.filterByDistinctEntity = true; val.filterByLoS = false; val.maxDistanceFilter = float.PositiveInfinity; val.minDistanceFilter = 0f; val.searchOrigin = ((Ray)(ref aimRay)).origin; val.searchDirection = ((Ray)(ref aimRay)).direction; val.maxAngleFilter = 360f; val.sortMode = (SortMode)3; val.teamMaskFilter = enemyTeams; val.RefreshCandidates(); IEnumerable results = val.GetResults(); if (results.Any()) { IEnumerable source = results.Where((HurtBox hurtBox) => HasInventoryWithValidItems(hurtBox)); GameObject gameObject; if (source.Any()) { HurtBox? obj = source.FirstOrDefault(); gameObject = ((obj != null) ? ((Component)obj.healthComponent.body).gameObject : null); } else { HurtBox? obj2 = results.FirstOrDefault(); gameObject = ((obj2 != null) ? ((Component)obj2.healthComponent.body).gameObject : null); } baseAI.customTarget.gameObject = gameObject; } } public bool HasInventoryWithValidItems(HurtBox hurtBox) { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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) if ((Object)(object)hurtBox == (Object)null) { return false; } if ((Object)(object)hurtBox.healthComponent == (Object)null) { return false; } if (!hurtBox.healthComponent.alive) { return false; } CharacterBody val = hurtBox.healthComponent.body; if ((Object)(object)val == (Object)null) { return false; } if ((Object)(object)val.master == (Object)null) { return false; } Inventory inventory = hurtBox.healthComponent.body.inventory; if ((Object)(object)inventory == (Object)null) { return false; } foreach (ItemIndex item in inventory.itemAcquisitionOrder) { if (inventory.GetItemCountPermanent(item) != 0) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (!((Object)(object)itemDef == (Object)null) && itemDef.canRemove && !itemDef.ContainsTag((ItemTag)24) && !itemDef.ContainsTag((ItemTag)4)) { return true; } } } return false; } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_ExtractorUnit.ExtractorUnitBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC3_ExtractorUnit.ExtractorUnitMaster_prefab).WaitForCompletion(); private static GameObject projectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Lemurian.Fireball_prefab).WaitForCompletion(), "extractorHook"); private static GameObject hookTetherPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_moon2.BloodSiphonTetherVFX_prefab).WaitForCompletion(), "extractorHookTetherPrefab"); private static CharacterSpawnCard cscExtractor = Addressables.LoadAssetAsync((object)RoR2_DLC3_ExtractorUnit.cscExtractorUnit_asset).WaitForCompletion(); private static BuffDef extractorBuff; internal static ConfigEntry cooldown; internal static ConfigEntry maxUseDistance; internal static ConfigEntry telegraphDuration; internal static ConfigEntry projectileSpeed; internal static ConfigEntry isPredictive; internal static ConfigEntry damageCoeff; internal static ConfigEntry projectileDistanceLimit; internal static ConfigEntry berserkBuffDuration; internal static ConfigEntry resetPrimary; internal static ConfigEntry pullSpeed; internal static ConfigEntry applySlow; internal static ConfigEntry prioritiseInventories; public override void RegisterConfig() { base.RegisterConfig(); cooldown = BindFloat("Tether Cooldown", 6f, "Cooldown of the tether ability", 5f, 20f, 0.1f, PluginConfig.FormatType.Time); maxUseDistance = BindFloat("Tether Max Use Distance", 70f, "The maximum distance that Extractors will attempt to tether towards their target.", 40f, 100f, 1f, PluginConfig.FormatType.Distance); telegraphDuration = BindFloat("Tether Telegraph Duration", 0.8f, "The duration of time that Extractors will spend charging their tether.", 0.5f, 3f, 0.1f, PluginConfig.FormatType.Time); projectileSpeed = BindFloat("Tether Projectile Speed", 120f, "The movement speed of the tether projectile. Lower values are recommended if using predictive aiming.", 40f, 200f, 1f, PluginConfig.FormatType.Speed); isPredictive = BindBool("Tether Uses Prediction", defaultValue: false, "If enabled, Extractors will attempt to lead their shots in order to more often hit the player.\nI'll be honest, the prediction I designed for this is kinda ass, hence why it only exists as a config option now. Enable at your own peril."); damageCoeff = BindFloat("Tether Damage Coefficient", 200f, "The damage coefficient of the tether upon hitting a target.", 100f, 400f, 5f, PluginConfig.FormatType.Percentage); projectileDistanceLimit = BindFloat("Tether Max Projectile Distance", 80f, "The maximum distance that the tether can travel before disappearing. Setting this lower than max use distance will cause Extractors to sometimes fire whilst out of range.", 40f, 200f, 1f, PluginConfig.FormatType.Distance); berserkBuffDuration = BindFloat("Tether Hit Buff Duration", 5f, "The duration of time that Extractors gain move speed and attack speed after successfully landing their tether on an enemy.", 0f, 10f, 0.1f, PluginConfig.FormatType.Time); resetPrimary = BindBool("Tether Hit Reset Primary", defaultValue: true, "If enabled, Extractors will immediately be able to use Extract after landing their Tether on an enemy."); pullSpeed = BindFloat("Tether Pull Travel Speed", 65f, "The speed at with the Extractor is pulled towards its tether upon a hit. Higher values may start flinging the Extractor!", 40f, 100f, 1f, PluginConfig.FormatType.Speed); applySlow = BindBool("Tether Hit Apply Slow", defaultValue: true, "If enabled, Extractors will apply a slow upon landing a successful tether."); prioritiseInventories = BindBool("Prioritise Inventories", defaultValue: true, "If enabled, Extractors will prioritise attacking enemies that have items that are not on their blacklist."); BindStats(bodyPrefab, new List(1) { cscExtractor }, new StatOverrides { baseMoveSpeed = 18f, baseAcceleration = 60f, directorCost = 30f }); } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "ExtractorUnitBodyHook", skillName = "ExtractorUnitHook", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true, intPrio = (InterruptPriority)0 }; SkillDef val = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, val, "ExtractorUnitUtilityFamily", (SkillSlot)2); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useUtility", skillSlot = (SkillSlot)2, requiredSkillDef = val, requireReady = true, minDistance = 16f, maxDistance = maxUseDistance.Value, targetType = (TargetType)(prioritiseInventories.Value ? 3 : 0), movementType = (MovementType)1, aimType = (AimType)1, activationRequiresTargetLoS = true, desiredIndex = 3, driverUpdateTimerOverride = 2f, moveInputScale = 0.5f }; CreateAISkillDriver(data2); if (!prioritiseInventories.Value) { return; } AISkillDriver[] components = masterPrefab.GetComponents(); foreach (AISkillDriver val2 in components) { if (val2.customName == "StrafeSlowExtractWhenTooClose" || val2.customName == "SlowWhenClose" || val2.customName == "WarningBeforeExtract" || val2.customName == "PathFromAfar" || val2.customName == "Flee") { val2.moveTargetType = (TargetType)3; val2.aimType = (AimType)1; } } } public override void Initialise() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown base.Initialise(); CreateSkill(); CreateBuffDef(); SetUpTetherPrefab(); ProjectileController component = projectilePrefab.GetComponent(); ProjectileExtractorHook projectileExtractorHook = projectilePrefab.AddComponent(); component.ghostPrefab = null; SphereCollider component2 = projectilePrefab.GetComponent(); component2.radius = 0.5f; ProjectileSingleTargetImpact component3 = projectilePrefab.GetComponent(); component3.impactEffect = Addressables.LoadAssetAsync((object)RoR2_DLC3_ExtractorUnit.ExtractorUnitHitEffectVFX_prefab).WaitForCompletion(); if (prioritiseInventories.Value) { ExtractorUnitTargetController extractorUnitTargetController = bodyPrefab.AddComponent(); } RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ApplyBuffStats); } private void ApplyBuffStats(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender != (Object)null && sender.HasBuff(extractorBuff)) { args.moveSpeedMultAdd += 0.25f; args.attackSpeedMultAdd += 1f; } } public void SetUpTetherPrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) Material val = Addressables.LoadAssetAsync((object)RoR2_DLC3_ExtractorUnit.ExtractorLeg_mat).WaitForCompletion(); Material val2 = new Material(val); val.mainTextureScale = Vector2.one; LineRenderer component = hookTetherPrefab.GetComponent(); ((Renderer)component).material = val; ((Renderer)component).sharedMaterial = val; } public void CreateBuffDef() { //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_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) extractorBuff = ScriptableObject.CreateInstance(); ((Object)extractorBuff).name = "ExtractorHookBuff"; extractorBuff.buffColor = new Color(0.494f, 0.784f, 0.89f, 1f); extractorBuff.iconSprite = Addressables.LoadAssetAsync((object)RoR2_Base_Common_MiscIcons.texAttackIcon_png).WaitForCompletion(); extractorBuff.canStack = false; extractorBuff.isCooldown = false; extractorBuff.isDOT = false; extractorBuff.isHidden = false; ContentAddition.AddBuffDef(extractorBuff); } } } namespace EnemyAbilities.Abilities.ClayGrenadier { [EnemyAbilities.ModuleInfo("Tar Deluge", "Gives Clay Apothecaries a new Special:\n- Tar Deluge: Charges up a tar bomb that gains size and damage the more it's damaged during the charge. Flings it after 3 seconds, creating a huge AoE tar zone shortly after landing.\nEnabling this option increases the health of Clay Apothecaries from 1050 to 1400, and increases their director cost from 150 to 180.", "Clay Apothecary", true)] public class TarZoneModule : BaseModule { [RequireComponent(typeof(Rigidbody))] public class ProjectileBigTarBlob : MonoBehaviour { public float gravityModifier; private Vector3 newGravity; private Rigidbody rigid; public float chargePercentage; private ProjectileStickOnImpact stick; private bool playedImpactSoundEffect; private static GameObject indicatorPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion(); private GameObject indicatorInstance; private TeamFilter teamFilter; public void Awake() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) newGravity = Physics.gravity * gravityModifier; } public void Start() { teamFilter = ((Component)this).GetComponent(); rigid = ((Component)this).GetComponent(); if (rigid.useGravity) { Log.Error("ProjectileBigTarBlob start on a with rigidbody.useGravity = true!"); } stick = ((Component)this).GetComponent(); } public void FixedUpdate() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown if (!rigid.useGravity) { Rigidbody obj = rigid; obj.velocity += newGravity * Time.fixedDeltaTime; } if ((Object)(object)stick != (Object)null && stick.stuck && !playedImpactSoundEffect) { playedImpactSoundEffect = true; Util.PlaySound("Play_clayGrenadier_attack1_launch", ((Component)this).gameObject); indicatorInstance = Object.Instantiate(indicatorPrefab, ((Component)this).gameObject.transform.position, Util.QuaternionSafeLookRotation(Vector3.up)); TeamAreaIndicator component = indicatorInstance.GetComponent(); component.teamFilter = teamFilter; float num = minRadius.Value + chargePercentage * (maxRadius.Value - minRadius.Value); indicatorInstance.transform.localScale = Vector3.one * num; EffectManager.SpawnEffect(explosionVFX, new EffectData { origin = ((Component)this).gameObject.transform.position, rotation = Quaternion.identity, scale = 6f + 6f * chargePercentage }, true); } } public void DestroySelf() { Object.Destroy((Object)(object)((Component)((Component)this).GetComponent()).gameObject); } public void OnDisable() { Object.Destroy((Object)(object)indicatorInstance); indicatorInstance = null; } } public class FireBigBlob : BaseSkillState { private static float baseWindupDuration = 0.2f; private float windupDuration; private static float baseChargeDuration = chargeTime.Value; private float chargeDuration; private bool spawnedProjectile; private bool launchedProjectile; private ClayGrenadierChargeController chargeController; public override void OnEnter() { //IL_00b9: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlayAttackSpeedSound("Play_clayGrenadier_attack2_chargeup", ((Component)((EntityState)this).characterBody).gameObject, ((BaseState)this).attackSpeedStat); ((EntityState)this).characterBody.SetAimTimer(baseChargeDuration + baseWindupDuration); windupDuration = baseWindupDuration / ((BaseState)this).attackSpeedStat; chargeDuration = baseChargeDuration; ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 0f; ((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).gameObject, CommonAssets.disabledSkill, (SkillOverridePriority)4); ((EntityState)this).skillLocator.secondary.SetSkillOverride((object)((EntityState)this).gameObject, CommonAssets.disabledSkill, (SkillOverridePriority)4); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { CharacterDirection characterDirection = ((EntityState)this).characterDirection; Ray aimRay = ((BaseState)this).GetAimRay(); characterDirection.moveVector = ((Ray)(ref aimRay)).direction; } chargeController = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if ((Object)(object)((EntityState)this).characterBody != (Object)null && ((EntityState)this).fixedAge >= windupDuration && !chargeController.charging && !spawnedProjectile) { spawnedProjectile = true; chargeController.StartChargingAndSpawnProjectile(); } if (((EntityState)this).fixedAge >= windupDuration + chargeDuration && !launchedProjectile) { launchedProjectile = true; Util.PlayAttackSpeedSound("Play_clayGrenadier_attack2_throw", ((Component)((EntityState)this).characterBody).gameObject, ((BaseState)this).attackSpeedStat / 2f); LaunchProjectile(); } if (launchedProjectile) { ((EntityState)this).outer.SetNextStateToMain(); } } public void LaunchProjectile() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((EntityState)this).characterBody.transform.position + ((EntityState)this).characterBody.transform.up * 8f; Vector3 val2 = val + ((Ray)(ref aimRay)).direction * 50f; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction, ref val3, 1000f, LayerMask.op_Implicit(CommonMasks.bullet))) { val2 = ((RaycastHit)(ref val3)).point; } Vector3 velocity = Trajectory.CalculateInitialVelocityFromTime(val, val2, travelTime.Value, Physics.gravity.y * 0.5f, 0f, float.PositiveInfinity); if (chargeController.charging) { chargeController.StopChargingAndLaunchProjectile(velocity); } } public override void OnExit() { ((EntityState)this).OnExit(); ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f; ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).gameObject, CommonAssets.disabledSkill, (SkillOverridePriority)4); ((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)((EntityState)this).gameObject, CommonAssets.disabledSkill, (SkillOverridePriority)4); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } [RequireComponent(typeof(ProjectileController))] public class ProjectileTarZone : MonoBehaviour { private TeamFilter filter; private static GameObject indicator = Addressables.LoadAssetAsync((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion(); private GameObject indicatorInstance; private static float attackInterval = 0.25f; private float attackTimer; private GameObject tarBubblesInstance; private EffectManagerHelper _emh_bubblesInstance; private Vector3 effectOffset = new Vector3(0f, -4f, 0f); public float chargePercentage; private static float lifetime = dotDuration.Value; private float stopwatch; private float minRadius = TarZoneModule.minRadius.Value; private float maxRadius = TarZoneModule.maxRadius.Value; private float radius; public void Start() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) radius = minRadius + chargePercentage * (maxRadius - minRadius); filter = ((Component)this).GetComponent(); indicatorInstance = Object.Instantiate(indicator, ((Component)this).gameObject.transform.position, Util.QuaternionSafeLookRotation(Vector3.up)); TeamAreaIndicator component = indicatorInstance.GetComponent(); ((Component)component).transform.localScale = Vector3.one * radius; component.teamFilter = filter; ProjectileController component2 = ((Component)this).GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component2.ghost != (Object)null) { component2.ghost.transform.localScale = Vector3.one * (radius / 2f); } AttachVisualEffect(); } private void AttachVisualEffect() { //IL_0050: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_00f4: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) if (!EffectManager.ShouldUsePooledEffect(tarBubblesPrefab)) { tarBubblesInstance = Object.Instantiate(tarBubblesPrefab, ((Component)this).transform.position + effectOffset, Quaternion.identity); } else { _emh_bubblesInstance = EffectManager.GetAndActivatePooledEffect(tarBubblesPrefab, ((Component)this).transform.position + effectOffset, Quaternion.identity); tarBubblesInstance = ((Component)_emh_bubblesInstance).gameObject; } ParticleSystemRenderer[] componentsInChildren = tarBubblesInstance.GetComponentsInChildren(); ParticleSystemRenderer val = componentsInChildren[0]; ParticleSystem[] componentsInChildren2 = tarBubblesInstance.GetComponentsInChildren(); ParticleSystem val2 = componentsInChildren2[0]; if (componentsInChildren.Length > 1) { Object.Destroy((Object)(object)componentsInChildren[1]); Object.Destroy((Object)(object)componentsInChildren2[1]); } MainModule main = val2.main; ShapeModule shape = val2.shape; SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime; EmissionModule emission = val2.emission; VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((Component)val2).gameObject.transform.rotation = Util.QuaternionSafeLookRotation(Vector3.up); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2.8f); ((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).sizeMultiplier = 1.5f; ((EmissionModule)(ref emission)).rateOverTimeMultiplier = 15f + 15f * chargePercentage; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = radius; ((ShapeModule)(ref shape)).scale = new Vector3(1f, 0.2f, 1f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)1; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).speedModifier = MinMaxCurve.op_Implicit(1f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).speedModifierMultiplier = 5f; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).yMultiplier = 1f; } public void DestroyVisualEffect() { if ((Object)(object)_emh_bubblesInstance != (Object)null && (Object)(object)tarBubblesInstance != (Object)null) { EffectManager.ReturnToPoolOrDestroyInstance(_emh_bubblesInstance, ref tarBubblesInstance); tarBubblesInstance = null; _emh_bubblesInstance = null; } } public void OnDestroy() { Object.Destroy((Object)(object)indicatorInstance); indicatorInstance = null; DestroyVisualEffect(); } public void FixedUpdate() { attackTimer -= Time.fixedDeltaTime; stopwatch += Time.fixedDeltaTime; if (attackTimer < 0f) { attackTimer += attackInterval; FireAttack(); } if (stopwatch > lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void FireAttack() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0130: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) ProjectileController component = ((Component)this).GetComponent(); ProjectileDamage component2 = ((Component)this).GetComponent(); SphereSearch val = new SphereSearch(); val.radius = radius; val.origin = ((Component)this).gameObject.transform.position; val.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; val.queryTriggerInteraction = (QueryTriggerInteraction)2; TeamMask enemyTeams = TeamMask.GetEnemyTeams(filter.teamIndex); val.RefreshCandidates(); val.FilterCandidatesByDistinctHurtBoxEntities(); val.FilterCandidatesByHurtBoxTeam(enemyTeams); HurtBox[] hurtBoxes = val.GetHurtBoxes(); HurtBox[] array = hurtBoxes; foreach (HurtBox val2 in array) { if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2.healthComponent == (Object)null) && !((Object)(object)val2.healthComponent.body == (Object)null)) { CharacterBody body = val2.healthComponent.body; float y = body.transform.position.y; float y2 = ((Component)this).gameObject.transform.position.y; if (!(Mathf.Abs(y2 - y) > 8f)) { GameObject owner = component.owner; DamageInfo val3 = new DamageInfo(); val3.inflictor = ((Component)this).gameObject; val3.attacker = owner; val3.crit = false; val3.damage = component2.damage * 1f; val3.force = Vector3.zero; val3.damageColorIndex = (DamageColorIndex)7; val3.damageType = new DamageTypeCombo { damageType = (DamageType)512, damageSource = (DamageSource)8 }; val3.position = body.transform.position; val3.procCoefficient = 0f; val3.procChainMask = default(ProcChainMask); body.healthComponent.TakeDamage(val3); } } } } } public class ClayGrenadierChargeController : MonoBehaviour { public float percentageHealthTaken = 0f; private static float maxPercentageHealthTaken = healthPercentForFullCharge.Value / 100f; public bool charging = false; public Transform tarBallTransform; private CharacterBody body; private GameObject tarBallInstance; private ProjectileImpactExplosion impact; private ProjectileStickOnImpact stick; private ProjectileBigTarBlob bigTarBlob; private ProjectileController controller; private ProjectileDamage damageComponent; public float percentageCharge; private SphereCollider collider; public void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_003b: 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) body = ((Component)this).GetComponent(); GameObject val = new GameObject(); val.transform.parent = body.transform; val.transform.localPosition = body.transform.up * 8f; tarBallTransform = val.transform; } public void IncreaseCharge(float damagePercentage) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) if (!(percentageHealthTaken < maxPercentageHealthTaken)) { return; } percentageHealthTaken += damagePercentage; if (!((Object)(object)controller != (Object)null)) { return; } Vector3 position = ((Component)controller).transform.position; Util.PlaySound("Play_engi_M1_chargeStock", ((Component)body).gameObject); EffectManager.SpawnEffect(chargeEffect, new EffectData { origin = position, rotation = Util.QuaternionSafeLookRotation(Random.onUnitSphere), scale = 2f + damagePercentage * 4f }, true); if (percentageCharge < 1f) { int num = Mathf.Min((int)(damagePercentage / 0.004f), 10); num = Mathf.Max(1, num); for (int i = 0; i < num; i++) { GameObject val = new GameObject(); Vector3 val2 = Random.onUnitSphere * (8f + 8f * percentageCharge); val.transform.position = tarBallTransform.position + val2; TarFlier tarFlier = val.AddComponent(); tarFlier.associatedController = this; } } } public void StartChargingAndSpawnProjectile() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (!charging && NetworkServer.active) { charging = true; FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = bigTarBallProjectile; val.position = tarBallTransform.position; val.rotation = Quaternion.identity; val.owner = ((Component)body).gameObject; val.damage = 4f * body.damage; val.crit = false; val.force = 0f; ((FireProjectileInfo)(ref val)).speedOverride = 0f; FireProjectileInfo val2 = val; EffectManager.SpawnEffect(explosionVFX, new EffectData { origin = tarBallTransform.position, rotation = Quaternion.identity, scale = 6f }, true); tarBallInstance = ProjectileManager.instance.FireProjectileImmediateServer(val2, (NetworkConnection)null, (ushort)0, 0.0); controller = tarBallInstance.GetComponent(); impact = tarBallInstance.GetComponent(); stick = tarBallInstance.GetComponent(); damageComponent = tarBallInstance.GetComponent(); bigTarBlob = tarBallInstance.GetComponent(); collider = tarBallInstance.GetComponent(); ((Behaviour)impact).enabled = false; stick.ignoreCharacters = true; stick.ignoreWorld = true; ((Behaviour)stick).enabled = false; ((Behaviour)bigTarBlob).enabled = false; ((Collider)collider).enabled = false; } } public void FixedUpdate() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (charging) { int num = (int)(percentageCharge * 100f); num = Mathf.Max(num, 1); body.SetBuffCount(chargeArmorBuff.buffIndex, num); } else if (body.GetBuffCount(chargeArmorBuff) > 0) { body.SetBuffCount(chargeArmorBuff.buffIndex, 0); } if ((Object)(object)tarBallInstance != (Object)null) { tarBallInstance.transform.position = tarBallTransform.position; percentageCharge = Mathf.Clamp01(percentageHealthTaken / maxPercentageHealthTaken); if ((Object)(object)controller != (Object)null && (Object)(object)controller.ghost != (Object)null) { controller.ghost.transform.localScale = Vector3.one * (2f + 3f * percentageCharge); } } } public void DetonateOnKill(DamageReport report) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown CharacterBody attackerBody = report.attackerBody; if (!((Object)(object)bigTarBlob == (Object)null)) { if ((Object)(object)attackerBody != (Object)null && (Object)(object)attackerBody.teamComponent != (Object)null) { float num = minRadius.Value + percentageCharge * (maxRadius.Value - minRadius.Value); TeamIndex teamIndex = attackerBody.teamComponent.teamIndex; float num2 = playerDetonateDamage.Value / 100f * attackerBody.damage; float num3 = 1f * attackerBody.damage; BlastAttack val = new BlastAttack(); val.radius = num; val.position = tarBallTransform.position; val.crit = (Object)(object)attackerBody != (Object)null && attackerBody.RollCrit(); val.baseDamage = (((int)teamIndex == 1) ? num2 : num3); val.inflictor = ((Component)attackerBody).gameObject; val.attacker = ((Component)attackerBody).gameObject; val.attackerFiltering = (AttackerFiltering)2; val.baseForce = 1000f + 4000f * percentageCharge; val.procCoefficient = 1f; val.teamIndex = teamIndex; val.damageType = new DamageTypeCombo { damageSource = (DamageSource)8, damageType = (DamageType)512 }; val.damageColorIndex = (DamageColorIndex)7; val.Fire(); EffectManager.SpawnEffect(explosionVFX, new EffectData { origin = tarBallTransform.position, scale = num }, true); } ((Behaviour)bigTarBlob).enabled = true; bigTarBlob.DestroySelf(); percentageHealthTaken = 0f; stick = null; impact = null; bigTarBlob = null; tarBallInstance = null; percentageCharge = 0f; charging = false; } } public void StopChargingAndLaunchProjectile(Vector3 velocity) { //IL_014c: Unknown result type (might be due to invalid IL or missing references) if (charging && (Object)(object)tarBallInstance != (Object)null && (Object)(object)body != (Object)null) { charging = false; ((Behaviour)impact).enabled = true; impact.destroyOnEnemy = false; impact.detonateOnEnemy = false; ((Behaviour)stick).enabled = true; stick.ignoreWorld = false; ((Behaviour)bigTarBlob).enabled = true; ((Collider)collider).enabled = true; bigTarBlob.chargePercentage = percentageCharge; float blastRadius = minRadius.Value + percentageCharge * (maxRadius.Value - minRadius.Value); float num = minDamage.Value / 100f + percentageCharge * (maxDamage.Value / 100f - minDamage.Value / 100f); ((ProjectileExplosion)impact).blastRadius = blastRadius; damageComponent.damage = num * body.damage; damageComponent.force = 1000f + 4000f * percentageCharge; tarBallInstance.GetComponent().velocity = velocity; tarBallInstance = null; percentageHealthTaken = 0f; stick = null; impact = null; bigTarBlob = null; percentageCharge = 0f; } } } public class TarFlier : MonoBehaviour { public ClayGrenadierChargeController associatedController; private TrailRenderer trailRenderer; private float trailSpeed = 20f; public void Start() { //IL_0090: 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) trailRenderer = ((Component)this).gameObject.AddComponent(); ((Renderer)trailRenderer).material = tarMaterial; ((Renderer)trailRenderer).materials = (Material[])(object)new Material[1] { tarMaterial }; trailRenderer.startWidth = 0.8f; trailRenderer.endWidth = 0.3f; trailRenderer.time = 0.2f; trailRenderer.emitting = true; ((Renderer)trailRenderer).enabled = true; trailRenderer.startColor = Color.black; trailRenderer.endColor = Color.black; } public void FixedUpdate() { //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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00aa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)trailRenderer != (Object)null && (Object)(object)associatedController != (Object)null) { Vector3 position = ((Component)this).gameObject.transform.position; Vector3 position2 = associatedController.tarBallTransform.position; float num = Vector3.Distance(position, position2); if (num < 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Vector3 val = position2 - position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 position3 = position + normalized * Time.fixedDeltaTime * trailSpeed; ((Component)this).gameObject.transform.position = position3; } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__27_2; public static Func <>9__27_3; public static Func <>9__27_4; public static Action <>9__27_1; public static Manipulator <>9__27_0; internal void b__27_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: 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) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetComponent"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2) })) { val.Emit(OpCodes.Dup); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(GameObject childObject, ProjectileExplosion projectileExplosion) { if ((Object)(object)projectileExplosion != (Object)null && (Object)(object)projectileExplosion.projectileController != (Object)null) { ProjectileBigTarBlob component = ((Component)projectileExplosion.projectileController).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { ProjectileTarZone component2 = childObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.chargePercentage = component.chargePercentage; } } } }); } else { Log.Error("ProjectileExplosion.FireChild ILCursor c1 failed to match!"); } } internal bool b__27_2(Instruction x) { return ILPatternMatchingExt.MatchDup(x); } internal bool b__27_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetComponent"); } internal bool b__27_4(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 2); } internal void b__27_1(GameObject childObject, ProjectileExplosion projectileExplosion) { if (!((Object)(object)projectileExplosion != (Object)null) || !((Object)(object)projectileExplosion.projectileController != (Object)null)) { return; } ProjectileBigTarBlob component = ((Component)projectileExplosion.projectileController).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { ProjectileTarZone component2 = childObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.chargePercentage = component.chargePercentage; } } } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierMaster_prefab).WaitForCompletion(); public static GameObject tarZoneProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_BeetleQueen.BeetleQueenAcid_prefab).WaitForCompletion(), "tarZoneProjectile"); public static GameObject tarZoneGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_BeetleQueen.BeetleQueenAcidGhost_prefab).WaitForCompletion(), "tarZoneGhost"); public static GameObject tarBubblesPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_ClayBoss.ChargeClayBossBombardment_prefab).WaitForCompletion(), "tarBubblesClone"); public static GameObject bigTarBallProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBarrelProjectile_prefab).WaitForCompletion(), "bigTarBallProjectile"); public static GameObject bigTarBallGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBarrelGhost_prefab).WaitForCompletion(), "bigTarBallGhost"); public static GameObject tarImpactEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_ClayBruiser.ClayShockwaveEffect_prefab).WaitForCompletion(), "scalableTarImpactEffect"); private static CharacterSpawnCard cscApothecary = Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.cscClayGrenadier_asset).WaitForCompletion(); private static GameObject chargeEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.OmniImpactVFXLarge_prefab).WaitForCompletion(); private static Material tarMaterial = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBoss.matGooTrail_mat).WaitForCompletion(); private static GameObject explosionVFX = Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBarrelExplosion_prefab).WaitForCompletion(); internal static ConfigEntry cooldown; internal static ConfigEntry minDamage; internal static ConfigEntry maxDamage; internal static ConfigEntry minRadius; internal static ConfigEntry maxRadius; internal static ConfigEntry healthPercentForFullCharge; internal static ConfigEntry healthThreshold; internal static ConfigEntry chargeTime; internal static ConfigEntry travelTime; internal static ConfigEntry fuseTime; internal static ConfigEntry playerDetonateDamage; internal static ConfigEntry dotZoneDamagePercent; internal static ConfigEntry dotDuration; private static BuffDef chargeArmorBuff; public override void RegisterConfig() { base.RegisterConfig(); minDamage = BindFloat("Deluge Min Damage", 100f, "Minimum damage coefficient at zero charge", 50f, 200f, 5f, PluginConfig.FormatType.Percentage); maxDamage = BindFloat("Deluge Max Damage", 200f, "Maximum damage coefficient at full charge", 250f, 800f, 5f, PluginConfig.FormatType.Percentage); minRadius = BindFloat("Deluge Min Radius", 10f, "Minimum explosion radius at zero charge", 6f, 12f, 0.1f, PluginConfig.FormatType.Distance); maxRadius = BindFloat("Deluge Max Radius", 24f, "Maximum explosion radius at full charge", 14f, 30f, 0.1f, PluginConfig.FormatType.Distance); dotZoneDamagePercent = BindFloat("Deluge AoE Damage Percentage", 5f, "The damage of the AoE per tick as a percentage of the Detonation's damage. This will naturally increase the more the tar ball is charged.", 1f, 20f, 1f, PluginConfig.FormatType.Percentage); healthPercentForFullCharge = BindFloat("Health Percentage for Full Charge", 25f, "The percentage of max health that must be taken as damage during charging to reach full charge", 5f, 50f, 1f, PluginConfig.FormatType.Percentage); healthThreshold = BindFloat("Deluge Health Threshold", 60f, "The health threshold the Apothecary must be under to use Tar Deluge.", 10f, 100f, 1f, PluginConfig.FormatType.Percentage); dotDuration = BindFloat("Deluge Zone Duration", 20f, "The duration of time that the Tar Zone lingers for.", 8f, 60f, 0.1f, PluginConfig.FormatType.Time); chargeTime = BindFloat("Deluge Charge Time", 3f, "The time that the Apothecary spends charging the Tar Ball before firing it.", 1f, 5f, 0.1f, PluginConfig.FormatType.Time); travelTime = BindFloat("Deluge Travel Time", 3f, "The time that the Tar Ball spends in the air before reaching it's target.", 1f, 5f, 0.1f, PluginConfig.FormatType.Time); fuseTime = BindFloat("Deluge Fuse Time", 1f, "The time that the Tar Ball takes to explode after landing.", 0.2f, 2f, 0.1f, PluginConfig.FormatType.Time); playerDetonateDamage = BindFloat("Player Detonation Damage", 800f, "The damage coefficient of the Tar Ball if it's detonated by a player (through killing the apothecary whilst it's charging - the tar ball cannot be killed once airborne).", 350f, 1600f, 5f, PluginConfig.FormatType.Percentage); cooldown = BindFloat("Deluge Cooldown", 30f, "The cooldown of the Tar Deluge ability", 15f, 60f, 0.1f, PluginConfig.FormatType.Time); BindStats(bodyPrefab, new List(1) { cscApothecary }, new StatOverrides { baseArmor = 10f, baseMaxHealth = 1200f, directorCost = 175f }); } public override void Initialise() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown base.Initialise(); CreateBuffDef(); SkillSetup(); ModifyTarZonePrefab(); ModifyBigTarBallPrefab(); bodyPrefab.AddComponent(); GlobalEventManager.onServerDamageDealt += ChargeTarBlob; GlobalEventManager.onCharacterDeathGlobal += ExplodeBlobOnDeath; tarImpactEffect.GetComponent().applyScale = true; ContentAddition.AddEffect(tarImpactEffect); object obj = <>c.<>9__27_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: 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) ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetComponent"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2) })) { val2.Emit(OpCodes.Dup); val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Action)delegate(GameObject childObject, ProjectileExplosion projectileExplosion) { if ((Object)(object)projectileExplosion != (Object)null && (Object)(object)projectileExplosion.projectileController != (Object)null) { ProjectileBigTarBlob component = ((Component)projectileExplosion.projectileController).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { ProjectileTarZone component2 = childObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.chargePercentage = component.chargePercentage; } } } }); } else { Log.Error("ProjectileExplosion.FireChild ILCursor c1 failed to match!"); } }; <>c.<>9__27_0 = val; obj = (object)val; } ProjectileExplosion.FireChild += (Manipulator)obj; } private void ExplodeBlobOnDeath(DamageReport damageReport) { //IL_001b: 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) if (damageReport == null) { return; } CharacterBody victimBody = damageReport.victimBody; if ((Object)(object)victimBody != (Object)null && victimBody.bodyIndex == BodyCatalog.FindBodyIndex(BodyPrefabs.ClayGrenadierBody)) { ClayGrenadierChargeController component = ((Component)victimBody).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.charging) { component.DetonateOnKill(damageReport); } } } private void ChargeTarBlob(DamageReport damageReport) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (damageReport == null) { return; } CharacterBody victimBody = damageReport.victimBody; if ((Object)(object)victimBody != (Object)null && victimBody.bodyIndex == BodyCatalog.FindBodyIndex(BodyPrefabs.ClayGrenadierBody)) { ClayGrenadierChargeController component = ((Component)victimBody).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.charging && damageReport.damageDealt > 0f && (Object)(object)victimBody.healthComponent != (Object)null) { float fullHealth = victimBody.healthComponent.fullHealth; float damageDealt = damageReport.damageDealt; float damagePercentage = damageDealt / fullHealth; component.IncreaseCharge(damagePercentage); } } } public void SkillSetup() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00e0: 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) EntityStateMachine val = CreateEntityStateMachine(bodyPrefab, "Weapon"); bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "ClayGrenadierBodyTarZone", skillName = "ClayGrenadierTarZone", esmName = val.customName, activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; SkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, skillDef, "ClayGrenadierSpecialFamily", (SkillSlot)3); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSpecial", skillSlot = (SkillSlot)3, requireReady = true, minDistance = 0f, maxDistance = 100f, maxHealthFraction = healthThreshold.Value / 100f, selectionRequiresTargetLoS = true, targetType = (TargetType)0, movementType = (MovementType)0, aimType = (AimType)2, desiredIndex = 0 }; CreateAISkillDriver(data2); } public void CreateBuffDef() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) Texture2D texture = EnemyAbilities.Instance.assetBundle.LoadAsset("texGrenadierShieldIcon"); chargeArmorBuff = ScriptableObject.CreateInstance(); chargeArmorBuff.stackingDisplayMethod = (StackingDisplayMethod)1; chargeArmorBuff.canStack = true; chargeArmorBuff.iconSprite = Utils.CreateSprite(texture); chargeArmorBuff.isHidden = false; ContentAddition.AddBuffDef(chargeArmorBuff); } public void ModifyTarZonePrefab() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) ProjectileController component = tarZoneProjectile.GetComponent(); component.ghostPrefab = tarZoneGhost; Transform component2 = tarZoneGhost.GetComponent(); component2.localScale = Vector3.one * 10f; component2.localPosition = new Vector3(0f, -0.5f, 0f); component2.localRotation = Quaternion.identity; Decal componentInChildren = tarZoneGhost.GetComponentInChildren(); Material material = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBruiser.matClayGooDecalSplat_mat).WaitForCompletion(); componentInChildren.Material = material; componentInChildren.Fade = 1.7f; tarZoneProjectile.AddComponent(); Transform component3 = ((Component)componentInChildren).gameObject.GetComponent(); component3.localRotation = Util.QuaternionSafeLookRotation(Vector3.up); ParticleSystem[] componentsInChildren = tarZoneGhost.GetComponentsInChildren(); for (int num = componentsInChildren.Length - 1; num >= 0; num--) { Object.Destroy((Object)(object)componentsInChildren[num]); } ParticleSystemRenderer[] componentsInChildren2 = tarZoneGhost.GetComponentsInChildren(); for (int num2 = componentsInChildren2.Length - 1; num2 >= 0; num2--) { Object.Destroy((Object)(object)componentsInChildren2[num2]); } Light componentInChildren2 = tarZoneGhost.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { Object.Destroy((Object)(object)componentInChildren2); } FlickerLight componentInChildren3 = tarZoneGhost.GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null) { Object.Destroy((Object)(object)componentInChildren3); } ProjectileDotZone component4 = tarZoneProjectile.GetComponent(); if ((Object)(object)component4 != (Object)null) { Object.Destroy((Object)(object)component4); } SyncFlickerLightToAnimateShaderAlpha componentInChildren4 = tarZoneGhost.GetComponentInChildren(); if ((Object)(object)componentInChildren4 != (Object)null) { Object.Destroy((Object)(object)componentInChildren4); } } public void ModifyBigTarBallPrefab() { //IL_0050: 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_00e4: Unknown result type (might be due to invalid IL or missing references) ProjectileController component = bigTarBallProjectile.GetComponent(); component.ghostPrefab = bigTarBallGhost; ProjectileSimple component2 = bigTarBallProjectile.GetComponent(); component2.lifetime = 12f; ProjectileImpactExplosion component3 = bigTarBallProjectile.GetComponent(); ((ProjectileExplosion)component3).blastRadius = 24f; ((ProjectileExplosion)component3).blastDamageCoefficient = 1f; ((ProjectileExplosion)component3).falloffModel = (FalloffModel)2; ((ProjectileExplosion)component3).childrenCount = 1; ((ProjectileExplosion)component3).childrenProjectilePrefab = tarZoneProjectile; ((ProjectileExplosion)component3).fireChildren = true; ((ProjectileExplosion)component3).childrenDamageCoefficient = dotZoneDamagePercent.Value / 100f; ((ProjectileExplosion)component3).preserveExplosionOrientation = false; ((ProjectileExplosion)component3).useChildRotation = true; component3.destroyOnWorld = false; component3.destroyOnEnemy = false; component3.impactOnWorld = true; component3.timerAfterImpact = true; component3.lifetimeAfterImpact = fuseTime.Value; component3.explodeOnLifeTimeExpiration = false; component3.lifetime = 20f; bigTarBallGhost.GetComponent().localScale = Vector3.one * 3f; Rigidbody component4 = bigTarBallProjectile.GetComponent(); component4.useGravity = false; ProjectileBigTarBlob projectileBigTarBlob = bigTarBallProjectile.AddComponent(); projectileBigTarBlob.gravityModifier = 0.5f; ProjectileStickOnImpact val = bigTarBallProjectile.AddComponent(); val.ignoreWorld = false; val.ignoreSteepSlopes = false; val.ignoreCharacters = false; val.alignNormals = false; } } } namespace EnemyAbilities.Abilities.ClayBruiser { [EnemyAbilities.ModuleInfo("Cluster Grenade", "Gives Clay Templars a new utility:\n- Cluster Grenade: Used when a Clay Templar has seen a player recently but doesn't have line of sight, fires a barrage of five Tar Grenades in an arc towards the player. This module also reduces the very long wind-downs on Clay Templar attacks.", "Clay Templar", true)] public class ClusterGrenadeModule : BaseModule { public static GameObject projectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Commando.CommandoGrenadeProjectile_prefab).WaitForCompletion(), "clayGrenadeProjectile"); private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBruiser.ClayBruiserBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBruiser.ClayBruiserMaster_prefab).WaitForCompletion(); private static GameObject ghostPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Commando.CommandoGrenadeGhost_prefab).WaitForCompletion(), "clayGrenadeProjectileGhost"); private static GameObject explosionPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_ClayGrenadier.ClayGrenadierBarrelExplosion_prefab).WaitForCompletion(); private static EntityStateConfiguration escMinigunSpinDown = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBruiser.EntityStates_ClayBruiser_Weapon_MinigunSpinDown_asset).WaitForCompletion(); private static EntityStateConfiguration escSonicBoom = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBruiser.EntityStates_ClayBruiser_Weapon_FireSonicBoom_asset).WaitForCompletion(); private static CharacterSpawnCard cscClayBruiser = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBruiser.cscClayBruiser_asset).WaitForCompletion(); internal static ConfigEntry grenadeCount; internal static ConfigEntry grenadeDamageCoeff; internal static ConfigEntry grenadeExplosionRadius; internal static ConfigEntry grenadeCooldown; public override void RegisterConfig() { base.RegisterConfig(); grenadeCount = BindFloat("Grenade Count", 5f, "The number of grenades the Templar fires on ability use.", 1f, 10f, 1f); grenadeCooldown = BindFloat("Grenade Cooldown", 10f, "Cooldown before the ability can activated again.", 5f, 30f, 0.1f, PluginConfig.FormatType.Time); grenadeDamageCoeff = BindFloat("Grenade Damage Coefficient", 100f, "Percentage multiplier to the Templar's Damage to get explosion damage. Uses falloff model sweet spot", 50f, 500f, 5f, PluginConfig.FormatType.Percentage); grenadeExplosionRadius = BindFloat("Grenade Explosion Radius", 6f, "Grenade Explosion radius in metres", 1f, 10f, 1f, PluginConfig.FormatType.Distance); BindStats(bodyPrefab, new List(1) { cscClayBruiser }); } public override void Initialise() { base.Initialise(); CreateSkill(); SetUpProjectilePrefab(); bodyPrefab.AddComponent(); Extensions.TryModifyFieldValue(escMinigunSpinDown, "baseDuration", 0.5f); Extensions.TryModifyFieldValue(escSonicBoom, "idealDistanceToPlaceTargets", 30f); Extensions.TryModifyFieldValue(escSonicBoom, "baseDuration", 0.5f); } private void SetUpProjectilePrefab() { //IL_0038: 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_0049: 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_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_0073: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) Rigidbody component = projectilePrefab.GetComponent(); ProjectileSimple component2 = projectilePrefab.GetComponent(); component2.lifetime = 10f; ProjectileController component3 = projectilePrefab.GetComponent(); SphereCollider component4 = projectilePrefab.GetComponent(); PhysicMaterial sharedMaterial = (((Collider)component4).material = new PhysicMaterial { bounciness = 0f, bounceCombine = (PhysicMaterialCombine)2, dynamicFriction = 400f, staticFriction = 400f, frictionCombine = (PhysicMaterialCombine)3 }); ((Collider)component4).sharedMaterial = sharedMaterial; MeshRenderer componentInChildren = ghostPrefab.GetComponentInChildren(); Material sharedMaterial2 = (((Renderer)componentInChildren).material = Addressables.LoadAssetAsync((object)RoR2_Base_Clay.matClayBubble_mat).WaitForCompletion()); ((Renderer)componentInChildren).sharedMaterial = sharedMaterial2; component3.ghostPrefab = ghostPrefab; ProjectileImpactExplosion component5 = projectilePrefab.GetComponent(); ((ProjectileExplosion)component5).blastRadius = grenadeExplosionRadius.Value; component5.impactEffect = explosionPrefab; ghostPrefab.GetComponent().localScale = Vector3.one * 2f; TrailRenderer val3 = ghostPrefab.AddComponent(); val3.time = 0.5f; val3.minVertexDistance = 0.1f; val3.startWidth = 0.5f; val3.endWidth = 0.1f; val3.emitting = true; val3.alignment = (LineAlignment)0; val3.textureMode = (LineTextureMode)0; ((Renderer)val3).material = Addressables.LoadAssetAsync((object)RoR2_Base_ClayBoss.matGooTrail_mat).WaitForCompletion(); } private void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "ClayBruiserBodyClusterGrenade", skillName = "ClayBruiserClusterGrenade", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = grenadeCooldown.Value, combatSkill = true }; ClusterGrenadeSkillDef skillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, (SkillDef)(object)skillDef, "ClayBruiserUtilityFamily", (SkillSlot)2); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "chaseAndUseUtility", skillSlot = (SkillSlot)2, requireReady = true, minDistance = 10f, maxDistance = 75f, selectionRequiresTargetLoS = false, aimType = (AimType)2, movementType = (MovementType)1, targetType = (TargetType)0, desiredIndex = 2 }; CreateAISkillDriver(data2); } } public class ClusterGrenadeSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { public ClayBruiserUtilityController controller; } public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { controller = ((Component)skillSlot.characterBody).GetComponent() }; } public override bool IsReady([NotNull] GenericSkill skillSlot) { InstanceData instanceData = skillSlot.skillInstanceData as InstanceData; if ((Object)(object)instanceData?.controller == (Object)null) { return false; } bool result = ((SkillDef)this).IsReady(skillSlot); if (!instanceData.controller.validArcFound || !instanceData.controller.recentlySawTarget || instanceData.controller.hasLoS) { return false; } return result; } } public class FireClusterGrenades : BaseSkillState { private float duration; private ClayBruiserUtilityController controller; private int grenadeCount = (int)ClusterGrenadeModule.grenadeCount.Value; private int grenadeIndex = 0; private float grenadeFireTimer = 0f; private float grenadeFireInterval; private static float baseGrenadeFireInterval = 0.15f; public override void OnEnter() { ((BaseState)this).OnEnter(); grenadeFireInterval = baseGrenadeFireInterval / ((BaseState)this).attackSpeedStat; duration = grenadeFireInterval * (float)grenadeCount; controller = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_00ba: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); grenadeFireTimer -= Time.fixedDeltaTime; if (grenadeFireTimer <= 0f && grenadeIndex < grenadeCount) { grenadeFireTimer += grenadeFireInterval; if ((Object)(object)controller.ai == (Object)null || controller.ai.currentEnemy == null || (Object)(object)controller.ai.currentEnemy.characterBody == (Object)null) { ((EntityState)this).outer.SetNextStateToMain(); return; } Vector3 val = controller.FindBallisticVelocity(((EntityState)this).characterBody.aimOrigin, controller.ai.currentEnemy.characterBody.transform.position, controller.currentLowestArcTime); Vector3 normalized = ((Vector3)(ref val)).normalized; float magnitude = ((Vector3)(ref val)).magnitude; Vector3 val2 = Vector3.zero; if (grenadeIndex != 0) { val2 = Random.insideUnitSphere * 0.025f; } if (((EntityState)this).isAuthority) { DamageTypeCombo val3 = default(DamageTypeCombo); val3.damageSource = (DamageSource)4; val3.damageType = (DamageType)512; DamageTypeCombo value = val3; Util.PlaySound("Play_clayBruiser_attack2_shoot", ((Component)((EntityState)this).characterBody).gameObject); ProjectileManager.instance.FireProjectile(ClusterGrenadeModule.projectilePrefab, ((EntityState)this).characterBody.aimOrigin, Util.QuaternionSafeLookRotation(normalized + val2), ((Component)((EntityState)this).characterBody).gameObject, ((BaseState)this).damageStat * (ClusterGrenadeModule.grenadeDamageCoeff.Value / 100f), 1000f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, magnitude, (DamageTypeCombo?)value); } grenadeIndex++; } if (((EntityState)this).fixedAge > duration && grenadeIndex == grenadeCount) { ((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 ClayBruiserUtilityController : MonoBehaviour { private CharacterBody bruiserBody; public BaseAI ai; private float arcCheckTimer = 0f; private static float arcCheckInterval = 0.25f; private SkillLocator skillLocator; public float currentLowestArcTime; public bool validArcFound; public Vector3 lowestArcVelocity; private static int travelTimeMin = 3; private static int travelTimeMax = 4; private static int travelTimeInterval = 1; private float timeSinceLastSawTarget = 0f; private static float maxTimeSinceLastSawTarget = 10f; public bool recentlySawTarget = false; public bool hasLoS = false; public void Awake() { bruiserBody = ((Component)this).GetComponent(); } public void Start() { if ((Object)(object)bruiserBody != (Object)null && (Object)(object)bruiserBody.master != (Object)null) { ai = ((Component)bruiserBody.master).GetComponent(); skillLocator = bruiserBody.skillLocator; } } public void FixedUpdate() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ai != (Object)null && ai.currentEnemy != null) { if (ai.currentEnemy.hasLoS) { hasLoS = true; timeSinceLastSawTarget = 0f; } else { hasLoS = false; timeSinceLastSawTarget += Time.fixedDeltaTime; } } recentlySawTarget = timeSinceLastSawTarget < maxTimeSinceLastSawTarget; arcCheckTimer -= Time.fixedDeltaTime; if (!(arcCheckTimer <= 0f)) { return; } bool flag = false; arcCheckTimer += arcCheckInterval; for (int i = travelTimeMin; i < travelTimeMax + 1; i += travelTimeInterval) { if (IsBallisticArcValid(i, out var launchVelocty)) { currentLowestArcTime = i; lowestArcVelocity = launchVelocty; flag = true; break; } } validArcFound = flag; } private bool IsBallisticArcValid(float time, out Vector3 launchVelocty) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_007a: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) launchVelocty = Vector3.zero; if ((Object)(object)ai == (Object)null || ai.currentEnemy == null || (Object)(object)ai.currentEnemy.characterBody == (Object)null) { return false; } Vector3 position = ai.currentEnemy.characterBody.transform.position; Vector3 aimOrigin = bruiserBody.aimOrigin; Vector3 startVelocity = (launchVelocty = FindBallisticVelocity(aimOrigin, position, time)); float num = 0.25f; RaycastHit val2 = default(RaycastHit); for (float num2 = 0f; num2 < time; num2 += num) { Vector3 arcPoint = GetArcPoint(aimOrigin, startVelocity, num2); Vector3 arcPoint2 = GetArcPoint(aimOrigin, startVelocity, Mathf.Min(num2 + num, time)); Vector3 val = arcPoint2 - arcPoint; Vector3 normalized = ((Vector3)(ref val)).normalized; float num3 = Vector3.Distance(arcPoint, arcPoint2); if (Physics.Raycast(arcPoint, normalized, ref val2, num3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return false; } } return true; } public Vector3 FindBallisticVelocity(Vector3 start, Vector3 target, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Vector3 gravity = Physics.gravity; Vector3 val = target - start; return val / time - 0.5f * gravity * time; } private Vector3 GetArcPoint(Vector3 startPosition, Vector3 startVelocity, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) return startPosition + time * startVelocity + 0.5f * Physics.gravity * Mathf.Pow(time, 2f); } } } namespace EnemyAbilities.Abilities.Bison { [EnemyAbilities.ModuleInfo("Unearth Boulder", "Gives Bison a new Secondary\n- Unearth Boulder: The Bison Unearths a large boulder nearby. When destroyed, the boulder explodes in a wide radius and launches 3 mini-boulders in a spread towards the nearest enemy of it's killer. Melee attacks from Bison break the boulder instantly. Activating this module causes Charge to activate from a longer range, and changes the max health damage needed to stun a Bison from 15% -> 30% to match Beetle Guards and Stone Golems.", "Bighorn Bison", true)] public class RockModule : BaseModule { public class SpawnRockSkillDef : SkillDef { private static float minDistanceFromAnotherRock = 5f; public override bool IsReady([NotNull] GenericSkill skillSlot) { //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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) CharacterBody characterBody = skillSlot.characterBody; if ((Object)(object)characterBody == (Object)null) { return false; } if (TryGetRockSpawnPosition(characterBody, out var rockSpawnPosition)) { List instancesList = InstanceTracker.GetInstancesList(); foreach (ProjectileMegaBisonRock item in instancesList) { Vector3 position = ((Component)item).transform.position; float num = Vector3.Distance(rockSpawnPosition, position); if (num < minDistanceFromAnotherRock) { return false; } } return ((SkillDef)this).IsReady(skillSlot); } return false; } } public class SpawnRock : BaseSkillState { private static float baseDuration = 0.25f; private float duration; public static float rockSpawnDistance = 10f; private static GameObject projectilePrefab = rockProjectile; public override void OnEnter() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (TryGetRockSpawnPosition(((EntityState)this).characterBody, out var rockSpawnPosition) && ((EntityState)this).isAuthority) { ProjectileManager.instance.FireProjectile(projectilePrefab, rockSpawnPosition, Util.QuaternionSafeLookRotation(Random.onUnitSphere), ((Component)((EntityState)this).characterBody).gameObject, 0f, 0f, false, (DamageColorIndex)0, (GameObject)null, 0f, (DamageTypeCombo?)DamageTypeCombo.op_Implicit((DamageType)0)); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } } public class ProjectileMegaBisonRock : MonoBehaviour, IProjectileImpactBehavior { private Rigidbody rigidbody; public HealthComponent healthComponent; private bool hit; private GameObject impactEffect = Addressables.LoadAssetAsync((object)RoR2_Base_BeetleQueen.BeetleQueenDeathImpact_prefab).WaitForCompletion(); private GameObject explosionEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.OmniExplosionVFX_prefab).WaitForCompletion(); public int childCount = (int)rockCount.Value; private float maxSpreadAngle = rockSpreadAngle.Value; public void Start() { rigidbody = ((Component)this).GetComponent(); healthComponent = ((Component)this).GetComponent(); } public void OnEnable() { InstanceTracker.Add(this); } public void OnDisable() { InstanceTracker.Remove(this); } public void OnProjectileImpact(ProjectileImpactInfo info) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (hit || (Object)(object)info.collider == (Object)null) { return; } HurtBox component = ((Component)info.collider).GetComponent(); if ((Object)(object)component != (Object)null || (Object)(object)rigidbody == (Object)null) { return; } hit = true; EffectManager.SpawnEffect(impactEffect, new EffectData { origin = ((Component)this).gameObject.transform.position, rotation = Quaternion.identity, scale = 1f }, true); rigidbody.velocity = Vector3.zero; rigidbody.angularVelocity = Vector3.zero; rigidbody.constraints = (RigidbodyConstraints)126; Util.PlaySound("Play_titanboss_step", ((Component)this).gameObject); ProjectileController component2 = ((Component)this).GetComponent(); if (!((Object)(object)component2 != (Object)null)) { return; } RotateAroundAxis[] componentsInChildren = ((Component)component2.ghost).GetComponentsInChildren(); RotateAroundAxis[] array = componentsInChildren; foreach (RotateAroundAxis val in array) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = false; } } } public void OnDeath(DamageReport report) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Expected O, but got Unknown Detonate(report); Object.Destroy((Object)(object)((Component)this).gameObject); EffectManager.SpawnEffect(explosionEffect, new EffectData { origin = ((Component)this).gameObject.transform.position, rotation = Quaternion.identity, scale = rockExplosionRadius.Value }, true); } private void Detonate(DamageReport report) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Invalid comparison between Unknown and I4 //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_01c3: 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_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Expected O, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = report.attackerBody; if ((Object)(object)attackerBody == (Object)null) { return; } TeamComponent component = ((Component)attackerBody).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return; } InputBankTest inputBank = attackerBody.inputBank; if (!((Object)(object)inputBank == (Object)null)) { Vector3 position = ((Component)this).gameObject.transform.position; Vector3 aimDirection = inputBank.aimDirection; TeamMask enemyTeams = TeamMask.GetEnemyTeams(component.teamIndex); ((TeamMask)(ref enemyTeams)).RemoveTeam((TeamIndex)0); BullseyeSearch val = new BullseyeSearch(); val.searchOrigin = position; val.searchDirection = aimDirection; val.maxAngleFilter = 60f; val.maxDistanceFilter = 100f; val.teamMaskFilter = enemyTeams; val.sortMode = (SortMode)1; val.RefreshCandidates(); List source = val.GetResults().ToList(); HurtBox val2 = source.Where((HurtBox hurtBox) => (Object)(object)hurtBox != (Object)null && (Object)(object)hurtBox.healthComponent != (Object)null && (Object)(object)hurtBox.healthComponent.body != (Object)null).FirstOrDefault(); bool flag = false; if ((Object)(object)val2 == (Object)null || (Object)(object)val2.healthComponent == (Object)null || (Object)(object)val2.healthComponent.body == (Object)null) { flag = true; } Vector3 val3 = ((Vector3)(ref aimDirection)).normalized + Vector3.up; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = 40f; if (!flag) { Vector3 position2 = val2.healthComponent.body.transform.position; Vector3 val4 = Trajectory.CalculateInitialVelocityFromTime(((Component)this).gameObject.transform.position, position2, rockTravelTime.Value, 0f, float.PositiveInfinity); num = ((Vector3)(ref val4)).magnitude; normalized = ((Vector3)(ref val4)).normalized; } DamageTypeCombo val5 = default(DamageTypeCombo); val5.damageType = (DamageType)0; val5.damageSource = (DamageSource)2; DamageTypeCombo val6 = val5; DamageAPI.AddModdedDamageType(ref val6, rockDamageType); float num2 = (((int)component.teamIndex == 1) ? rockPlayerDetonationBonus.Value : 1f); for (int i = 0; i < childCount; i++) { float num3 = maxSpreadAngle * 2f; float num4 = ((childCount > 1) ? (num3 / (float)(childCount - 1)) : 0f); float num5 = ((childCount > 1) ? (0f - maxSpreadAngle) : 0f); float num6 = num5 + num4 * (float)i; Vector3 val7 = Util.ApplySpread(normalized, 0f, 0f, 1f, 1f, num6, 0f); ProjectileManager.instance.FireProjectile(miniRockProjectile, ((Component)this).transform.position + new Vector3(0f, 1f, 0f), Util.QuaternionSafeLookRotation(val7), ((Component)attackerBody).gameObject, rockChildDamageCoeff.Value / 100f * attackerBody.damage * num2, 1000f, attackerBody.RollCrit(), (DamageColorIndex)0, (GameObject)null, num, (DamageTypeCombo?)val6); } BlastAttack val8 = new BlastAttack(); val8.position = ((Component)this).transform.position; val8.radius = rockExplosionRadius.Value; val8.attacker = ((Component)attackerBody).gameObject; val8.crit = attackerBody.RollCrit(); val8.procCoefficient = 1f; val8.attackerFiltering = (AttackerFiltering)2; val8.baseDamage = rockExplosionCoeff.Value / 100f * attackerBody.damage * num2; val8.baseForce = 2000f; val8.bonusForce = new Vector3(0f, 1000f, 0f); val8.damageColorIndex = (DamageColorIndex)0; val8.damageType = val6; val8.falloffModel = (FalloffModel)2; val8.procChainMask = default(ProcChainMask); val8.teamIndex = component.teamIndex; val8.Fire(); Object.Destroy((Object)(object)((Component)this).gameObject); Dictionary dictionary = new Dictionary { ["Drone1"] = "drone", ["Drone2"] = "drone2" }; } } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Bison.BisonBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Bison.BisonMaster_prefab).WaitForCompletion(); public static GameObject rockProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Grandparent.GrandparentBoulder_prefab).WaitForCompletion(), "bisonMegaBoulder"); public static GameObject rockGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Grandparent.GrandparentBoulderGhost_prefab).WaitForCompletion(), "bisonMegaBoulderGhost"); public static GameObject miniRockProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Grandparent.GrandparentBoulder_prefab).WaitForCompletion(), "bisonMiniBoulder"); public static GameObject miniRockGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Grandparent.GrandparentBoulderGhost_prefab).WaitForCompletion(), "bisonMiniBoulderGhost"); public static ModdedDamageType rockDamageType; private static CharacterSpawnCard cscBison = Addressables.LoadAssetAsync((object)RoR2_Base_Bison.cscBison_asset).WaitForCompletion(); internal static ConfigEntry rockCount; internal static ConfigEntry rockChildDamageCoeff; internal static ConfigEntry rockExplosionCoeff; internal static ConfigEntry rockTravelTime; internal static ConfigEntry rockExplosionRadius; internal static ConfigEntry rockChildExplosionRadius; internal static ConfigEntry rockMaxHealth; internal static ConfigEntry rockCooldown; internal static ConfigEntry rockSpreadAngle; internal static ConfigEntry rockPlayerDetonationBonus; public override void RegisterConfig() { base.RegisterConfig(); rockCount = BindFloat("Rock Count", 3f, "The number of rocks spawned.", 1f, 5f, 1f); rockChildDamageCoeff = BindFloat("Rock Fragment Damage Coefficient", 300f, "Damage coeff of the mini-boulders that get launched", 100f, 1000f, 5f, PluginConfig.FormatType.Percentage); rockExplosionCoeff = BindFloat("Rock Explosion Damage Coefficient", 400f, "Damage coeff of the explosion when the big rock is killed", 100f, 1000f, 5f, PluginConfig.FormatType.Percentage); rockTravelTime = BindFloat("Rock Time to Target", 1.25f, "Duration of time between the rock being destroyed and the mini rock(s) reaching it's target. Proportional to arc height", 0.5f, 5f, 0.01f, PluginConfig.FormatType.Time); rockExplosionRadius = BindFloat("Rock Explosion Radius", 16f, "Explosion radius of the big rock", 8f, 20f, 1f, PluginConfig.FormatType.Distance); rockChildExplosionRadius = BindFloat("Rock Fragment Explosion Radius", 8f, "Explosion radius of the rock fragments", 5f, 12f, 1f, PluginConfig.FormatType.Distance); rockCooldown = BindFloat("Rock Cooldown", 15f, "Cooldown before the ability can be activated again", 5f, 30f, 0.1f, PluginConfig.FormatType.Time); rockMaxHealth = BindFloat("Rock Health", 400f, "Max health of the rock at Level 1. Gains 30% of this value per level", 100f, 600f, 10f); rockSpreadAngle = BindFloat("Rock Spread Angle", 22f, "The total spread angle of rocks beyond 1 launched by this ability.", 10f, 50f, 1f); rockPlayerDetonationBonus = BindFloat("Rock Player Detonation Multiplier", 2.5f, "The damage multiplier applied to the rock if it is detonated by a player.", 1f, 4f, 0.1f, PluginConfig.FormatType.Multiplier); BindStats(bodyPrefab, new List(1) { cscBison }); } public override void Initialise() { //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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown base.Initialise(); CreateSkill(); ModifyProjectiles(); rockDamageType = DamageAPI.ReserveDamageType(); bodyPrefab.GetComponent().hitThreshold = 0.3f; HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(ModifyBisonDamageAgainstRock); GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeath; Utils.AddHealthOverride(delegate(float originalMaxHealth, CharacterBody body) { if ((Object)(object)body == (Object)null || (Object)(object)body.master != (Object)null) { return originalMaxHealth; } ProjectileMegaBisonRock component = ((Component)body).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return originalMaxHealth; } float num = rockMaxHealth.Value * 0.3f; float ambientLevel = Run.instance.ambientLevel; return rockMaxHealth.Value + num * (ambientLevel - 1f); }); } private void OnCharacterDeath(DamageReport report) { if (report != null && !((Object)(object)report.victim == (Object)null)) { ProjectileMegaBisonRock component = ((Component)report.victim).GetComponent(); if ((Object)(object)component != (Object)null) { component.OnDeath(report); } } } private void ModifyBisonDamageAgainstRock(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0030: 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_0064: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)self).GetComponent() != (Object)null && (Object)(object)damageInfo.attacker != (Object)null) { CharacterBody component = damageInfo.attacker.GetComponent(); if (component.bodyIndex == BodyPrefabs.BisonBody.bodyIndex) { damageInfo.damage = self.fullHealth; damageInfo.procCoefficient = 0f; } if (DamageAPI.HasModdedDamageType(ref damageInfo.damageType, rockDamageType)) { damageInfo.damage = 0f; damageInfo.procCoefficient = 0f; } } orig.Invoke(self, damageInfo); } private void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "BisonBodySpawnRock", skillName = "BisonSpawnRock", esmName = "Body", activationState = ContentAddition.AddEntityState(ref flag), cooldown = rockCooldown.Value, combatSkill = true }; SkillDef val = (SkillDef)(object)CreateSkillDef(data); CreateGenericSkill(bodyPrefab, val, "BisonSecondaryFamily", (SkillSlot)1); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSecondary", skillSlot = (SkillSlot)1, requiredSkillDef = val, requireReady = true, minDistance = 10f, maxDistance = 80f, selectionRequiresOnGround = true, aimType = (AimType)2, movementType = (MovementType)1, targetType = (TargetType)0, desiredIndex = 1 }; CreateAISkillDriver(data2); AISkillDriver val2 = (from driver in masterPrefab.GetComponents() where (int)driver.skillSlot == 2 select driver).FirstOrDefault(); if ((Object)(object)val2 != (Object)null) { val2.maxDistance = 80f; } else { Log.Error("Could not find charge driver!"); } } private void ModifyProjectiles() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_0171: 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_01b9: 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_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Expected O, but got Unknown //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) ProjectileController component = rockProjectile.GetComponent(); component.flightSoundLoop = null; component.ghostPrefab = rockGhost; rockGhost.GetComponent().localScale = Vector3.one * 0.75f; ProjectileImpactExplosion component2 = rockProjectile.GetComponent(); Object.DestroyImmediate((Object)(object)component2); ProjectileSimple component3 = rockProjectile.GetComponent(); component3.lifetime = 99f; component3.desiredForwardSpeed = 0f; Rigidbody component4 = rockProjectile.GetComponent(); component4.mass = 9999f; SphereCollider component5 = rockProjectile.GetComponent(); component5.radius = 1.5f; GameObject val = new GameObject(); val.transform.SetParent(rockProjectile.transform); Transform transform = val.transform; ModelLocator val2 = rockProjectile.AddComponent(); val2.modelTransform = transform; val2.autoUpdateModelTransform = true; val2.dontDetatchFromParent = true; val2.noCorpse = true; val2.dontReleaseModelOnDeath = false; val2.normalizeToFloor = false; val2.normalSmoothdampTime = 0.1f; val2.normalMaxAngleDelta = 90f; TeamComponent val3 = rockProjectile.AddComponent(); val3.hideAllyCardDisplay = true; val3.teamIndex = (TeamIndex)0; LanguageAPI.Add("SKELETOGNE_BISONROCK_BODY_NAME", "Bison Boulder"); CharacterBody val4 = rockProjectile.AddComponent(); val4.baseVisionDistance = float.PositiveInfinity; val4.sprintingSpeedMultiplier = 1.45f; val4.hullClassification = (HullClassification)0; val4.baseMaxHealth = rockMaxHealth.Value; val4.levelMaxHealth = rockMaxHealth.Value * 0.3f; val4.SetSpreadBloom(0f, true); val4.bodyFlags = (BodyFlags)(val4.bodyFlags | 0x80000); val4.baseNameToken = "SKELETOGNE_BISONROCK_BODY_NAME"; HealthComponent val5 = rockProjectile.AddComponent(); val5.body = val4; val5.dontShowHealthbar = false; val5.globalDeathEventChanceCoefficient = 1f; GameObject val6 = new GameObject(); val6.transform.SetParent(val2.modelTransform); SphereCollider val7 = val6.AddComponent(); ((Collider)val7).isTrigger = true; ((Collider)val7).contactOffset = 0.01f; val7.radius = 3f; ((Collider)val7).sharedMaterial = Addressables.LoadAssetAsync((object)RoR2_Base_Common.physmatSuperFriction_physicMaterial).WaitForCompletion(); ((Collider)val7).material = ((Collider)val7).sharedMaterial; HurtBox val8 = val6.gameObject.AddComponent(); if ((Object)(object)val8 == (Object)null) { Log.Error("hurtBox is null"); } if ((Object)(object)((Component)val8).gameObject == (Object)null) { Log.Error("hurtBox.gameObject == null"); } ((Component)val8).gameObject.layer = LayerIndex.entityPrecise.intVal; val8.healthComponent = val5; val8.isBullseye = true; val8.isSniperTarget = false; val8.damageModifier = (DamageModifier)0; val8.collider = (Collider)(object)val7; val8.hurtBoxGroup = ((Component)val2.modelTransform).gameObject.AddComponent(); val8.hurtBoxGroup.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val8 }; val8.hurtBoxGroup.mainHurtBox = val8; val8.hurtBoxGroup.bullseyeCount = 1; val4.hurtBoxGroup = val8.hurtBoxGroup; DisableCollisionsBetweenColliders val9 = rockProjectile.AddComponent(); val9.collidersA = (Collider[])(object)new Collider[1] { (Collider)rockProjectile.GetComponent() }; val9.collidersB = (Collider[])(object)new Collider[1] { (Collider)val7 }; ProjectileMegaBisonRock projectileMegaBisonRock = rockProjectile.AddComponent(); ProjectileImpactExplosion component6 = miniRockProjectile.GetComponent(); ((ProjectileExplosion)component6).fireChildren = false; ((ProjectileExplosion)component6).childrenCount = 0; ((ProjectileExplosion)component6).blastRadius = rockChildExplosionRadius.Value; ProjectileController component7 = miniRockProjectile.GetComponent(); component7.ghostPrefab = miniRockGhost; miniRockGhost.GetComponent().localScale = Vector3.one * 0.4f; SphereCollider component8 = miniRockProjectile.GetComponent(); component8.radius = 0.75f; Transform[] componentsInChildren = miniRockGhost.GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val10 in array) { if (((Object)((Component)val10).gameObject).name == "Rotator") { SetRandomRotation val11 = ((Component)val10).gameObject.AddComponent(); val11.setRandomXRotation = true; val11.setRandomYRotation = true; val11.setRandomZRotation = true; } } } public static bool TryGetRockSpawnPosition(CharacterBody bisonBody, out Vector3 rockSpawnPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00e8: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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) rockSpawnPosition = Vector3.zero; if ((Object)(object)bisonBody == (Object)null) { return false; } Vector3 position = bisonBody.transform.position; Vector3 val = bisonBody.transform.forward; val.y = 0f; ((Vector3)(ref val)).Normalize(); CharacterMaster master = bisonBody.master; if ((Object)(object)master != (Object)null) { BaseAI component = ((Component)master).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.currentEnemy != null && (Object)(object)component.currentEnemy.characterBody != (Object)null) { Vector3 position2 = component.currentEnemy.characterBody.transform.position; Vector3 val2 = position2 - position; val2.y = 0f; val = ((Vector3)(ref val2)).normalized; } } Vector3 val3 = bisonBody.transform.position + val * SpawnRock.rockSpawnDistance + new Vector3(0f, 15f, 0f); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, Vector3.down, ref val4, 30f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { rockSpawnPosition = ((RaycastHit)(ref val4)).point + new Vector3(0f, 2f, 0f); return true; } return false; } } } namespace EnemyAbilities.Abilities.Bell { [EnemyAbilities.ModuleInfo("Explosive Toll", "Gives Brass Contraptions a new Special ability:\n-Explosive Toll: Brass Contraptions can remotely detonate nearby embedded spike-balls, sending out a signal that causes them to explode after a brief delay.", "Brass Contraption", true)] public class RemoteDetonationModule : BaseModule { public class RemoteDetonationSkillDef : SkillDef { public override bool IsReady([NotNull] GenericSkill skillSlot) { CharacterBody characterBody = skillSlot.characterBody; if ((Object)(object)characterBody == (Object)null) { return false; } List instancesList = InstanceTracker.GetInstancesList(); if (!instancesList.Any()) { return false; } if (((SkillDef)this).IsReady(skillSlot)) { int num = 0; foreach (ProjectileBellRemoteDetonation item in instancesList) { if (BombIsValidForDetonation(characterBody, item)) { num++; if (num >= 3) { return true; } } } } return false; } } public class RemoteDetonation : BaseSkillState { private static float baseDuration = detonateBellWarningDuration.Value; public static float detonationRange = detonateRange.Value; private float duration; private GameObject effectInstance; private EffectManagerHelper _emh_effectInstance; private List reservedBombs = new List(); private bool signalSent; private static int maxBombsToDetonate = (int)detonateMaxBombsToDetonate.Value; public override void OnEnter() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; Util.PlaySound((!tacoBell.Value) ? "Play_bell_attack2_warning" : "Play_bell_attack2_warning_taco", ((EntityState)this).gameObject); if (!EffectManager.ShouldUsePooledEffect(bellDetonateUseEffect)) { effectInstance = Object.Instantiate(bellDetonateUseEffect, ((EntityState)this).characterBody.corePosition, Quaternion.identity); } else { _emh_effectInstance = EffectManager.GetAndActivatePooledEffect(bellDetonateUseEffect, ((EntityState)this).characterBody.corePosition, Quaternion.identity); effectInstance = ((Component)_emh_effectInstance).gameObject; } effectInstance.transform.parent = ((EntityState)this).characterBody.coreTransform; List instancesList = InstanceTracker.GetInstancesList(); if (!instancesList.Any()) { Log.Error("No detonation components!"); ((EntityState)this).outer.SetNextStateToMain(); return; } List list = new List(); foreach (ProjectileBellRemoteDetonation item in instancesList) { if (BombIsValidForDetonation(((EntityState)this).characterBody, item)) { list.Add(item); } } Vector3 targetPosition = ((EntityState)this).characterBody.corePosition; if ((Object)(object)((EntityState)this).characterBody.master != (Object)null) { BaseAI component = ((Component)((EntityState)this).characterBody.master).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.currentEnemy.characterBody != (Object)null) { targetPosition = component.currentEnemy.characterBody.corePosition; } } IEnumerable enumerable = list.OrderBy((ProjectileBellRemoteDetonation bomb) => Vector3.Distance(targetPosition, ((Component)bomb).transform.position)).Take(maxBombsToDetonate); foreach (ProjectileBellRemoteDetonation item2 in enumerable) { reservedBombs.Add(item2); item2.ReserveBomb(); } } public override void OnExit() { ((EntityState)this).OnExit(); if ((Object)(object)effectInstance != (Object)null) { if ((Object)(object)_emh_effectInstance != (Object)null && _emh_effectInstance.OwningPool != null) { _emh_effectInstance.ReturnToPool(); _emh_effectInstance = null; } else { EntityState.Destroy((Object)(object)effectInstance); } } if (signalSent) { return; } foreach (ProjectileBellRemoteDetonation reservedBomb in reservedBombs) { reservedBomb?.RemoveReservation(); } } public override void FixedUpdate() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!(((EntityState)this).fixedAge > duration)) { return; } foreach (ProjectileBellRemoteDetonation reservedBomb in reservedBombs) { if (!((Object)(object)reservedBomb == (Object)null)) { reservedBomb.SignalBomb(); GameObject val = new GameObject(); val.transform.position = ((EntityState)this).characterBody.corePosition; BellPrimerFlier bellPrimerFlier = val.AddComponent(); bellPrimerFlier.targetTransform = ((Component)reservedBomb).transform; signalSent = true; } } Util.PlaySound("Play_mage_m1_cast_lightning", ((EntityState)this).gameObject); ((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 ChargeTrioBombWithInterruptPriority : ChargeTrioBomb { 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 ProjectileBellRemoteDetonation : MonoBehaviour { public enum BombState { Free, Reserved, Signaled, Primed } public ProjectileStickOnImpact stick; public BombState state; private Vector3 startPosition; private Vector3 targetPosition; private static float explodeHeight = 3f; private static float explosionDelay = detonatePrimeWarningDuration.Value; private float explosionStopwatch; private static GameObject indicatorPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Common.TeamAreaIndicator__FullSphere_prefab).WaitForCompletion(); private static GameObject explosionPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC2_Chef.BoostedSearFireballProjectileExplosionVFX_prefab).WaitForCompletion(); private GameObject indicatorInstance; private static float explosionRadius = detonateExplosionRaidus.Value; private static float primeDelay = 0.2f; private float primeTimer; public TeamFilter filter; private ProjectileController controller; private ProjectileDamage projectileDamage; private GameObject chargeInstance; private float bellDamage = 0f; private static float damageCoefficient = detonateDamageCoefficient.Value / 100f; private DestroyOnTimer destroyOnTimer; private ProjectileSimple projectileSimple; private static float lifetimeExtensionOnReserve = 10f; public void Start() { stick = ((Component)this).GetComponent(); filter = ((Component)this).GetComponent(); controller = ((Component)this).GetComponent(); projectileDamage = ((Component)this).GetComponent(); destroyOnTimer = ((Component)this).GetComponent(); projectileSimple = ((Component)this).GetComponent(); if ((Object)(object)controller != (Object)null) { CharacterBody component = controller.owner.GetComponent(); if ((Object)(object)component != (Object)null) { bellDamage = component.damage; } } state = BombState.Free; } public void OnEnable() { InstanceTracker.Add(this); } public void OnDisable() { InstanceTracker.Remove(this); if ((Object)(object)indicatorInstance != (Object)null) { Object.Destroy((Object)(object)indicatorInstance); } if ((Object)(object)chargeInstance != (Object)null) { Object.Destroy((Object)(object)chargeInstance); } } public void SignalBomb() { state = BombState.Signaled; } public void RemoveReservation() { state = BombState.Free; } public void ReserveBomb() { state = BombState.Reserved; if ((Object)(object)destroyOnTimer != (Object)null) { DestroyOnTimer obj = destroyOnTimer; obj.duration += lifetimeExtensionOnReserve; } if ((Object)(object)projectileSimple != (Object)null) { ProjectileSimple obj2 = projectileSimple; obj2.lifetime += lifetimeExtensionOnReserve; } } public void Prime() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0051: 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_0074: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) if (state == BombState.Primed) { return; } state = BombState.Primed; startPosition = ((Component)this).transform.position; targetPosition = ((Component)this).transform.position + new Vector3(0f, explodeHeight, 0f); ((Behaviour)stick).enabled = false; indicatorInstance = Object.Instantiate(indicatorPrefab, ((Component)this).transform.position, Quaternion.identity); if ((Object)(object)indicatorInstance != (Object)null) { TeamAreaIndicator component = indicatorInstance.GetComponent(); component.teamFilter = ((Component)this).GetComponent(); ((Component)component).transform.localScale = Vector3.one * 5f; ((Component)component).transform.SetParent(((Component)this).transform); } ProjectileController component2 = ((Component)this).GetComponent(); if (!((Object)(object)component2 != (Object)null) || !((Object)(object)component2.ghost != (Object)null)) { return; } ProjectileGhostController ghost = component2.ghost; if (!((Object)(object)((Component)ghost).gameObject.GetComponent() != (Object)null)) { ObjectScaleCurve val = ((Component)ghost).gameObject.AddComponent(); val.overallCurve = new AnimationCurve(); for (int i = 0; i < 11; i++) { float num = 0.1f * (float)i; float num2 = 1f + 0.5f * (num * num); val.overallCurve.AddKey(num, num2); } val.timeMax = primeDelay + explosionDelay; val.useOverallCurveOnly = true; RotateAroundAxis val2 = ((Component)this).gameObject.AddComponent(); val2.speed = (Speed)2; val2.fastRotationSpeed = 720f; val2.rotateAroundAxis = (RotationAxis)(Random.RandomRangeInt(0, 3) switch { 1 => 1, 0 => 0, _ => 2, }); val2.relativeTo = (Space)1; chargeInstance = Object.Instantiate(chargeEffect, ((Component)this).transform.position, ((Component)this).transform.rotation); } } public void FixedUpdate() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) if (state != BombState.Primed) { return; } chargeInstance.transform.position = ((Component)this).transform.position; if (primeTimer <= primeDelay) { primeTimer += Time.fixedDeltaTime; return; } explosionStopwatch += Time.fixedDeltaTime; float num = Mathf.Clamp01(explosionStopwatch / explosionDelay); float num2 = Mathf.Pow(num, 0.4f); Vector3 position = Vector3.Lerp(startPosition, targetPosition, num2); ((Component)this).transform.position = position; if (explosionStopwatch > explosionDelay) { BlastAttack val = new BlastAttack { attacker = controller.owner, inflictor = controller.owner, teamIndex = filter.teamIndex, attackerFiltering = (AttackerFiltering)0, position = ((Component)this).transform.position, radius = explosionRadius, falloffModel = (FalloffModel)2, baseDamage = bellDamage * damageCoefficient, baseForce = 3000f, crit = projectileDamage.crit, damageType = projectileDamage.damageType, damageColorIndex = projectileDamage.damageColorIndex, procChainMask = default(ProcChainMask), procCoefficient = 1f }; if (NetworkServer.active) { val.Fire(); } EffectManager.SpawnEffect(explosionPrefab, new EffectData { origin = ((Component)this).transform.position, rotation = ((Component)this).transform.rotation, scale = explosionRadius }, true); Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class BellPrimerFlier : MonoBehaviour { public Transform targetTransform; private TrailRenderer renderer; private static Material trailMaterial = Addressables.LoadAssetAsync((object)RoR2_Base_LunarGolem.matLunarGolemShieldTrails_mat).WaitForCompletion(); private static float trailTime = 0.3f; private static float trailSpeed = detonateFlierSpeed.Value; private bool madePrimeAttempt = false; private float postArrivalTimer; private float stopwatch; public void Start() { renderer = ((Component)this).gameObject.AddComponent(); ((Renderer)renderer).material = trailMaterial; ((Renderer)renderer).materials = (Material[])(object)new Material[1] { trailMaterial }; renderer.startWidth = 0.4f; renderer.endWidth = 0.2f; renderer.time = trailTime; renderer.emitting = true; ((Renderer)renderer).enabled = true; } public void FixedUpdate() { //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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) if ((Object)(object)targetTransform == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } stopwatch += Time.fixedDeltaTime; Vector3 position = ((Component)this).transform.position; Vector3 position2 = targetTransform.position; Vector3 val = position2 - position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = position + normalized * trailSpeed * Time.fixedDeltaTime; ((Component)this).transform.position = val2; float num = Vector3.Distance(val2, position2); if (num < 1f && !madePrimeAttempt) { madePrimeAttempt = true; ProjectileBellRemoteDetonation component = ((Component)targetTransform).gameObject.GetComponent(); if (component.state == ProjectileBellRemoteDetonation.BombState.Signaled) { component.Prime(); } } if (stopwatch > 5f) { if ((Object)(object)targetTransform != (Object)null) { ProjectileBellRemoteDetonation component2 = ((Component)targetTransform).gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null && component2.state == ProjectileBellRemoteDetonation.BombState.Signaled) { component2.RemoveReservation(); } } Object.Destroy((Object)(object)((Component)this).gameObject); } else if (madePrimeAttempt) { postArrivalTimer += Time.fixedDeltaTime; if (postArrivalTimer > trailTime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Bell.BellBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Bell.BellMaster_prefab).WaitForCompletion(); private static CharacterSpawnCard cscBell = Addressables.LoadAssetAsync((object)RoR2_Base_Bell.cscBell_asset).WaitForCompletion(); private static GameObject bellProjectile = Addressables.LoadAssetAsync((object)RoR2_Base_Bell.BellBall_prefab).WaitForCompletion(); private static GameObject bellProjectileGhost = Addressables.LoadAssetAsync((object)RoR2_Base_Bell.BellBallGhost_prefab).WaitForCompletion(); private static GameObject bellDetonateUseEffect = Addressables.LoadAssetAsync((object)RoR2_Base_DeathProjectile.DeathProjectileTickEffect_prefab).WaitForCompletion(); private static GameObject fusionCellObject = Addressables.LoadAssetAsync((object)RoR2_Base_FusionCellDestructible.FusionCellDestructibleBody_prefab).WaitForCompletion(); private static SkillDef bellSkill = Addressables.LoadAssetAsync((object)RoR2_Base_Bell.BellBodyBellBlast_asset).WaitForCompletion(); private static GameObject chargeEffect; private static ConfigEntry tacoBell; private static ConfigEntry detonateCooldown; private static ConfigEntry detonateMaxBombsToDetonate; private static ConfigEntry detonateRange; private static ConfigEntry detonateFlierSpeed; private static ConfigEntry detonateBellWarningDuration; private static ConfigEntry detonatePrimeWarningDuration; private static ConfigEntry detonateExplosionRaidus; private static ConfigEntry detonateDamageCoefficient; public override void RegisterConfig() { base.RegisterConfig(); detonateCooldown = BindFloat("Toll Cooldown", 10f, "The cooldown of the Explosive Toll ability.", 5f, 30f, 0.1f, PluginConfig.FormatType.Time); detonateMaxBombsToDetonate = BindFloat("Toll Max Detonations", 5f, "The maximum number of spiked bombs that the ability can detonate per use.", 1f, 20f, 1f); detonateRange = BindFloat("Toll Max Range", 60f, "The max distance that a Brass Contraption can detonate a bomb at. This is also the distance that the Brass Contraption will attempt to use the ability.", 30f, 100f, 1f, PluginConfig.FormatType.Distance); detonateFlierSpeed = BindFloat("Toll Signal Speed", 60f, "The speed of the signal sent from Brass Contraptions to the bomb. The faster the signal travels, the sooner the bombs will activate.", 20f, 120f, 1f, PluginConfig.FormatType.Speed); detonateBellWarningDuration = BindFloat("Toll Warning Duration", 1f, "The duration of time between the Brass Contraption tolling and it sending out the bomb signals.", 0.5f, 3f, 0.1f, PluginConfig.FormatType.Time); detonatePrimeWarningDuration = BindFloat("Toll Bomb Prime Duration", 1f, "The duration of time between a signal arriving at a bomb, and the bomb exploding.", 0.5f, 3f, 0.1f, PluginConfig.FormatType.Time); detonateExplosionRaidus = BindFloat("Toll Explosion Radius", 8f, "The radius of the bomb explosion.", 4f, 12f, 0.1f, PluginConfig.FormatType.Distance); detonateDamageCoefficient = BindFloat("Toll Damage Coefficient", 300f, "The damage coefficient of the explosion.", 100f, 500f, 5f, PluginConfig.FormatType.Percentage); tacoBell = BindBool("Taco Bell", defaultValue: false, "Don't."); BindStats(bodyPrefab, new List(1) { cscBell }, new StatOverrides { baseMaxHealth = 380f }); } public override void Initialise() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) base.Initialise(); CreateSkill(); SetUpProjectile(); Transform[] componentsInChildren = fusionCellObject.GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val in array) { if (((Object)((Component)val).gameObject).name == "Mesh") { ChildLocator component = ((Component)val).gameObject.GetComponent(); Transform val2 = component.FindChild("Charge"); if ((Object)(object)val2 != (Object)null) { chargeEffect = PrefabAPI.InstantiateClone(((Component)val2).gameObject, "bellBombChargeEffect"); chargeEffect.transform.localPosition = Vector3.zero; chargeEffect.gameObject.SetActive(true); } } } bool flag = default(bool); bellSkill.activationState = ContentAddition.AddEntityState(ref flag); } public void SetUpProjectile() { ProjectileImpactExplosion component = bellProjectile.GetComponent(); Object.DestroyImmediate((Object)(object)component); ProjectileSimple component2 = bellProjectile.GetComponent(); component2.lifetime = 20f; DestroyOnTimer component3 = bellProjectile.GetComponent(); component3.duration = 20f; ObjectScaleCurve componentInChildren = bellProjectileGhost.GetComponentInChildren(); Object.DestroyImmediate((Object)(object)componentInChildren); ProjectileBellRemoteDetonation projectileBellRemoteDetonation = bellProjectile.AddComponent(); } private void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "BellBodyRemoteDetonation", skillName = "BellRemoteDetonation", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = detonateCooldown.Value, combatSkill = true }; RemoteDetonationSkillDef remoteDetonationSkillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, (SkillDef)(object)remoteDetonationSkillDef, "BellSpecialFamily", (SkillSlot)3); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSpecial", skillSlot = (SkillSlot)3, requiredSkillDef = (SkillDef)(object)remoteDetonationSkillDef, requireReady = true, minDistance = 0f, maxDistance = detonateRange.Value, aimType = (AimType)2, movementType = (MovementType)1, targetType = (TargetType)0, desiredIndex = 0 }; CreateAISkillDriver(data2); } public static bool BombIsValidForDetonation(CharacterBody bellBody, ProjectileBellRemoteDetonation detonationComponent) { //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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_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) if ((Object)(object)bellBody == (Object)null || (Object)(object)bellBody.healthComponent == (Object)null || !bellBody.healthComponent.alive) { return false; } if ((Object)(object)detonationComponent == (Object)null || detonationComponent.state != 0) { return false; } Vector3 corePosition = bellBody.corePosition; Vector3 position = ((Component)detonationComponent).transform.position; float num = Vector3.Distance(corePosition, position); if (num > RemoteDetonation.detonationRange) { return false; } TeamFilter filter = detonationComponent.filter; TeamComponent teamComponent = bellBody.teamComponent; if ((Object)(object)filter == (Object)null || (Object)(object)bellBody.teamComponent == (Object)null || filter.teamIndex != bellBody.teamComponent.teamIndex) { return false; } if ((Object)(object)detonationComponent.stick == (Object)null || !detonationComponent.stick.stuck) { return false; } return true; } } } namespace EnemyAbilities.Abilities.Beetle { [EnemyAbilities.ModuleInfo("Beetle Swarm", "Gives Beetles a new Special ability:\n-Summon Reinforcements: This allows lonely beetles to call out for aid, causing them to spawn beetles nearby until they have a bigger group. Also grants Beetles a new passive, Strength in Numbers, which gives them bonus stats dependent on the number of nearby Beetles, Beetle Guards and Queens. Also grants a lunge to their Headbutt attack, which can also scale with Strength in Numbers.", "Beetle", true)] public class BeetleSwarmModule : BaseModule { public class BeetleHeadbuttLeap : HeadbuttState { private bool hitBoxActive; public static float baseHeadbuttDistance = lungeBaseDistance.Value; public static float headButtDistancePerBeetle = lungeBonusDistancePerBuffStack.Value; public override void OnEnter() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_0116: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) ((HeadbuttState)this).OnEnter(); CharacterBody characterBody = ((EntityState)this).characterBody; if ((Object)(object)characterBody == (Object)null) { return; } CharacterMaster master = characterBody.master; if ((Object)(object)master == (Object)null) { return; } BaseAI component = ((Component)master).gameObject.GetComponent(); if ((Object)(object)component == (Object)null || component.currentEnemy == null || (Object)(object)component.currentEnemy.characterBody == (Object)null) { return; } CharacterMotor characterMotor = characterBody.characterMotor; if (!((Object)(object)characterMotor == (Object)null)) { Vector3 val = component.currentEnemy.characterBody.corePosition; Vector3 corePosition = characterBody.corePosition; float num = Vector3.Distance(val, corePosition); float maxDistance = baseHeadbuttDistance; AISkillDriver val2 = (from driver in ((Component)master).GetComponents() where driver.customName == "HeadbuttOffNodegraph" select driver).FirstOrDefault(); if ((Object)(object)val2 != (Object)null) { maxDistance = val2.maxDistance; } if (num < maxDistance) { Vector3 val3 = val - corePosition; Vector3 normalized = ((Vector3)(ref val3)).normalized; val = corePosition + normalized * maxDistance; } float num2 = 0.5f / characterBody.attackSpeed; Vector3 val4 = (characterMotor.velocity = Trajectory.CalculateInitialVelocityFromTime(corePosition, val, num2, 0f, float.PositiveInfinity)); ((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f); EffectManager.SpawnEffect(jumpEffect, new EffectData { origin = corePosition, rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref val4)).normalized) }, false); } } public override void FixedUpdate() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) ((HeadbuttState)this).FixedUpdate(); if ((Object)(object)base.modelAnimator != (Object)null && base.modelAnimator.GetFloat("Headbutt.hitBoxActive") > 0.5f && !hitBoxActive) { hitBoxActive = true; if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } } } public override void OnExit() { ((EntityState)this).OnExit(); } 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 SwarmSkillDef : SkillDef { public override bool IsReady([NotNull] GenericSkill skillSlot) { if (((SkillDef)this).IsReady(skillSlot)) { CharacterBody characterBody = skillSlot.characterBody; if ((Object)(object)characterBody != (Object)null) { BeetleSwarmController component = ((Component)characterBody).GetComponent(); if ((Object)(object)component != (Object)null && component.CanUseSummon) { return true; } } return false; } return false; } } public class BeetleSwarm : BaseSkillState { private static float baseDurationTilSummon = 2f; private static float baseDurationAfterSummon = 2f; private float durationTilSummon; private float durationAfterSummon; private float totalDuration; private bool performedSummon; private BeetleSwarmController ownerController; public static float chanceToPropagateInventory = summonInventoryCloneChance.Value / 100f; private static GameObject summonEffect = Addressables.LoadAssetAsync((object)RoR2_Base_DeathProjectile.DeathProjectileTickEffect_prefab).WaitForCompletion(); public override void OnEnter() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_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_00a9: Expected O, but got Unknown ((BaseState)this).OnEnter(); Util.PlayAttackSpeedSound("Play_beetle_worker_attack", ((EntityState)this).gameObject, 0.8f); ((EntityState)this).PlayAnimation("Body", "EmoteSurprise"); durationTilSummon = baseDurationTilSummon / ((BaseState)this).attackSpeedStat; durationAfterSummon = baseDurationAfterSummon / ((BaseState)this).attackSpeedStat; totalDuration = durationTilSummon + durationAfterSummon; ownerController = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); EffectManager.SpawnEffect(summonEffect, new EffectData { origin = ((EntityState)this).characterBody.corePosition, rotation = Quaternion.identity }, true); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > durationTilSummon && !performedSummon) { performedSummon = true; SummonAlly(); } if (((EntityState)this).fixedAge > totalDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public void SummonAlly() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) MasterSummon val = new MasterSummon(); val.summonerBodyObject = ((Component)((EntityState)this).characterBody).gameObject; val.masterPrefab = masterPrefab; Vector3 position = ((EntityState)this).characterBody.transform.position; NodeGraph groundNodes = SceneInfo.instance.groundNodes; List list = groundNodes.FindNodesInRange(((EntityState)this).characterBody.transform.position, 0f, 20f, (HullMask)1); if (list != null && list.Count > 0) { int count = list.Count; int index = Random.RandomRangeInt(0, count - 1); NodeIndex val2 = list[index]; groundNodes.GetNodePosition(val2, ref position); } val.position = position; val.rotation = ((EntityState)this).characterBody.transform.rotation; val.ignoreTeamMemberLimit = true; val.inventoryToCopy = ((Random.value <= chanceToPropagateInventory) ? ((EntityState)this).characterBody.inventory : null); val.teamIndexOverride = ((EntityState)this).characterBody.teamComponent.teamIndex; CharacterMaster val3 = val.Perform(); if (!((Object)(object)val3 != (Object)null)) { return; } CharacterBody body = val3.GetBody(); if ((Object)(object)body != (Object)null) { BeetleSwarmController component = ((Component)body).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)ownerController != (Object)null) { component.recursionDepth = ownerController.recursionDepth + 1; } DeathRewards component2 = ((Component)((EntityState)this).characterBody).gameObject.GetComponent(); DeathRewards component3 = ((Component)body).gameObject.GetComponent(); uint goldReward = component2.goldReward / 2 + 1; uint num = component2.expReward / 2 + 1; component3.goldReward = goldReward; component3.expReward += 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)3; } } public class BeetleSwarmController : MonoBehaviour { private CharacterBody characterBody; private HealthComponent healthComponent; private float checkTimer; private static float checkInterval = 0.5f; private static float maxBuffDistance = maxBeetleBuffDistance.Value; private static float maxCrowdScoreToUseSpecial = summonRequiredCrowdScore.Value; private float crowdScore; public int recursionDepth; private BeetleSwarmContributor ownContributor; private AISkillDriver attackDriver; private bool nearEnemies; private int maxStrengthInNumbersCount = (int)maxBuffStacks.Value; private float attackedCountdown; private static float attackedCountdownDuration = 10f; public bool CanUseSummon => crowdScore < maxCrowdScoreToUseSpecial && (float)recursionDepth < summonMaxRecursionDepth.Value && !nearEnemies && !attackedRecently; private bool attackedRecently => attackedCountdown > 0f; public void Start() { characterBody = ((Component)this).GetComponent(); ownContributor = ((Component)this).GetComponent(); if (!((Object)(object)characterBody != (Object)null)) { return; } healthComponent = characterBody.healthComponent; if ((Object)(object)characterBody.skillLocator != (Object)null && (Object)(object)characterBody.skillLocator.special != (Object)null) { characterBody.skillLocator.special.RemoveAllStocks(); characterBody.skillLocator.special.rechargeStopwatch = Random.Range(0f, 10f); } CharacterMaster master = characterBody.master; if ((Object)(object)master != (Object)null) { attackDriver = (from driver in ((Component)master).gameObject.GetComponents() where driver.customName == "HeadbuttOffNodegraph" select driver).FirstOrDefault(); } } public void FixedUpdate() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if (attackedCountdown > 0f) { attackedCountdown -= Time.fixedDeltaTime; } checkTimer -= Time.fixedDeltaTime; if (!(checkTimer < 0f)) { return; } checkTimer += checkInterval; int nearbyBeetleCount = GetNearbyBeetleCount(); int num = Mathf.Min(nearbyBeetleCount, maxStrengthInNumbersCount); if ((Object)(object)characterBody != (Object)null) { characterBody.SetBuffCount(beetleSwarmBuff.buffIndex, num); } if ((Object)(object)attackDriver != (Object)null) { float maxDistance = BeetleHeadbuttLeap.baseHeadbuttDistance + BeetleHeadbuttLeap.headButtDistancePerBeetle * (float)num; attackDriver.maxDistance = maxDistance; } TeamComponent teamComponent = characterBody.teamComponent; if (!((Object)(object)teamComponent != (Object)null)) { return; } TeamIndex teamIndex = teamComponent.teamIndex; nearEnemies = false; foreach (CharacterBody instances in CharacterBody.instancesList) { if (!((Object)(object)instances == (Object)null) && !((Object)(object)instances.teamComponent == (Object)null) && (int)instances.teamComponent.teamIndex != 0 && instances.teamComponent.teamIndex != teamIndex) { float num2 = Vector3.Distance(instances.corePosition, characterBody.corePosition); if (num2 < summonMinDistance.Value) { nearEnemies = true; break; } } } } public int GetNearbyBeetleCount() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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) int num = 0; float num2 = 0f; if ((Object)(object)characterBody != (Object)null && (Object)(object)healthComponent != (Object)null && healthComponent.alive) { List instancesList = InstanceTracker.GetInstancesList(); foreach (BeetleSwarmContributor item in instancesList) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.characterBody == (Object)null) && !((Object)(object)item.healthComponent == (Object)null) && item.healthComponent.alive && !((Object)(object)item == (Object)(object)ownContributor)) { int contribution = item.GetContribution(); Vector3 footPosition = characterBody.footPosition; Vector3 footPosition2 = item.characterBody.footPosition; float num3 = Vector3.Distance(footPosition, footPosition2); num2 += (float)contribution * (100f / Mathf.Max(num3, 1f)); if (!(num3 > maxBuffDistance)) { num += contribution; } } } } crowdScore = num2; return num; } public void DamageReceived() { attackedCountdown = attackedCountdownDuration; } } public class BeetleSwarmContributor : MonoBehaviour { public enum BeetleType { Worker, Guard, Queen } public BeetleType beetleType; public HealthComponent healthComponent; public CharacterBody characterBody; public void Start() { characterBody = ((Component)this).GetComponent(); if ((Object)(object)characterBody != (Object)null) { healthComponent = characterBody.healthComponent; } } public int GetContribution() { return beetleType switch { BeetleType.Worker => 1, BeetleType.Guard => (int)beetleGuardContribution.Value, BeetleType.Queen => (int)beetleQueenContribution.Value, _ => 0, }; } public void OnEnable() { InstanceTracker.Add(this); } public void OnDisable() { InstanceTracker.Remove(this); } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Beetle.BeetleBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Beetle.BeetleMaster_prefab).WaitForCompletion(); private static CharacterSpawnCard cscBeetle = Addressables.LoadAssetAsync((object)RoR2_Base_Beetle.cscBeetle_asset).WaitForCompletion(); private static CharacterSpawnCard cscBeetleSulfur = Addressables.LoadAssetAsync((object)RoR2_Base_Beetle.cscBeetleSulfur_asset).WaitForCompletion(); public static BuffDef beetleSwarmBuff; private static GameObject jumpEffect = Addressables.LoadAssetAsync((object)RoR2_Base_JumpBoost.BoostJumpEffect_prefab).WaitForCompletion(); private static GameObject beetleGuardBodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_BeetleGuard.BeetleGuardBody_prefab).WaitForCompletion(); private static GameObject beetleQueenBodyPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_BeetleQueen.BeetleQueen2Body_prefab).WaitForCompletion(); private static SkillDef beetlePrimarySkill = Addressables.LoadAssetAsync((object)RoR2_Base_Beetle.BeetleBodyHeadbutt_asset).WaitForCompletion(); private static ConfigEntry summonCooldown; private static ConfigEntry summonMinDistance; private static ConfigEntry summonRequiredCrowdScore; private static ConfigEntry summonInventoryCloneChance; private static ConfigEntry summonMaxRecursionDepth; private static ConfigEntry lungeEnabled; private static ConfigEntry lungeCooldown; private static ConfigEntry lungeBaseDistance; private static ConfigEntry lungeBonusDistancePerBuffStack; private static ConfigEntry buffScalingModifier; private static ConfigEntry armorPerStack; private static ConfigEntry movespeedPerStack; private static ConfigEntry attackSpeedPerStack; private static ConfigEntry damagePerStack; private static ConfigEntry maxHealthPerStack; private static ConfigEntry maxBuffStacks; private static ConfigEntry maxBeetleBuffDistance; private static ConfigEntry beetleGuardContribution; private static ConfigEntry beetleQueenContribution; public override void RegisterConfig() { base.RegisterConfig(); BindStats(bodyPrefab, new List(2) { cscBeetle, cscBeetleSulfur }, new StatOverrides { directorCost = 7f, baseMoveSpeed = 8f }); summonCooldown = BindFloat("Summon Cooldown", 30f, "The cooldown of the summon ability. Note that there are other requirements for this ability to be used.", 10f, 120f, 1f, PluginConfig.FormatType.Time); summonMinDistance = BindFloat("Summon Min Distance from Player", 40f, "The minimum distance a beetle has to be from an enemy to be able to use Summon Reinforcements.", 20f, 80f, 1f, PluginConfig.FormatType.Distance); summonRequiredCrowdScore = BindFloat("Summon Max Crowd Score", 10f, "Crowd score is a metric of how big a group of beetles is. Each Beetle has a crowd score determined by the sum of 100 / distance to each other beetle. When the crowd score is below the required crowd score, beetles gain the ability to use Summon Reinforcements.\nSetting this number higher will increase the number of beetles that a group must have before they no longer summon additional beetles.", 5f, 20f); summonInventoryCloneChance = BindFloat("Summon Inventory Clone Chance", 0f, "The chance that a beetle will clone it's inventory (including elite affixes) to it's summoned beetle.", 0f, 100f, 1f, PluginConfig.FormatType.Percentage); summonMaxRecursionDepth = BindFloat("Summon Max Recursion Depth", 3f, "Determines how many times beetles can chain-summon. If set to 1, summoned beetles cannot summon new beetles. If set to 2, summoned beetles CAN summon new beetles, but beetles summoned by a summoned beetle cannot.", 1f, 5f, 1f); lungeEnabled = BindBool("Lunge Enabled", defaultValue: true, "Grants Beetles a short lunge on their primary headbutt, which can scale with their Strength in Numbers stacks. Disable if you're already using a mod that grants beetles a lunge attack."); lungeCooldown = BindFloat("Lunge Cooldown", 2f, "Applies a cooldown to the Beetle's headbutt attack to prevent them from repeatedly dashing towards you. If set shorter than 1.5s, Beetles can use the ability again the moment it finishes.", 1f, 5f, 0.1f, PluginConfig.FormatType.Time); lungeBaseDistance = BindFloat("Lunge Base Distance", 7f, "The base distance that Beetles will attempt to lunge at their target from.", 2f, 10f, 0.1f, PluginConfig.FormatType.Distance); lungeBonusDistancePerBuffStack = BindFloat("Lunge Distance Per Buff Stack", 0.5f, "The additional distance that Beetles will attempt to lunge at their target from, per stack of Strength In Numbers.", 0f, 1f, 0.1f, PluginConfig.FormatType.Distance); buffScalingModifier = BindFloat("Strength In Numbers Scaling Modifier", 1f, "The power that the number of beetles will be raised to before applying to their boosted stats. Less than 1 causes diminishing returns for more beetles, greater than 1 causes exponential returns for more beetles. Equal to 1 scales stats linearly.", 0.75f, 1.25f, 0.01f); armorPerStack = BindFloat("Strength In Numbers Armor", 10f, "The armor per stack that Strength in Numbers grants.", 5f, 50f, 1f); movespeedPerStack = BindFloat("Strength in Numbers Move Speed Bonus", 15f, "The bonus move speed per stack that Strength in Numbers grants.", 0f, 30f, 1f, PluginConfig.FormatType.Percentage); attackSpeedPerStack = BindFloat("Strength In Numbers Attack Speed Bonus", 0f, "The bonus attack speed per stack that Strength in Numbers grants.", 0f, 10f, 1f, PluginConfig.FormatType.Percentage); damagePerStack = BindFloat("Strength in Numbers Damage Bonus", 0f, "The bonus damage per stack that Strength in Numbers grants.", 0f, 20f, 1f, PluginConfig.FormatType.Percentage); maxHealthPerStack = BindFloat("Strength in Numbers Health Bonus", 0f, "The bonus max health per stack that Strength in Numbers grants", 0f, 20f, 1f, PluginConfig.FormatType.Percentage); maxBuffStacks = BindFloat("Strength in Numbers Max Stacks", 10f, "The maximum number of stacks of Strength in Numbers that beetles can gain from nearby beetles.", 5f, 20f, 1f); maxBeetleBuffDistance = BindFloat("Strength in Numbers Buff Distance", 50f, "The distance at which beetles gain Strength in Numbers from other beetles.", 20f, 200f, 1f, PluginConfig.FormatType.Distance); beetleGuardContribution = BindFloat("Beetle Guard Buff Contribution", 2f, "The amount of stacks of Strength in Numbers that Beetle Guards grant to nearby Beetles.", 0f, 5f, 1f); beetleQueenContribution = BindFloat("Beetle Queen Buff Contribution", 3f, "The amount of stacks of Strength in Numbers that Beetle Queens grant to nearby Beetles.", 0f, 5f, 1f); } public override void Initialise() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00ae: 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) base.Initialise(); CreateSkillDef(); CreateBuffDef(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent().beetleType = BeetleSwarmContributor.BeetleType.Worker; if (beetleGuardContribution.Value > 0f) { beetleGuardBodyPrefab.AddComponent().beetleType = BeetleSwarmContributor.BeetleType.Guard; } if (beetleQueenContribution.Value > 0f) { beetleQueenBodyPrefab.AddComponent().beetleType = BeetleSwarmContributor.BeetleType.Queen; } RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ApplyBeetleBuffStats); ModifyBeetlePrimary(); if (lungeEnabled.Value) { bool flag = default(bool); beetlePrimarySkill.activationState = ContentAddition.AddEntityState(ref flag); beetlePrimarySkill.baseRechargeInterval = lungeCooldown.Value; } GlobalEventManager.onServerDamageDealt += OnDamageDealt; } private void OnDamageDealt(DamageReport report) { //IL_0032: 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) if (report != null && !((Object)(object)report.victimBody == (Object)null) && !(report.damageDealt <= 0f) && report.victimBody.bodyIndex == BodyPrefabs.BeetleBody.bodyIndex) { BeetleSwarmController component = ((Component)report.victimBody).gameObject.GetComponent(); if (!((Object)(object)component == (Object)null)) { component.DamageReceived(); } } } private void ModifyBeetlePrimary() { if (lungeEnabled.Value) { AISkillDriver val = (from driver in masterPrefab.GetComponents() where driver.customName == "HeadbuttOffNodegraph" select driver).FirstOrDefault(); if ((Object)(object)val != (Object)null) { val.maxDistance = lungeBaseDistance.Value; } } } private void ApplyBeetleBuffStats(CharacterBody sender, StatHookEventArgs args) { if (lungeEnabled.Value && (Object)(object)sender != (Object)null && sender.HasBuff(beetleSwarmBuff)) { int buffCount = sender.GetBuffCount(beetleSwarmBuff); float value = buffScalingModifier.Value; float num = Mathf.Pow((float)buffCount, value); args.armorAdd += armorPerStack.Value * num; args.moveSpeedMultAdd += movespeedPerStack.Value / 100f * num; args.attackSpeedMultAdd += attackSpeedPerStack.Value / 100f * num; args.healthMultAdd += maxHealthPerStack.Value / 100f * num; args.damageMultAdd += damagePerStack.Value / 100f * num; } } private void CreateSkillDef() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00c4: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "BeetleBodySwarm", skillName = "BeetleSwarm", esmName = "Body", activationState = ContentAddition.AddEntityState(ref flag), cooldown = 20f, combatSkill = true, intPrio = (InterruptPriority)0 }; SwarmSkillDef swarmSkillDef = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, (SkillDef)(object)swarmSkillDef, "BeetleSpecialFamily", (SkillSlot)3); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSpecial", skillSlot = (SkillSlot)3, requiredSkillDef = (SkillDef)(object)swarmSkillDef, requireReady = true, minDistance = summonMinDistance.Value, maxDistance = float.PositiveInfinity, targetType = (TargetType)0, movementType = (MovementType)0, aimType = (AimType)4, desiredIndex = 0, driverUpdateTimerOverride = 1f }; CreateAISkillDriver(data2); } private void CreateBuffDef() { Texture2D texture = EnemyAbilities.Instance.assetBundle.LoadAsset("texStrengthInNumbersIcon"); beetleSwarmBuff = ScriptableObject.CreateInstance(); ((Object)beetleSwarmBuff).name = "BeetleSwarmBuff"; beetleSwarmBuff.iconSprite = Utils.CreateSprite(texture); beetleSwarmBuff.canStack = true; beetleSwarmBuff.isCooldown = false; beetleSwarmBuff.isDOT = false; beetleSwarmBuff.isHidden = false; ContentAddition.AddBuffDef(beetleSwarmBuff); } } } namespace EnemyAbilities.Abilities.AcidLarva { [EnemyAbilities.ModuleInfo("Caustic Pod", "Gives Larvae a new secondary:\n- Caustic Pod: Fires off a short-range caustic pod that deals no impact damage, but leaves an Acid Pod at the impact location which detonates on taking damage from any source.\nEnabling this option reduces Larva self-damage from 1/2 of their max health to 1/3.", "Larva", true)] public class SpawnAcidPodModule : BaseModule { public class SpawnAcidPod : BaseSkillState { private static float maxDistance = useRange.Value; private static float timeToTarget = travelTime.Value; private static float baseDuration = 0.25f; public override void OnEnter() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_0122: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).PlayCrossfade("Gesture, Override", "LarvaLeap", 0.1f); Util.PlaySound("Play_acid_larva_spawn", ((Component)((EntityState)this).characterBody).gameObject); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).GetPoint(maxDistance); bool flag = false; if ((Object)(object)((EntityState)this).characterBody.master != (Object)null) { BaseAI component = ((Component)((EntityState)this).characterBody.master).GetComponent(); if ((Object)(object)component != (Object)null && component.currentEnemy != null && (Object)(object)component.currentEnemy.characterBody != (Object)null) { flag = true; val = component.currentEnemy.characterBody.footPosition; } } RaycastHit val2 = default(RaycastHit); if (!flag && Physics.Raycast(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction, ref val2, maxDistance, LayerMask.op_Implicit(CommonMasks.bullet))) { val = ((RaycastHit)(ref val2)).point; } if (((EntityState)this).isAuthority) { Vector3 val3 = Trajectory.CalculateInitialVelocityFromTime(((Ray)(ref aimRay)).origin, val, timeToTarget, 0f, float.PositiveInfinity); float magnitude = ((Vector3)(ref val3)).magnitude; Quaternion val4 = Util.QuaternionSafeLookRotation(((Vector3)(ref val3)).normalized); DamageTypeCombo val5 = default(DamageTypeCombo); val5.damageType = (DamageType)0; val5.damageSource = (DamageSource)2; DamageTypeCombo value = val5; ProjectileManager.instance.FireProjectile(acidProjectilePrefab, ((Ray)(ref aimRay)).origin, val4, ((Component)((EntityState)this).characterBody).gameObject, 0f, 1000f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, magnitude, (DamageTypeCombo?)value); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); ((EntityState)this).PlayAnimation("Gesture, Override", Animator.StringToHash("Empty")); } 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 ProjectileSpawnAcidPod : MonoBehaviour, IProjectileImpactBehavior { private bool spawnedPod; public void OnProjectileImpact(ProjectileImpactInfo info) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00b3: Unknown result type (might be due to invalid IL or missing references) if (!spawnedPod) { spawnedPod = true; Vector3 val = ((Component)this).gameObject.transform.position; Quaternion val2 = Quaternion.identity; RaycastHit val3 = default(RaycastHit); bool flag = Physics.Raycast(((Component)this).gameObject.transform.position, Vector3.down, ref val3, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (flag) { val = ((RaycastHit)(ref val3)).point; Vector3 val4 = Vector3.ProjectOnPlane(Vector3.forward, ((RaycastHit)(ref val3)).normal); val2 = Util.QuaternionSafeLookRotation(val4); } GameObject val5 = Object.Instantiate(acidPodPrefab, val + (flag ? (((RaycastHit)(ref val3)).normal * 0.25f) : Vector3.zero), val2); NetworkServer.Spawn(val5); } } } public class AcidLarvaPodDeath : GenericCharacterDeath { public static GameObject explosionEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_SulfurPod.SulfurPodExplosion_prefab).WaitForCompletion(); public static float explosionRadius = podExplosionRadius.Value; public static float explosionDamageCoefficient = damage.Value / 100f; public static float explosionProcCoefficient = poisonDuration.Value / 10f; public static float explosionForce = 1500f; private bool hasExploded; public override void OnEnter() { ((GenericCharacterDeath)this).OnEnter(); Explode(); } private void Explode() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0060: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) if (!hasExploded) { hasExploded = true; if (Object.op_Implicit((Object)(object)explosionEffectPrefab)) { EffectManager.SpawnEffect(explosionEffectPrefab, new EffectData { origin = ((EntityState)this).transform.position, scale = explosionRadius, rotation = Quaternion.identity }, true); } ((GenericCharacterDeath)this).DestroyModel(); if (NetworkServer.active) { BlastAttack val = new BlastAttack(); val.attacker = ((EntityState)this).gameObject; val.damageColorIndex = (DamageColorIndex)4; val.baseDamage = ((BaseState)this).damageStat * explosionDamageCoefficient * Run.instance.teamlessDamageCoefficient; val.radius = explosionRadius; val.falloffModel = (FalloffModel)0; val.procCoefficient = explosionProcCoefficient; val.teamIndex = (TeamIndex)(-1); val.damageType = DamageTypeCombo.op_Implicit((DamageType)4096); val.position = ((EntityState)this).transform.position; val.baseForce = explosionForce; val.attackerFiltering = (AttackerFiltering)2; val.Fire(); ((GenericCharacterDeath)this).DestroyBodyAsapServer(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } private static GameObject bodyPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_AcidLarva.AcidLarvaBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_AcidLarva.AcidLarvaMaster_prefab).WaitForCompletion(); private static GameObject acidProjectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_BeetleQueen.BeetleQueenSpit_prefab).WaitForCompletion(), "acidLarvaProjectile"); private static GameObject acidProjectileGhostPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_BeetleQueen.BeetleQueenSpitGhost_prefab).WaitForCompletion(), "acidLarvaProjectileGhost"); private static GameObject acidPodPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_DLC1_SulfurPod.SulfurPodBody_prefab).WaitForCompletion(), "acidLarvaPod"); private static EntityStateConfiguration larvaLeapESC = Addressables.LoadAssetAsync((object)RoR2_DLC1_AcidLarva.EntityStates_AcidLarva_LarvaLeap_asset).WaitForCompletion(); private static CharacterSpawnCard cscLarva = Addressables.LoadAssetAsync((object)RoR2_DLC1_AcidLarva.cscAcidLarva_asset).WaitForCompletion(); internal static ConfigEntry cooldown; internal static ConfigEntry damage; internal static ConfigEntry lifetime; internal static ConfigEntry useRange; internal static ConfigEntry poisonDuration; internal static ConfigEntry podExplosionRadius; internal static ConfigEntry travelTime; internal static ConfigEntry onKillChance; public override void RegisterConfig() { base.RegisterConfig(); cooldown = BindFloat("Caustic Pod Cooldown", 15f, "Cooldown of the ability", 5f, 30f, 1f, PluginConfig.FormatType.Time); damage = BindFloat("Caustic Pod Damage", 100f, "Damage coefficient of the pod explosion", 25f, 300f, 1f, PluginConfig.FormatType.Percentage); lifetime = BindFloat("Caustic Pod Lifetime", 30f, "How long the pod lasts before despawning", 10f, 60f, 1f, PluginConfig.FormatType.Time); useRange = BindFloat("Caustic Pod Use Range", 30f, "Max range to use the ability", 15f, 50f, 0.1f, PluginConfig.FormatType.Distance); poisonDuration = BindFloat("Caustic Pod Poison Duration", 5f, "Duration of the poison effect", 0f, 10f, 0.1f, PluginConfig.FormatType.Time); podExplosionRadius = BindFloat("Caustic Pod Explosion Radius", 12f, "Radius of the pod explosion", 6f, 18f, 0.1f, PluginConfig.FormatType.Distance); travelTime = BindFloat("Caustic Pod Travel Time", 1.5f, "Time for the projectile to reach its target", 0.5f, 3f, 0.1f, PluginConfig.FormatType.Time); onKillChance = BindFloat("Caustic Pod On-Kill Proc Chance", 0f, "The chance to trigger on-kill effects when killing caustic pods", 0f, 100f, 1f, PluginConfig.FormatType.Percentage); BindStats(bodyPrefab, new List(1) { cscLarva }); } public override void Initialise() { base.Initialise(); CreateSkill(); acidProjectilePrefab.AddComponent(); ContentAddition.AddBody(acidPodPrefab); ModifyProjectile(); Extensions.TryModifyFieldValue(larvaLeapESC, "detonateSelfDamageFraction", 1f / 6f); } public void ModifyProjectile() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Light val = acidPodPrefab.AddComponent(); val.type = (LightType)2; val.color = Color.yellow; val.range = 8f; val.intensity = 20f; val.renderMode = (LightRenderMode)0; ProjectileController component = acidProjectilePrefab.GetComponent(); component.ghostPrefab = acidProjectileGhostPrefab; ProjectileImpactExplosion component2 = acidProjectilePrefab.GetComponent(); ((ProjectileExplosion)component2).fireChildren = false; component2.destroyOnEnemy = true; component2.destroyOnWorld = true; ParticleSystemRenderer componentInChildren = acidProjectileGhostPrefab.GetComponentInChildren(); ((Renderer)componentInChildren).material = Addressables.LoadAssetAsync((object)RoR2_DLC1_AcidLarva.matAcidLarvaSacs_mat).WaitForCompletion(); ((Renderer)componentInChildren).materials = (Material[])(object)new Material[1] { ((Renderer)componentInChildren).material }; CharacterDeathBehavior component3 = acidPodPrefab.GetComponent(); if ((Object)(object)component3 != (Object)null) { bool flag = default(bool); component3.deathState = ContentAddition.AddEntityState(ref flag); } DestroyOnTimer val2 = acidPodPrefab.AddComponent(); val2.duration = 30f; ModelLocator component4 = acidPodPrefab.GetComponent(); component4.modelBaseTransform.localScale = Vector3.one * 1.5f; CharacterBody component5 = acidPodPrefab.GetComponent(); component5.baseDamage = 12f; component5.levelDamage = 2.4f; HealthComponent component6 = acidPodPrefab.GetComponent(); component6.globalDeathEventChanceCoefficient = onKillChance.Value / 100f; component5.baseNameToken = "SKELETOGNE_ACIDPOD_BODY_NAME"; LanguageAPI.Add("SKELETOGNE_ACIDPOD_BODY_NAME", "Caustic Pod"); } public void CreateSkill() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); SkillDefData data = new SkillDefData { objectName = "AcidLarvaBodySpawnAcidPod", skillName = "AcidLarvaSpawnAcidPod", esmName = "Weapon", activationState = ContentAddition.AddEntityState(ref flag), cooldown = cooldown.Value, combatSkill = true }; SkillDef val = CreateSkillDef(data); CreateGenericSkill(bodyPrefab, val, "AcidLarvaSecondaryFamily", (SkillSlot)1); AISkillDriverData data2 = new AISkillDriverData { masterPrefab = masterPrefab, customName = "useSecondary", skillSlot = (SkillSlot)1, requireReady = true, requiredSkillDef = val, maxDistance = useRange.Value, selectionRequiresTargetLoS = true, selectionRequiresAimTarget = true, targetType = (TargetType)0, movementType = (MovementType)1, aimType = (AimType)1, shouldSprint = true, desiredIndex = 1 }; CreateAISkillDriver(data2); AISkillDriver val2 = (from driver in masterPrefab.GetComponents() where driver.customName == "StrafeWhileWaitingForLeap" select driver).FirstOrDefault(); if ((Object)(object)val2 != (Object)null) { val2.driverUpdateTimerOverride = -1f; } else { Log.Error("Could not find StrafeWhileWaitingForLeap ai skill driver!"); } } } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator { object IEnumerator.Current => _item; T IEnumerator.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { return !_moveNextCalled && (_moveNextCalled = true); } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => 1; T IReadOnlyList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection.Count => 1; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { return (!EqualityComparer.Default.Equals(_item, (T)value)) ? (-1) : 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return (!EqualityComparer.Default.Equals(_item, item)) ? (-1) : 0; } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } }