Decompiled source of EnemyAbilities v1.4.0
plugins/EnemyAbilities.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EnemyAbilities.Abilities; using EntityStates; using EntityStates.MajorConstruct.Weapon; using EntityStates.Vulture; using Grumpy; using HarmonyLib; using IL.RoR2; using IL.RoR2.Projectile; using JetBrains.Annotations; using KinematicCharacterController; using Microsoft.CodeAnalysis; 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.Orbs; using RoR2.Projectile; using RoR2.Scripts.GameBehaviors; using RoR2.Skills; using RoR2BepInExPack.GameAssetPaths.Version_1_35_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+f8ce5c976f3a31768f4e0066ac543784be4856d2")] [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 { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Skeletogne.EnemyAbilities", "EnemyAbilities", "1.4.0")] 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.4.0"; public Dictionary<Type, ConfigEntry<bool>> configEntries = new Dictionary<Type, ConfigEntry<bool>>(); 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() { Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); PluginConfig.Init(((BaseUnityPlugin)this).Config); foreach (KeyValuePair<Type, ConfigEntry<bool>> configEntry in configEntries) { ConfigEntry<bool> value = configEntry.Value; Type key = configEntry.Key; if (value.Value) { ((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); } } internal static class PluginConfig { public enum FormatType { None, Percentage, Time, Distance, Speed } public static ConfigEntry<float> bisonRockCount { get; set; } public static ConfigEntry<float> bisonRockTimeToTargetNonPlayer { get; set; } public static ConfigEntry<float> bisonRockTimeToTargetPlayer { get; set; } public static ConfigEntry<float> bisonRockDamageCoefficient { get; set; } public static ConfigEntry<float> bisonRockExplosionRadius { get; set; } public static ConfigEntry<float> bisonRockCooldown { get; set; } public static ConfigEntry<float> templarGrenadeCount { get; set; } public static ConfigEntry<float> templarGrenadeDamageCoefficient { get; set; } public static ConfigEntry<float> templarGrenadeExplosionRadius { get; set; } public static ConfigEntry<float> templarGrenadeCooldown { get; set; } public static ConfigEntry<float> pestThwompWarningDuration { get; set; } public static ConfigEntry<float> pestThwompRecoveryDuration { get; set; } public static ConfigEntry<float> pestThwompGroundedDuration { get; set; } public static ConfigEntry<float> pestThwompDamageCoefficient { get; set; } public static ConfigEntry<float> pestThwompRadius { get; set; } public static ConfigEntry<float> pestThwompCooldown { get; set; } public static ConfigEntry<float> transporterFlingMaxRange { get; set; } public static ConfigEntry<float> transporterFlingTimeToTarget { get; set; } public static ConfigEntry<float> transporterFlingBaseDamageCoefficient { get; set; } public static ConfigEntry<float> transporterFlingDamageCoefficientPerUnitMass { get; set; } public static ConfigEntry<float> transporterFlingRadius { get; set; } public static ConfigEntry<bool> canFlingElites { get; set; } public static ConfigEntry<bool> canFlingBosses { get; set; } public static ConfigEntry<float> transporterTractorBeamCooldown { get; set; } public static ConfigEntry<float> xiCoreDamageCoefficient { get; set; } public static ConfigEntry<float> xiCoreWindupDuration { get; set; } public static ConfigEntry<float> xiCoreWaitDuration { get; set; } public static ConfigEntry<float> xiCoreExplosionRadius { get; set; } public static ConfigEntry<bool> prioritisesPlayers { get; set; } public static ConfigEntry<float> xiCoreCooldown { get; set; } public static ConfigEntry<float> vultureSwoopDamageCoefficient { get; set; } public static ConfigEntry<float> vultureSwoopHitBoxScale { get; set; } public static ConfigEntry<bool> vultureSwoopInflictsBleed { get; set; } public static ConfigEntry<float> vultureSwoopPredictionTime { get; set; } public static ConfigEntry<float> vultureSwoopStunDurationOnImpact { get; set; } public static ConfigEntry<float> vultureSwoopCooldown { get; set; } public static ConfigEntry<float> prospectorBurrowEntryDuration { get; set; } public static ConfigEntry<float> prospectorBurrowWaitDuration { get; set; } public static ConfigEntry<float> prospectorBurrowTelegraphDuration { get; set; } public static ConfigEntry<float> prospectorBurrowDamageCoefficient { get; set; } public static ConfigEntry<float> prospectorBurrowRadius { get; set; } public static ConfigEntry<float> prospectorBurrowBaseVelocity { get; set; } public static ConfigEntry<float> prospectorBurrowCooldown { get; set; } public static ConfigEntry<bool> grovetenderResurrectWispsOnly { get; set; } public static ConfigEntry<float> grovetenderResurrectMaxGhosts { get; set; } public static ConfigEntry<float> grovetenderResurrectMaxGravestones { get; set; } public static ConfigEntry<float> grovetenderResurrectCooldown { get; set; } public static ConfigEntry<float> grovetenderResurrectGravestoneFuse { get; set; } public static ConfigEntry<float> grovetenderResurrectGravestoneRadius { get; set; } public static ConfigEntry<float> grovetenderResurrectGravestoneDamage { get; set; } public static ConfigEntry<float> grovetenderResurrectGhostLifetime { get; set; } public static ConfigEntry<float> grovetenderResurrectHealthThreshold { get; set; } public static ConfigEntry<float> grovetenderResurrectArmorPerGhost { get; set; } public static ConfigEntry<float> apothecaryDelugeCooldown { get; set; } public static ConfigEntry<float> apothecaryDelugeMinDamage { get; set; } public static ConfigEntry<float> apothecaryDelugeMaxDamage { get; set; } public static ConfigEntry<float> apothecaryDelugeMinRadius { get; set; } public static ConfigEntry<float> apothecaryDelugeMaxRadius { get; set; } public static ConfigEntry<float> apothecaryDelugeHealthPercentageRequiredForFullCharge { get; set; } public static ConfigEntry<float> apothecaryDelugeHealthThreshold { get; set; } public static ConfigEntry<float> apothecaryDelugeChargeTime { get; set; } public static ConfigEntry<float> apothecaryDelugeTravelTime { get; set; } public static ConfigEntry<float> apothecaryDelugeFuseTime { get; set; } public static ConfigEntry<float> apothecaryDelugePlayerDetonateDamage { get; set; } public static ConfigEntry<float> apothecaryDelugeAoEZoneDamagePercentage { get; set; } public static ConfigEntry<float> apothecaryDelugeAoEZoneDuration { get; set; } 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<EnemyAbilities.ModuleInfoAttribute>(); if (customAttribute != null) { ConfigEntry<bool> 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."); } } bisonRockCount = cfg.BindOptionSteppedSlider("Bighorn Bison", "Rock Count", 1f, 1f, "The number of rocks spawned. Rock counts beyond 1 are distributed in an arc, 45 degrees apart.", 1f, 8f, restartRequired: true); bisonRockDamageCoefficient = cfg.BindOptionSteppedSlider("Bighorn Bison", "Rock Damage Coefficient", 300f, 5f, "Percentage multiplier to the Bison's Damage to get explosion damage. Uses falloff model sweet spot", 100f, 1000f, restartRequired: true, FormatType.Percentage); bisonRockTimeToTargetNonPlayer = cfg.BindOptionSteppedSlider("Bighorn Bison", "Rock Time to Target", 1.25f, 0.01f, "Duration of time between the rock being launched by a non-player to hitting it's target. Proportional to arc height.", 0.5f, 5f, restartRequired: true, FormatType.Time); bisonRockTimeToTargetPlayer = cfg.BindOptionSteppedSlider("Bighorn Bison", "Rock Time to Target (Launched by Player)", 0.5f, 0.01f, "Duration of time between the rock being launched by a player to hitting it's target. Proportional to arc height.", 0.5f, 5f, restartRequired: true, FormatType.Time); bisonRockExplosionRadius = cfg.BindOptionSteppedSlider("Bighorn Bison", "Rock Explosion Radius", 10f, 1f, "Explosion radius of the rock", 6f, 16f, restartRequired: false, FormatType.Distance); bisonRockCooldown = cfg.BindOptionSteppedSlider("Bighorn Bison", "Rock Cooldown", 15f, 0.1f, "Cooldown before the ability can be activated again.", 5f, 30f, restartRequired: true, FormatType.Time); templarGrenadeCount = cfg.BindOptionSteppedSlider("Clay Templar", "Grenade Count", 5f, 1f, "The number of grenades the Templar fires on ability use.", 1f, 10f, restartRequired: true); templarGrenadeCooldown = cfg.BindOptionSteppedSlider("Clay Templar", "Grenade Cooldoown", 10f, 0.1f, "Cooldown before the ability can activated again.", 5f, 30f, restartRequired: true, FormatType.Time); templarGrenadeDamageCoefficient = cfg.BindOptionSteppedSlider("Clay Templar", "Grenade Damage Coefficient", 100f, 5f, "Percentage multiplier to the Templar's Damage to get explosion damage. Uses falloff model sweet spot", 50f, 500f, restartRequired: true, FormatType.Percentage); templarGrenadeExplosionRadius = cfg.BindOptionSteppedSlider("Clay Templar", "Grenade Explosion Radius", 6f, 1f, "Grenade Explosion radius in metres", 1f, 10f, restartRequired: true, FormatType.Distance); pestThwompWarningDuration = cfg.BindOptionSteppedSlider("Blind Pest", "Thwomp Warning Duration", 0.85f, 0.05f, "The duration that the indicator appears before the Blind Pest begins it's attack.", 0.5f, 1.5f, restartRequired: true, FormatType.Time); pestThwompRecoveryDuration = cfg.BindOptionSteppedSlider("Blind Pest", "Thwomp Recovery Duration", 1.25f, 0.05f, "The duration that the Blind Pest is unable to select another attack for after landing", 0.5f, 1.5f, restartRequired: true, FormatType.Time); pestThwompGroundedDuration = cfg.BindOptionSteppedSlider("Blind Pest", "Thwomp Grounded Duration", 3f, 0.1f, "The duration that the Blind Pest is forced into its grounded state for, before it becomes able to fly again", 1f, 10f, restartRequired: true, FormatType.Time); pestThwompDamageCoefficient = cfg.BindOptionSteppedSlider("Blind Pest", "Thwomp Damage Coefficient", 250f, 5f, "The damage multiplier to the Blind Pest's damage to get explosion damage. Uses falloff model sweet spot", 100f, 500f, restartRequired: true, FormatType.Percentage); pestThwompRadius = cfg.BindOptionSteppedSlider("Blind Pest", "Thwomp Radius", 6f, 1f, "The explosion radius of the poison blast", 4f, 12f, restartRequired: true, FormatType.Distance); pestThwompCooldown = cfg.BindOptionSteppedSlider("Blind Pest", "Thwomp Cooldown", 8f, 0.1f, "The cooldown of the ability", 4f, 20f, restartRequired: true, FormatType.Time); transporterFlingMaxRange = cfg.BindOptionSteppedSlider("Solus Transporter", "Max Fling Range", 150f, 1f, "The maximum range at which a Solus Transporter can use it's fling ability", 70f, 200f, restartRequired: true, FormatType.Distance); transporterFlingTimeToTarget = cfg.BindOptionSteppedSlider("Solus Transporter", "Fling Time to Target", 3f, 0.1f, "The amount of time it takes a flung enemy to reach it's intended target. Higher values will yield higher arc heights.", 1f, 5f, restartRequired: true, FormatType.Time); transporterFlingRadius = cfg.BindOptionSteppedSlider("Solus Transporter", "Explosion Radius", 12f, 0.1f, "The explosion radius of a flung enemy landing.", 8f, 20f, restartRequired: true, FormatType.Distance); transporterFlingBaseDamageCoefficient = cfg.BindOptionSteppedSlider("Solus Transporter", "Fling Damage Coefficient", 300f, 5f, "The base explosion damage of a flung enemy hitting the ground.", 100f, 600f, restartRequired: true, FormatType.Percentage); transporterFlingDamageCoefficientPerUnitMass = cfg.BindOptionSteppedSlider("Solus Transporter", "Fling Damage Coefficient per Unit Mass", 0.5f, 0.01f, "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, restartRequired: true, FormatType.Percentage); canFlingElites = cfg.BindOption("Solus Transporter", "Can Fling Elites", defaultValue: true, "Allows Solus Transporters to pick up and fling elite enemies", restartRequired: true); canFlingBosses = cfg.BindOption("Solus Transporter", "Can Fling Bosses", defaultValue: false, "Allows Solus Transporters to pick up and fling bosses. UNTESTED - ENABLE AT YOUR OWN PERIL!", restartRequired: true); transporterTractorBeamCooldown = cfg.BindOptionSteppedSlider("Solus Transporter", "Tractor Beam Cooldown", 12f, 0.1f, "The Cooldown for the Tractor Beam (which starts after an enemy is flung)", 5f, 30f, restartRequired: true, FormatType.Time); xiCoreDamageCoefficient = cfg.BindOptionSteppedSlider("Xi Construct", "Core Damage Coefficient", 250f, 5f, "The damage coefficient of the core attack", 100f, 500f, restartRequired: true, FormatType.Percentage); xiCoreExplosionRadius = cfg.BindOptionSteppedSlider("Xi Construct", "Core Explosion Radius", 10f, 0.1f, "The damage radius of the core attack", 6f, 20f, restartRequired: true, FormatType.Distance); xiCoreWaitDuration = cfg.BindOptionSteppedSlider("Xi Construct", "Core Wait Duration", 3.5f, 0.01f, "The amount of time that the Xi Construct will wait between firing and recalling it's Core.", 1f, 6f, restartRequired: true, FormatType.Time); xiCoreWindupDuration = cfg.BindOptionSteppedSlider("Xi Construct", "Core Windup Duration", 0.75f, 0.01f, "The amount of time the Xi Construct will spin up for before firing it's core.", 0.5f, 2f, restartRequired: true, FormatType.Time); prioritisesPlayers = cfg.BindOption("Xi Construct", "Core Prioritises Players", defaultValue: true, "The Xi Construct is much more likely to fire it's core at players.", restartRequired: true); xiCoreCooldown = cfg.BindOptionSteppedSlider("Xi Construct", "Core Cooldown", 15f, 0.1f, "The cooldown of the core launch", 10f, 30f, restartRequired: true, FormatType.Time); vultureSwoopPredictionTime = cfg.BindOptionSteppedSlider("Alloy Vulture", "Swoop Prediction Duration", 1.5f, 0.1f, "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, restartRequired: true, FormatType.Time); vultureSwoopHitBoxScale = cfg.BindOptionSteppedSlider("Alloy Vulture", "Swoop Hitbox Scale", 100f, 1f, "Affects how large the hitbox for swoop is.", 50f, 200f, restartRequired: true, FormatType.Percentage); vultureSwoopDamageCoefficient = cfg.BindOptionSteppedSlider("Alloy Vulture", "Swoop Damage Coefficient", 125f, 5f, "The damage coefficient of the swoop attack", 100f, 300f, restartRequired: true, FormatType.Percentage); vultureSwoopStunDurationOnImpact = cfg.BindOptionSteppedSlider("Alloy Vulture", "Swoop Stun Duration on Impact", 2f, 0.1f, "How long the Alloy Vulture stuns itself for upon hitting terrain at high speed.", 0f, 4f, restartRequired: true, FormatType.Time); vultureSwoopInflictsBleed = cfg.BindOption("Alloy Vulture", "Swoop Inflicts Bleed", defaultValue: true, "Allows Alloy Vultures to inflict 1 stack of bleed for 3 seconds when swoop hits.", restartRequired: true); vultureSwoopCooldown = cfg.BindOptionSteppedSlider("Alloy Vulture", "Swoop Cooldown", 12f, 0.1f, "The cooldown of the swoop ability", 8f, 30f, restartRequired: true, FormatType.Time); prospectorBurrowEntryDuration = cfg.BindOptionSteppedSlider("Solus Prospector", "Burrow Entry Duration", 1f, 0.1f, "How long it takes for the Solus Prospector to burrow underground.", 0.2f, 2f, restartRequired: true, FormatType.Time); prospectorBurrowWaitDuration = cfg.BindOptionSteppedSlider("Solus Prospector", "Burrow Wait Duration", 1f, 0.1f, "How long the Solus Prospector remains burrowed without attacking", 0.2f, 2f, restartRequired: true, FormatType.Time); prospectorBurrowTelegraphDuration = cfg.BindOptionSteppedSlider("Solus Prospector", "Burrow Telegraph Duration", 1f, 0.1f, "How long the Solus Prospector telegraphs before bursting up from the ground", 0.2f, 2f, restartRequired: true, FormatType.Time); prospectorBurrowRadius = cfg.BindOptionSteppedSlider("Solus Prospector", "Burrow Radius", 6f, 1f, "The radius of the burrow attack explosion", 6f, 16f, restartRequired: true, FormatType.Distance); prospectorBurrowDamageCoefficient = cfg.BindOptionSteppedSlider("Solus Prospector", "Burrow Damage Coefficient", 300f, 5f, "The damage coefficient of the burrow attack", 100f, 500f, restartRequired: true, FormatType.Percentage); prospectorBurrowBaseVelocity = cfg.BindOptionSteppedSlider("Solus Prospector", "Burrow Upwards Velocity Modifier", 250f, 10f, "The speed multiplier at which the Prospector is ejected from the ground", 100f, 500f, restartRequired: true, FormatType.Percentage); prospectorBurrowCooldown = cfg.BindOptionSteppedSlider("Solus Prospector", "Burrow Cooldown", 15f, 0.1f, "The cooldown of the burrow", 8f, 30f, restartRequired: true, FormatType.Time); grovetenderResurrectWispsOnly = cfg.BindOption("Grovetender", "Resurrect Spawns Wisps Only", defaultValue: false, "Enemies killed are resurrected as wisps when the Gravestones shatter.", restartRequired: true); grovetenderResurrectGhostLifetime = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Ghost Lifetime", 30f, 1f, "The duration over which resurrected ghosts will decay from full health to zero.", 10f, 120f, restartRequired: true, FormatType.Time); grovetenderResurrectGravestoneDamage = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Gravestone Damage", 200f, 5f, "The damage coefficient of the Gravestone explosion.", 100f, 400f, restartRequired: true, FormatType.Percentage); grovetenderResurrectGravestoneFuse = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Gravestone Fuse Duration", 1.25f, 0.01f, "The time between a gravestone embedding and exploding.", 0.5f, 3f, restartRequired: true, FormatType.Time); grovetenderResurrectGravestoneRadius = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Gravestone Explosion Radius", 9f, 0.1f, "The radius of the gravestone explosion", 5f, 16f, restartRequired: true, FormatType.Distance); grovetenderResurrectHealthThreshold = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Health Threshold", 50f, 1f, "The health threshold that the Grovetender must be under to use Mass Resurrect", 25f, 100f, restartRequired: true, FormatType.Percentage); grovetenderResurrectMaxGhosts = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Max Ghosts", 8f, 1f, "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, restartRequired: true); grovetenderResurrectMaxGravestones = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Max Gravestones", 8f, 1f, "The maximum amount of gravestones a Grovetender can have active at once. Enemies that die beyond this limit will not create gravestones.", 2f, 20f, restartRequired: true); grovetenderResurrectCooldown = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Cooldown", 60f, 0.1f, "The cooldown of Mass Resurrect", 30f, 120f, restartRequired: true, FormatType.Time); grovetenderResurrectArmorPerGhost = cfg.BindOptionSteppedSlider("Grovetender", "Resurrect Armor Per Ghost", 30f, 1f, "The amount of armour that the Grovetender gains per active ghost.", 5f, 100f, restartRequired: true); apothecaryDelugeMinDamage = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Min Damage", 100f, 5f, "", 50f, 200f, restartRequired: true, FormatType.Percentage); apothecaryDelugeMaxDamage = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Max Damage", 200f, 5f, "", 250f, 800f, restartRequired: true, FormatType.Percentage); apothecaryDelugeMinRadius = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Min Radius", 10f, 0.1f, "", 6f, 12f, restartRequired: true, FormatType.Distance); apothecaryDelugeMaxRadius = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Max Radius", 24f, 0.1f, "", 14f, 30f, restartRequired: true, FormatType.Distance); apothecaryDelugeAoEZoneDamagePercentage = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge AoE Damage Percentage", 5f, 1f, "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, restartRequired: true, FormatType.Percentage); apothecaryDelugeHealthPercentageRequiredForFullCharge = cfg.BindOptionSteppedSlider("Clay Apothecary", "Health Percentage for Full Charge", 25f, 1f, "", 5f, 50f, restartRequired: true, FormatType.Percentage); apothecaryDelugeHealthThreshold = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Health Threshold", 60f, 1f, "The health threshold the Apothecary must be under to use Tar Deluge.", 10f, 100f, restartRequired: true, FormatType.Percentage); apothecaryDelugeAoEZoneDuration = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Zone Duration", 20f, 0.1f, "The duration of time that the Tar Zone lingers for.", 8f, 60f, restartRequired: true, FormatType.Time); apothecaryDelugeChargeTime = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Charge Time", 3f, 0.1f, "The time that the Apothecary spends charging the Tar Ball before firing it.", 1f, 5f, restartRequired: true, FormatType.Time); apothecaryDelugeTravelTime = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Travel Time", 3f, 0.1f, "The time that the Tar Ball spends in the air before reaching it's target.", 1f, 5f, restartRequired: true, FormatType.Time); apothecaryDelugeFuseTime = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Fuse Time", 1f, 0.1f, "The time that the Tar Ball takes to explode after landing.", 0.2f, 2f, restartRequired: true, FormatType.Time); apothecaryDelugePlayerDetonateDamage = cfg.BindOptionSteppedSlider("Clay Apothecary", "Player Detonation Damage", 800f, 5f, "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, restartRequired: true, FormatType.Percentage); apothecaryDelugeCooldown = cfg.BindOptionSteppedSlider("Clay Apothecary", "Deluge Cooldown", 30f, 0.1f, "The cooldown of the Tar Deluge ability", 15f, 60f, restartRequired: true, FormatType.Time); } 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 ex) { Log.Debug(ex.ToString()); } } public static ConfigEntry<T> BindOption<T>(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<string>(Enum.GetNames(typeof(T))); } ConfigEntry<T> val2 = myConfig.Bind<T>(section, name, defaultValue, new ConfigDescription(description, val, Array.Empty<object>())); if (EnemyAbilities.RooInstalled) { TryRegisterOption<T>(val2, restartRequired); } return val2; } public static ConfigEntry<T> BindOptionSlider<T>(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>((int)min, (int)max)) : ((object)new AcceptableValueRange<float>(min, max))); ConfigEntry<T> val3 = myConfig.Bind<T>(section, name, defaultValue, new ConfigDescription(description, val2, Array.Empty<object>())); if (EnemyAbilities.RooInstalled) { TryRegisterOptionSlider<T>(val3, min, max, restartRequired); } return val3; } public static ConfigEntry<T> BindOptionSteppedSlider<T>(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<T> val2 = myConfig.Bind<T>(section, name, defaultValue, new ConfigDescription(description, (AcceptableValueBase)(object)new AcceptableValueRange<float>(min, max), Array.Empty<object>())); if (EnemyAbilities.RooInstalled) { TryRegisterOptionSteppedSlider<T>(val2, increment, min, max, restartRequired, formatType); } return val2; } public static void TryRegisterOption<T>(ConfigEntry<T> 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<string> val) { ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(val, new InputFieldConfig { submitOn = (SubmitEnum)6, restartRequired = restartRequired })); return; } if (entry is ConfigEntry<bool> val2) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(val2, restartRequired)); return; } if (entry is ConfigEntry<KeyboardShortcut> 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<T>(ConfigEntry<T> 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<int> 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<float> 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<T>(ConfigEntry<T> 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<float> 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", _ => "", }; } } public static class Utils { 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<HurtBox>(); 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<AISkillDriver>(); 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}"); return; } if (targetIdx == currentIdx) { Log.Warning($"Skilldriver {targetName} already has the target index of {targetIdx}"); return; } Dictionary<string, string> 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<AISkillDriver>(skills[currentIdx]); Object.DestroyImmediate((Object)(object)skills[currentIdx]); } for (int i = targetIdx; i < skills.Length; i++) { if (i != currentIdx) { master.AddComponentCopy<AISkillDriver>(skills[i]); Object.DestroyImmediate((Object)(object)skills[i]); } } skills = master.GetComponents<AISkillDriver>(); AISkillDriver val = ((IEnumerable<AISkillDriver>)skills).FirstOrDefault((Func<AISkillDriver, bool>)((AISkillDriver s) => s.customName == targetName)); if ((Object)(object)val != (Object)null && Array.IndexOf(skills, val) == targetIdx) { Log.Debug($"Successfully set {targetName} to {targetIdx}"); } else { Log.Error($"Done fucked it up on {targetName} with {targetIdx}"); } 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<AISkillDriver>)skills).FirstOrDefault((Func<AISkillDriver, bool>)((AISkillDriver s) => s.customName == target)); if ((Object)(object)val3 == (Object)null) { Log.Error("Unable to reset skill override for " + val2.customName + " targeting " + target); continue; } val2.nextHighPriorityOverride = val3; Log.Debug("successfully reset override for " + val2.customName + " targeting " + target); } } } public static T GetCopyOf<T>(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<T>(this GameObject go, T toAdd) where T : Component { return ((Component)(object)go.AddComponent<T>()).GetCopyOf(toAdd); } } } namespace EnemyAbilities.Abilities { public class BaseModule : MonoBehaviour { public virtual void Awake() { Log.Debug("Loading module " + ((object)this).GetType().Name); } } } 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<GameObject>((object)RoR2_DLC3_WorkerUnit.WorkerUnitBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC3_WorkerUnit.WorkerUnitMaster_prefab).WaitForCompletion(); public override void Awake() { base.Awake(); CreateSkill(); } public void CreateSkill() { //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_0078: 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_0088: 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_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) SkillDef val = ScriptableObject.CreateInstance<SkillDef>(); ((Object)val).name = "WorkerUnitBodyDrillBurrow"; val.skillName = "WorkerUnitDrillBurrow"; val.activationStateMachineName = "Weapon"; bool flag = default(bool); val.activationState = ContentAddition.AddEntityState<DrillBurrow>(ref flag); val.baseRechargeInterval = PluginConfig.prospectorBurrowCooldown.Value; val.cancelSprintingOnActivation = true; val.isCombatSkill = true; ContentAddition.AddSkillDef(val); SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val2).name = "WorkerUnitSecondaryFamily"; val2.variants = (Variant[])(object)new Variant[1] { new Variant { skillDef = val } }; GenericSkill val3 = bodyPrefab.AddComponent<GenericSkill>(); val3.skillName = "WorkerUnitDrillBurrow"; val3._skillFamily = val2; SkillLocator component = bodyPrefab.GetComponent<SkillLocator>(); component.secondary = val3; ContentAddition.AddSkillFamily(val2); AISkillDriver val4 = masterPrefab.AddComponent<AISkillDriver>(); val4.customName = "useSecondary"; val4.skillSlot = (SkillSlot)1; val4.requireSkillReady = true; val4.minDistance = 20f; val4.maxDistance = 50f; val4.selectionRequiresOnGround = true; val4.movementType = (MovementType)0; val4.aimType = (AimType)0; val4.ignoreNodeGraph = true; val4.maxUserHealthFraction = 1f; masterPrefab.ReorderSkillDrivers(val4, 0); } } public class DrillBurrow : BaseSkillState { private enum DrillBurrowState { None, Windup, Burrowed, Telegraphing, Attacking } public static float baseWindupDuration = PluginConfig.prospectorBurrowEntryDuration.Value; public static float baseBurrowDuration = PluginConfig.prospectorBurrowWaitDuration.Value; public static float baseTelegraphDuration = PluginConfig.prospectorBurrowTelegraphDuration.Value; public static float baseAttackDuration = 1f; public static float blastRadius = PluginConfig.prospectorBurrowRadius.Value; public static float force = 1500f; public static Vector3 bonusForce = new Vector3(0f, 2500f, 0f); public static float damageCoefficient = PluginConfig.prospectorBurrowDamageCoefficient.Value / 100f; public static float exitSpeedMultiplier = PluginConfig.prospectorBurrowBaseVelocity.Value / 100f; private static GameObject indicatorPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion(); private static GameObject explosionPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_BeetleGuard.BeetleGuardGroundSlam_prefab).WaitForCompletion(); private static GameObject burrowPrefab = Addressables.LoadAssetAsync<GameObject>((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 DrillBurrowState currentState = DrillBurrowState.None; public override void OnEnter() { //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_00bb: Expected O, but got Unknown //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_00e3: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); childLocator = ((Component)animator).GetComponent<ChildLocator>(); 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; 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(); } } 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_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_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_009f: 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_00bc: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_0112: 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_0134: 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) 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 position = target.healthComponent.body.transform.position; Vector3 val3 = startPos; if (position.y > startPos.y) { val3.y = position.y; } else { position.y = val3.y; } Vector3 val4 = Vector3.Lerp(val3, position, Mathf.Clamp01(stopwatch - windupDuration / burrowDuration)); RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(val4, Vector3.down, ref val5, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { val._origin = ((RaycastHit)(ref val5)).point + val2; } } 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) { ((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_0089: 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_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); } originalLayerIndex = ((EntityState)this).gameObject.layer; ((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_009f: 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_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_00d2: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) 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(CommonMasks.bullet))) { targetPos = ((RaycastHit)(ref val)).point; } indicatorInstance = Object.Instantiate<GameObject>(indicatorPrefab, targetPos, Util.QuaternionSafeLookRotation(Vector3.up)); indicatorInstance.transform.localScale = Vector3.one * blastRadius; TeamAreaIndicator component = indicatorInstance.GetComponent<TeamAreaIndicator>(); 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0082: 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_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_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_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_0111: 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_011c: 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_0186: 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_01a2: Expected O, but got Unknown //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) TeleportHelper.TeleportBody(((EntityState)this).characterBody, targetPos, false); Util.PlaySound("Play_MULT_m2_secondary_explode", ((EntityState)this).gameObject); 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<GameObject>((object)RoR2_Base_Vulture.VultureBody_prefab).WaitForCompletion(); private static GameObject masterPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Vulture.VultureMaster_prefab).WaitForCompletion(); public override void Awake() { base.Awake(); TargetingAndPredictionController val = bodyPrefab.AddComponent<TargetingAndPredictionController>(); val.manualTrackingMaxDistance = 100f; val.manualTrackingMaxAngle = 360f; CreateSkill(); CharacterBody.onBodyStartGlobal += AddMeleeHitBox; } private void AddMeleeHitBox(CharacterBody characterBody) { //IL_0084: 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_00ad: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)characterBody == (Object)null) && !((Object)(object)characterBody.master == (Object)null) && (Object)(object)characterBody.master.bodyPrefab != (Object)null && (Object)(object)characterBody.master.bodyPrefab == (Object)(object)bodyPrefab) { GameObject gameObject = ((Component)characterBody).gameObject; Transform modelTransform = characterBody.modelLocator.modelTransform; GameObject gameObject2 = ((Component)modelTransform).gameObject; CreateHitBoxAndGroup(modelTransform, "VultureMelee", new Vector3(0f, -2f, 0f), new Vector3(30f, 30f, 30f) * (PluginConfig.vultureSwoopHitBoxScale.Value / 100f)); } } public void CreateSkill() { //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_0078: 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_0088: 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_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_0130: Unknown result type (might be due to invalid IL or missing references) SwoopSkillDef swoopSkillDef = ScriptableObject.CreateInstance<SwoopSkillDef>(); ((Object)swoopSkillDef).name = "VultureBodySwoop"; ((SkillDef)swoopSkillDef).skillName = "VultureSwoop"; ((SkillDef)swoopSkillDef).activationStateMachineName = "Body"; bool flag = default(bool); ((SkillDef)swoopSkillDef).activationState = ContentAddition.AddEntityState<SwoopWindup>(ref flag); ((SkillDef)swoopSkillDef).baseRechargeInterval = PluginConfig.vultureSwoopCooldown.Value; ((SkillDef)swoopSkillDef).cancelSprintingOnActivation = true; ((SkillDef)swoopSkillDef).isCombatSkill = true; ContentAddition.AddSkillDef((SkillDef)(object)swoopSkillDef); SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val).name = "VultureSecondaryFamily"; val.variants = (Variant[])(object)new Variant[1] { new Variant { skillDef = (SkillDef)(object)swoopSkillDef } }; GenericSkill val2 = bodyPrefab.AddComponent<GenericSkill>(); val2.skillName = "VultureSwoop"; val2._skillFamily = val; SkillLocator component = bodyPrefab.GetComponent<SkillLocator>(); component.secondary = val2; ContentAddition.AddSkillFamily(val); AISkillDriver val3 = masterPrefab.AddComponent<AISkillDriver>(); val3.customName = "strafeAndUseSecondary"; val3.skillSlot = (SkillSlot)1; val3.requiredSkill = (SkillDef)(object)swoopSkillDef; val3.requireSkillReady = true; val3.minDistance = 25f; val3.maxDistance = 50f; val3.moveTargetType = (TargetType)0; val3.movementType = (MovementType)2; masterPrefab.ReorderSkillDrivers(val3, 2); ContentAddition.AddEntityState<Swoop>(ref flag); } 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<HitBox>(); ((Object)((Component)val2).gameObject).name = hitBoxObjName; HitBoxGroup val3 = ((Component)modelTransform).gameObject.AddComponent<HitBoxGroup>(); val3.groupName = hitBoxGroupName; val3.hitBoxes = (HitBox[])(object)new HitBox[1] { val2 }; } } 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<EntityStateMachine>)((Component)characterBody).GetComponents<EntityStateMachine>()).FirstOrDefault((Func<EntityStateMachine, bool>)((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<GameObject>((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_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_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_0121: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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) ((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<BaseAI>(); } 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(); 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_005e: 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) ((EntityState)this).FixedUpdate(); if ((Object)(object)((EntityState)this).characterMotor != (Object)null && ((EntityState)this).characterMotor.isGrounded) { ((EntityState)this).outer.SetNextStateToMain(); } if (((EntityState)this).fixedAge > duration) { if (ai.currentEnemy.characterBody.transform.position.y < ((EntityState)this).characterBody.transform.position.y) { ((EntityState)this).outer.SetNextStateToMain(); } 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 = PluginConfig.vultureSwoopPredictionTime.Value; private static float recoverDuration = 0.5f; private static GameObject slashEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Croco.CrocoSlash_prefab).WaitForCompletion(); private static GameObject hitEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.OmniImpactVFXSlash_prefab).WaitForCompletion(); private GameObject slashEffectInstance; private EffectManagerHelper _emh_slashEffectInstance; private GameObject jumpEffect = Addressables.LoadAssetAsync<GameObject>((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 = PluginConfig.vultureSwoopDamageCoefficient.Value / 100f; private float procCoefficient = 1f; private float crashAngle = 40f; private OverlapAttack attack; private int _origLayer; public override void OnEnter() { //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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //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(); 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<TargetingAndPredictionController>(); if ((Object)(object)targetController != (Object)null && ((EntityState)this).isAuthority) { trackedTarget = targetController.StartPredictTarget((Action)OnTargetLost); } if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((EntityState)this).characterMotor.onMovementHit += new MovementHitDelegate(OnMovementHit); } startLeftFoot = Random.RandomRangeInt(0, 2) == 1; DisableCollision(); 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)(PluginConfig.vultureSwoopInflictsBleed.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<SetStateOnHurt>(); if ((Object)(object)component != (Object)null) { component.SetStun(PluginConfig.vultureSwoopStunDurationOnImpact.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<EffectManagerHelper>)(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<HurtBox>)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<GameObject>(slashEffect, val); slashEffectInstance.transform.localScale = Vector3.one; } else { if ((Object)(object)_emh_slashEffectInstance != (Object)null && _emh_slashEffectInstance.OwningPool != null) { ((GenericPool<EffectManagerHelper>)(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<ScaleParticleSystemDuration>(); 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 Ena