Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PlayableDevastator v1.1.0
PlayableDevastator.dll
Decompiled 2 years agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using EntityStates; using EntityStates.GravekeeperBoss; using EntityStates.VoidMegaCrab.BackWeapon; using EntityStates.VoidMegaCrab.Weapon; using KinematicCharacterController; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [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.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Dragonyck")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("PlayableDevastator")] [assembly: AssemblyTitle("PlayableDevastator")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace PlayableDevastator; internal class Assets { public static AssetBundle MainAssetBundle; public static void PopulateAssets() { if ((Object)(object)MainAssetBundle == (Object)null) { using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PlayableDevastator.devastatorassets")) { MainAssetBundle = AssetBundle.LoadFromStream(stream); } } } } internal class FixStupidCollider : MonoBehaviour { private void OnEnable() { CapsuleCollider component = ((Component)this).GetComponent<CapsuleCollider>(); component.radius = 2f; component.height = 3f; } } internal class DisplayController : MonoBehaviour { private void OnEnable() { //IL_0016: 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) ((Component)this).transform.localPosition = new Vector3(0f, 1.5f, 0f); ((Component)this).transform.localRotation = Quaternion.Euler(0f, 345f, 0f); } } internal class Hook { internal static void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); Run.onRunStartGlobal += Run_onRunStartGlobal; } private static void Run_onRunStartGlobal(Run obj) { bool flag = false; foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.master) && Object.op_Implicit((Object)(object)readOnlyInstances.master.bodyPrefab) && ((Object)readOnlyInstances.master.bodyPrefab).name.Contains("「V??oid Devastator』")) { flag = true; } } if (flag && MainPlugin.openCrabRave.Value) { Application.OpenURL("https://www.youtube.com/watch?v=LDU_Txk06tM"); } } private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: 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_031d: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0338: 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_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = null; if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { val = damageInfo.attacker.GetComponent<CharacterBody>(); } if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Prefabs.shieldBuff) && Object.op_Implicit((Object)(object)val) && NetworkServer.active) { DamageInfo val2 = new DamageInfo { attacker = ((Component)self.body).gameObject, inflictor = ((Component)self.body).gameObject, damage = damageInfo.damage * 2f, procCoefficient = 0f, damageType = (DamageType)0, damageColorIndex = (DamageColorIndex)9, position = self.body.corePosition, rejected = false }; val.healthComponent.TakeDamage(val2); EffectManager.SimpleEffect(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidBarnacle/VoidBarnacleImpactExplosion.prefab").WaitForCompletion(), self.body.corePosition, Quaternion.identity, true); } if (Object.op_Implicit((Object)(object)damageInfo.attacker) && ((Object)damageInfo.attacker).name.Contains("「V??oid Devastator』Body") && ((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)19)) { DotDef dotDef = DotController.GetDotDef((DotIndex)8); DotController.InflictDot(((Component)self.body).gameObject, damageInfo.attacker, (DotIndex)8, dotDef.interval, 1f, (uint?)null); } if (Object.op_Implicit((Object)(object)self.body) && DamageAPI.HasModdedDamageType(damageInfo, Prefabs.collapse) && NetworkServer.active) { DotDef dotDef2 = DotController.GetDotDef((DotIndex)8); DotController.InflictDot(((Component)self.body).gameObject, damageInfo.attacker, (DotIndex)8, dotDef2.interval, 1f, (uint?)null); DotController.InflictDot(((Component)self.body).gameObject, damageInfo.attacker, (DotIndex)8, dotDef2.interval, 1f, (uint?)null); } if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)self.body) && NetworkServer.active) { if (DamageAPI.HasModdedDamageType(damageInfo, Prefabs.missile)) { bool alive = self.alive; float num = 5f; Vector3 position = damageInfo.position; Vector3 val3 = self.body.corePosition - position; float magnitude = ((Vector3)(ref val3)).magnitude; Quaternion val4 = ((magnitude != 0f) ? Util.QuaternionSafeLookRotation(val3) : Random.rotationUniform); float num2 = 0.5f; float num3 = Util.OnHitProcDamage(damageInfo.damage, val.damage, num2); ProjectileManager.instance.FireProjectile(Prefabs.missileStuckProjectile, position, val4, damageInfo.attacker, num3, 100f, damageInfo.crit, (DamageColorIndex)3, (GameObject)null, alive ? (magnitude * num) : (-1f)); } else if (DamageAPI.HasModdedDamageType(damageInfo, Prefabs.missileScepter)) { bool alive2 = self.alive; float num4 = 5f; Vector3 position2 = damageInfo.position; Vector3 val5 = self.body.corePosition - position2; float magnitude2 = ((Vector3)(ref val5)).magnitude; Quaternion val6 = ((magnitude2 != 0f) ? Util.QuaternionSafeLookRotation(val5) : Random.rotationUniform); float num5 = 0.5f; float num6 = Util.OnHitProcDamage(damageInfo.damage, val.damage, num5); ProjectileManager.instance.FireProjectile(Prefabs.missileStuckProjectileScepter, position2, val6, damageInfo.attacker, num6, 100f, damageInfo.crit, (DamageColorIndex)3, (GameObject)null, alive2 ? (magnitude2 * num4) : (-1f)); } } orig.Invoke(self, damageInfo); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Dragonyck.PlayableDevastator", "PlayableDevastator", "1.1.0")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.Dragonyck.PlayableDevastator"; public const string MODNAME = "PlayableDevastator"; public const string VERSION = "1.1.0"; public const string SURVIVORNAME = "「V??oid Devastator』"; public const string SURVIVORNAMEKEY = "DRAGONDEVASTATOR"; public static GameObject characterPrefab; public GameObject characterDisplay; public GameObject doppelganger; public static Color characterColor; protected internal static ConfigEntry<int> baseJumpCount; protected internal static ConfigEntry<float> mainRootSpeed; protected internal static ConfigEntry<float> baseMaxHealth; protected internal static ConfigEntry<float> levelMaxHealth; protected internal static ConfigEntry<float> baseRegen; protected internal static ConfigEntry<float> levelRegen; protected internal static ConfigEntry<float> baseMaxShield; protected internal static ConfigEntry<float> levelMaxShield; protected internal static ConfigEntry<float> baseMoveSpeed; protected internal static ConfigEntry<float> levelMoveSpeed; protected internal static ConfigEntry<float> baseAcceleration; protected internal static ConfigEntry<float> baseJumpPower; protected internal static ConfigEntry<float> levelJumpPower; protected internal static ConfigEntry<float> baseDamage; protected internal static ConfigEntry<float> levelDamage; protected internal static ConfigEntry<float> baseAttackSpeed; protected internal static ConfigEntry<float> levelAttackSpeed; protected internal static ConfigEntry<float> baseCrit; protected internal static ConfigEntry<float> levelCrit; protected internal static ConfigEntry<float> baseArmor; protected internal static ConfigEntry<float> levelArmor; protected internal static List<string> itemBlacklist = new List<string>(); protected internal static List<PickupIndex> tier1 = new List<PickupIndex>(); protected internal static List<PickupIndex> tier2 = new List<PickupIndex>(); protected internal static List<PickupIndex> tier3 = new List<PickupIndex>(); protected internal static ConfigEntry<bool> openCrabRave; protected internal static SkillDef scepterOverrideDef; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0060: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_0094: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00c8: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_00fc: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_0130: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_0164: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown //IL_0198: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Expected O, but got Unknown //IL_01cc: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Expected O, but got Unknown //IL_0200: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_0234: Expected O, but got Unknown //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0268: Expected O, but got Unknown //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Expected O, but got Unknown //IL_029c: Expected O, but got Unknown //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Expected O, but got Unknown //IL_02d0: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Expected O, but got Unknown //IL_0304: Expected O, but got Unknown //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Expected O, but got Unknown //IL_0338: Expected O, but got Unknown //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Expected O, but got Unknown //IL_036c: Expected O, but got Unknown //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03a0: Expected O, but got Unknown //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Expected O, but got Unknown //IL_03d4: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Expected O, but got Unknown //IL_0408: Expected O, but got Unknown //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Expected O, but got Unknown //IL_043c: Expected O, but got Unknown //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Expected O, but got Unknown //IL_046c: Expected O, but got Unknown baseJumpCount = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("Base Jump Count", "Value"), 1, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); mainRootSpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Main Root Speed", "Value"), 33f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseMaxHealth = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Max Health", "Value"), 160f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelMaxHealth = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Max Health", "Value"), 45f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseRegen = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Regen", "Value"), 1f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelRegen = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Regen", "Value"), 0.4f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseMaxShield = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Max Shield", "Value"), 0f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelMaxShield = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Max Shield", "Value"), 0f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseMoveSpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Move Speed", "Value"), 6.5f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelMoveSpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Move Speed", "Value"), 0f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseAcceleration = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Acceleration", "Value"), 110f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseJumpPower = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Jump Power", "Value"), 15f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelJumpPower = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Jump Power", "Value"), 0f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseDamage = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Damage", "Value"), 12f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelDamage = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Damage", "Value"), 2.4f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseAttackSpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Attack Speed", "Value"), 1f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelAttackSpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Attack Speed", "Value"), 0f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseCrit = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Crit", "Value"), 0f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelCrit = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Crit", "Value"), 0f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseArmor = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Base Armor", "Value"), 90f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); levelArmor = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Level Armor", "Value"), 1f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); openCrabRave = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Cursed Crab Rave", "Enable"), false, new ConfigDescription("Opens Crab Rave in the background", (AcceptableValueBase)null, Array.Empty<object>())); Assets.PopulateAssets(); CreatePrefab(); Prefabs.CreatePrefabs(); RegisterStates(); RegisterCharacter(); CreateDoppelganger(); Hook.Hooks(); if (ModCompat.AncientScepterEnabled) { ModCompat.AddScepterSupport(); } } private void RegisterStates() { //IL_0005: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) bool flag = false; ContentAddition.AddEntityState<CharacterMain>(ref flag); ContentAddition.AddEntityState<Primary>(ref flag); ContentAddition.AddEntityState<FirePrimary>(ref flag); ContentAddition.AddEntityState<Secondary>(ref flag); ContentAddition.AddEntityState<Utility>(ref flag); ContentAddition.AddEntityState<AltUtility>(ref flag); ContentAddition.AddEntityState<Special>(ref flag); } internal void CreatePrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) characterPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabBody.prefab").WaitForCompletion(), "「V??oid Devastator』Body", true); characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true; CapsuleCollider component = characterPrefab.GetComponent<CapsuleCollider>(); component.radius = 2f; component.height = 5f; characterPrefab.GetComponent<KinematicCharacterMotor>().Capsule = component; characterPrefab.AddComponent<FixStupidCollider>(); CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>(); ((Object)component2).name = "「V??oid Devastator』Body"; component2.baseNameToken = "「V??oid Devastator』"; component2.bodyFlags = (BodyFlags)1040; component2.mainRootSpeed = mainRootSpeed.Value; component2.baseMaxHealth = baseMaxHealth.Value; component2.levelMaxHealth = levelMaxHealth.Value; component2.baseRegen = baseRegen.Value; component2.levelRegen = levelRegen.Value; component2.baseMaxShield = baseMaxShield.Value; component2.levelMaxShield = levelMaxShield.Value; component2.baseMoveSpeed = baseMoveSpeed.Value; component2.levelMoveSpeed = levelMoveSpeed.Value; component2.baseAcceleration = baseAcceleration.Value; component2.baseJumpPower = baseJumpPower.Value; component2.levelJumpPower = levelJumpPower.Value; component2.baseDamage = baseDamage.Value; component2.levelDamage = levelDamage.Value; component2.baseAttackSpeed = baseAttackSpeed.Value; component2.levelAttackSpeed = levelAttackSpeed.Value; component2.baseCrit = baseCrit.Value; component2.levelCrit = levelCrit.Value; component2.baseArmor = baseArmor.Value; component2.levelArmor = levelArmor.Value; component2.baseJumpCount = baseJumpCount.Value; component2.hideCrosshair = false; characterColor = component2.bodyColor; component2.aimOriginTransform.localPosition = new Vector3(0f, 6f, 0f); HealthComponent component3 = characterPrefab.GetComponent<HealthComponent>(); component3.health = baseMaxHealth.Value; component3.shield = baseMaxShield.Value; component3.barrier = 0f; component3.magnetiCharge = 0f; component3.body = null; component3.dontShowHealthbar = false; component3.globalDeathEventChanceCoefficient = 1f; characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 14f; characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true; characterPrefab.GetComponent<CameraTargetParams>().cameraParams = Addressables.LoadAssetAsync<CharacterCameraParams>((object)"RoR2/Base/Common/ccpStandard.asset").WaitForCompletion(); ModelLocator component4 = characterPrefab.GetComponent<ModelLocator>(); component4.modelBaseTransform.localPosition = new Vector3(0f, -2.6f, 0f); GameObject gameObject = ((Component)component4.modelTransform).gameObject; gameObject.transform.localScale = Vector3.one * 0.3f; HurtBoxGroup component5 = gameObject.GetComponent<HurtBoxGroup>(); component5.mainHurtBox.collider = (Collider)(object)component; EntityStateMachine component6 = ((Component)component2).GetComponent<EntityStateMachine>(); component6.mainStateType = new SerializableEntityStateType(typeof(CharacterMain)); Utils.NewStateMachine<Idle>(characterPrefab, "Shield"); Utils.NewStateMachine<Idle>(characterPrefab, "Weapon"); NetworkStateMachine component7 = ((Component)component2).GetComponent<NetworkStateMachine>(); component7.stateMachines = characterPrefab.GetComponents<EntityStateMachine>(); SkillSetup(); ContentAddition.AddBody(characterPrefab); } private void SkillSetup() { GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>(); foreach (GenericSkill val in componentsInChildren) { if (val.skillFamily.variants[0].skillDef.activationStateMachineName != "WhiteCannon" && val.skillFamily.variants[0].skillDef.activationStateMachineName != "BlackCannon") { Object.DestroyImmediate((Object)(object)val); } } PassiveSetup(); PrimarySetup(); SecondarySetup(); UtilitySetup(); SpecialSetup(); } private void PassiveSetup() { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); LanguageAPI.Add("DRAGONDEVASTATOR_PASSIVE_NAME", "Collapsing Star"); LanguageAPI.Add("DRAGONDEVASTATOR_PASSIVE_DESCRIPTION", "As a creature of the <style=cIsVoid>Void</style>, the Devastator dies spectacularly, creating a <style=cIsVoid>void rift</style> on death that <style=cDeath>executes</style> everything inside the bubble. Additionally, every time the Devastator would inflict one stack of <style=cIsDamage>collapse</style>, inflict another."); component.passiveSkill.enabled = true; component.passiveSkill.skillNameToken = "DRAGONDEVASTATOR_PASSIVE_NAME"; component.passiveSkill.skillDescriptionToken = "DRAGONDEVASTATOR_PASSIVE_DESCRIPTION"; component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive"); } private void PrimarySetup() { //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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00d2: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); LanguageAPI.Add("DRAGONDEVASTATOR_M1", "Scour"); LanguageAPI.Add("DRAGONDEVASTATOR_M1_DESCRIPTION", "Fire a spray of explosive minelets for <style=cIsDamage>85% damage</style>. They stick to terrain and can be detonated with Banish Charge, dealing it's full <style=cIsDamage>damage</style> in a small area."); SkillDef val = Object.Instantiate<SkillDef>(Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidMegaCrab/FireCrabWhiteCannon.asset").WaitForCompletion()); val.activationState = new SerializableEntityStateType(typeof(Primary)); val.skillDescriptionToken = "DRAGONDEVASTATOR_M1_DESCRIPTION"; val.skillName = "DRAGONDEVASTATOR_M1"; val.skillNameToken = "DRAGONDEVASTATOR_M1"; val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("m1"); ContentAddition.AddSkillDef(val); SkillFamily val2 = Object.Instantiate<SkillFamily>(component.primary.skillFamily); Variant[] variants = val2.variants; Variant val3 = new Variant { skillDef = val }; ((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null); variants[0] = val3; ContentAddition.AddSkillFamily(val2); Reflection.SetFieldValue<SkillFamily>((object)component.primary, "_skillFamily", val2); } private void SecondarySetup() { //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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00d2: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); LanguageAPI.Add("DRAGONDEVASTATOR_M2", "Banish Charge"); LanguageAPI.Add("DRAGONDEVASTATOR_M2_DESCRIPTION", "Hurl an unstable void explosive for <style=cIsDamage>600% damage</style>."); SkillDef val = Object.Instantiate<SkillDef>(Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidMegaCrab/FireCrabBlackCannon.asset").WaitForCompletion()); val.activationState = new SerializableEntityStateType(typeof(Secondary)); val.skillDescriptionToken = "DRAGONDEVASTATOR_M2_DESCRIPTION"; val.skillName = "DRAGONDEVASTATOR_M2"; val.skillNameToken = "DRAGONDEVASTATOR_M2"; val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("m2"); ContentAddition.AddSkillDef(val); SkillFamily val2 = Object.Instantiate<SkillFamily>(component.secondary.skillFamily); Variant[] variants = val2.variants; Variant val3 = new Variant { skillDef = val }; ((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null); variants[0] = val3; ContentAddition.AddSkillFamily(val2); Reflection.SetFieldValue<SkillFamily>((object)component.secondary, "_skillFamily", val2); } private void UtilitySetup() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); LanguageAPI.Add("DRAGONDEVASTATOR_UTIL", "Submerge"); LanguageAPI.Add("DRAGONDEVASTATOR_UTIL_DESCRIPTION", "Retreat into the void briefly, re-emerging a short distance away, influenced by directional input. An explosion is created on arrival around Devastator, <style=cIsDamage>stunning</style> and dealing <style=cIsDamage>280% damage</style>."); SkillDef val = ScriptableObject.CreateInstance<SkillDef>(); val.activationState = new SerializableEntityStateType(typeof(Utility)); val.activationStateMachineName = "Body"; val.baseMaxStock = 2; val.baseRechargeInterval = 4f; val.beginSkillCooldownOnSkillEnd = false; val.canceledFromSprinting = false; val.fullRestockOnAssign = false; val.interruptPriority = (InterruptPriority)0; val.isCombatSkill = false; val.mustKeyPress = true; val.cancelSprintingOnActivation = false; val.rechargeStock = 1; val.requiredStock = 1; val.stockToConsume = 1; val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("utility"); val.skillDescriptionToken = "DRAGONDEVASTATOR_UTIL_DESCRIPTION"; val.skillName = "DRAGONDEVASTATOR_UTIL"; val.skillNameToken = "DRAGONDEVASTATOR_UTIL"; ContentAddition.AddSkillDef(val); component.utility = characterPrefab.AddComponent<GenericSkill>(); SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); val2.variants = (Variant[])(object)new Variant[1]; Reflection.SetFieldValue<SkillFamily>((object)component.utility, "_skillFamily", val2); SkillFamily skillFamily = component.utility.skillFamily; Variant[] variants = skillFamily.variants; Variant val3 = new Variant { skillDef = val }; ((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null); variants[0] = val3; ContentAddition.AddSkillFamily(skillFamily); LanguageAPI.Add("DRAGONDEVASTATORALT_UTIL", "Abjure"); LanguageAPI.Add("DRAGONDEVASTATORALT_UTIL_DESCRIPTION", "Create a bubble of <style=cIsVoid>void energy</style>, negating <style=cIsDamage>projectiles</style> around the Devastator briefly. Any damage taken while the bubble is active is returned to the attacker and its <style=cIsDamage>damage</style> is doubled."); val = ScriptableObject.CreateInstance<SkillDef>(); val.activationState = new SerializableEntityStateType(typeof(AltUtility)); val.activationStateMachineName = "Shield"; val.baseMaxStock = 1; val.baseRechargeInterval = 8f; val.beginSkillCooldownOnSkillEnd = false; val.canceledFromSprinting = false; val.fullRestockOnAssign = false; val.interruptPriority = (InterruptPriority)0; val.isCombatSkill = false; val.mustKeyPress = true; val.cancelSprintingOnActivation = false; val.rechargeStock = 1; val.requiredStock = 1; val.stockToConsume = 1; val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("altutility"); val.skillDescriptionToken = "DRAGONDEVASTATORALT_UTIL_DESCRIPTION"; val.skillName = "DRAGONDEVASTATORALT_UTIL"; val.skillNameToken = "DRAGONDEVASTATORALT_UTIL"; ContentAddition.AddSkillDef(val); Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants2 = skillFamily.variants; int num = skillFamily.variants.Length - 1; val3 = new Variant { skillDef = val, unlockableDef = null }; ((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null); variants2[num] = val3; } private void SpecialSetup() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01f4: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); LanguageAPI.Add("DRAGONDEVASTATOR_SPEC", "Annihilate"); LanguageAPI.Add("DRAGONDEVASTATOR_SPEC_DESCRIPTION", "Fire a burst of homing void spikes that deal <style=cIsDamage>34% damage</style> each and stick to hit surfaces, <style=cIsDamage>detonating</style> after a short duration for <style=cIsDamage>17% damage</style> and applies <style=cIsDamage>Collapse</style>."); SkillDef val = ScriptableObject.CreateInstance<SkillDef>(); val.activationState = new SerializableEntityStateType(typeof(Special)); val.activationStateMachineName = "BackWeapon"; val.baseMaxStock = 1; val.baseRechargeInterval = 8f; val.beginSkillCooldownOnSkillEnd = false; val.canceledFromSprinting = false; val.fullRestockOnAssign = false; val.interruptPriority = (InterruptPriority)0; val.isCombatSkill = true; val.mustKeyPress = true; val.cancelSprintingOnActivation = false; val.rechargeStock = 1; val.requiredStock = 1; val.stockToConsume = 1; val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("special"); val.skillDescriptionToken = "DRAGONDEVASTATOR_SPEC_DESCRIPTION"; val.skillName = "DRAGONDEVASTATOR_SPEC"; val.skillNameToken = "DRAGONDEVASTATOR_SPEC"; ContentAddition.AddSkillDef(val); component.special = characterPrefab.AddComponent<GenericSkill>(); SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); val2.variants = (Variant[])(object)new Variant[1]; Reflection.SetFieldValue<SkillFamily>((object)component.special, "_skillFamily", val2); SkillFamily skillFamily = component.special.skillFamily; Variant[] variants = skillFamily.variants; Variant val3 = new Variant { skillDef = val }; ((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null); variants[0] = val3; ContentAddition.AddSkillFamily(skillFamily); LanguageAPI.Add("DRAGONDEVASTATOR_SPEC_SCEPTER", "Unmaker Barrage"); LanguageAPI.Add("DRAGONDEVASTATOR_SPEC_DESCRIPTION_SCEPTER", "Fire a cluster of homing void spikes that burrow into enemies and terrain, that create a large explosion dealing <style=cIsDamage>17% damage</style> and applies <style=cIsDamage>Collapse</style>."); scepterOverrideDef = ScriptableObject.CreateInstance<SkillDef>(); scepterOverrideDef.activationState = new SerializableEntityStateType(typeof(SpecialScepter)); scepterOverrideDef.activationStateMachineName = "BackWeapon"; scepterOverrideDef.baseMaxStock = 1; scepterOverrideDef.baseRechargeInterval = 8f; scepterOverrideDef.beginSkillCooldownOnSkillEnd = false; scepterOverrideDef.canceledFromSprinting = false; scepterOverrideDef.fullRestockOnAssign = false; scepterOverrideDef.interruptPriority = (InterruptPriority)0; scepterOverrideDef.isCombatSkill = true; scepterOverrideDef.mustKeyPress = true; scepterOverrideDef.cancelSprintingOnActivation = false; scepterOverrideDef.rechargeStock = 1; scepterOverrideDef.requiredStock = 1; scepterOverrideDef.stockToConsume = 1; scepterOverrideDef.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("scepter"); scepterOverrideDef.skillDescriptionToken = "DRAGONDEVASTATOR_SPEC_DESCRIPTION_SCEPTER"; scepterOverrideDef.skillName = "DRAGONDEVASTATOR_SPEC_SCEPTER"; scepterOverrideDef.skillNameToken = "DRAGONDEVASTATOR_SPEC_SCEPTER"; ContentAddition.AddSkillDef(val); } private void RegisterCharacter() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) characterDisplay = PrefabAPI.InstantiateClone(characterPrefab, "「V??oid Devastator』Display", true); Object.Destroy((Object)(object)characterDisplay.GetComponent<KinematicCharacterMotor>()); Object.Destroy((Object)(object)characterDisplay.GetComponent<CharacterBody>()); Object.Destroy((Object)(object)characterDisplay.GetComponent<CharacterMotor>()); Object.Destroy((Object)(object)characterDisplay.GetComponent<CharacterDirection>()); characterDisplay.transform.localRotation = Quaternion.Euler(0f, 344f, 0f); characterDisplay.transform.rotation = Quaternion.Euler(0f, 344f, 0f); characterDisplay.transform.localScale = Vector3.one * 0.5f; characterDisplay.transform.position = new Vector3(0f, 1.5f, 0f); characterDisplay.AddComponent<DisplayController>(); characterDisplay.GetComponent<ModelLocator>().modelBaseTransform.localScale = Vector3.one; RendererInfo[] baseRendererInfos = characterDisplay.GetComponentInChildren<CharacterModel>().baseRendererInfos; for (int i = 0; i < baseRendererInfos.Length; i++) { Material val = Object.Instantiate<Material>(baseRendererInfos[i].defaultMaterial); val.DisableKeyword("DITHER"); baseRendererInfos[i].defaultMaterial = val; } string text = "Void Devastator is a bulky tank of a survivor, using ranged attacks to batter whole groups of foes while inflicting multiple stacks of collapse.<style=cSub>\r\n\r\n< ! > Devastator is a little slower than the average survivor- especially when using the alternate utility." + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > Scour is a close-range combo setup tool. It leaves explosive charges embedded where it strikes, which can be detonated with either Banish Charge or the explosion from Submerge. " + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > Your utility choice massively influences your build- Submerge gives excellent evasion and offense, while Abjure makes you a tanky bulwark." + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > Annihilate's on-hit and on-explode damage are both fairly weak, but the flurries of Collapse inflicted can decimate the health of bosses." + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > It is time for crab."; string text2 = "..and so it left, off to hunt more prey among the stars."; string text3 = "..and so it returned, having caught worthy quarry."; LanguageAPI.Add("DRAGONDEVASTATOR_NAME", "「V??oid Devastator』"); LanguageAPI.Add("DRAGONDEVASTATOR_DESCRIPTION", text); LanguageAPI.Add("DRAGONDEVASTATOR_SUBTITLE", ""); LanguageAPI.Add("DRAGONDEVASTATOR_OUTRO", text2); LanguageAPI.Add("DRAGONDEVASTATOR_FAIL", text3); SurvivorDef val2 = ScriptableObject.CreateInstance<SurvivorDef>(); val2.cachedName = "DRAGONDEVASTATOR_NAME"; val2.unlockableDef = null; val2.descriptionToken = "DRAGONDEVASTATOR_DESCRIPTION"; val2.primaryColor = characterColor; val2.bodyPrefab = characterPrefab; val2.displayPrefab = characterDisplay; val2.outroFlavorToken = "DRAGONDEVASTATOR_OUTRO"; val2.mainEndingEscapeFailureFlavorToken = "DRAGONDEVASTATOR_FAIL"; ContentAddition.AddSurvivorDef(val2); } private void CreateDoppelganger() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) doppelganger = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabMaster.prefab").WaitForCompletion(), "「V??oid Devastator』Master", true); ContentAddition.AddMaster(doppelganger); CharacterMaster component = doppelganger.GetComponent<CharacterMaster>(); component.bodyPrefab = characterPrefab; } } public static class ModCompat { private static bool? emoteEnabled; private static bool? skillsEnabled; private static bool? ancientEnabled; public static bool AncientScepterEnabled { get { if (!ancientEnabled.HasValue) { ancientEnabled = Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); } return ancientEnabled.Value; } } public static void AddScepterSupport() { ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(MainPlugin.scepterOverrideDef, "「V??oid Devastator』Body", (SkillSlot)3, 0); } } internal class Prefabs { internal static ModdedDamageType collapse; internal static ModdedDamageType missile; internal static ModdedDamageType missileScepter; internal static GameObject chargedBlackCannonProjectile; internal static GameObject missileProjectile; internal static GameObject missileScepterProjectile; internal static GameObject missileScepterProjectileGhost; internal static GameObject missileStuckProjectile; internal static GameObject missileStuckProjectileScepter; internal static GameObject dashEffect; internal static GameObject shieldAttachment; internal static BuffDef shieldBuff; internal static void CreatePrefabs() { //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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0221: 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_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) shieldBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)shieldBuff).name = "Void Shield"; shieldBuff.iconSprite = Assets.MainAssetBundle.LoadAsset<Sprite>("shieldBuff"); shieldBuff.buffColor = Color.white; shieldBuff.canStack = false; shieldBuff.isDebuff = false; shieldBuff.eliteDef = null; shieldBuff.isHidden = false; ContentAddition.AddBuffDef(shieldBuff); collapse = DamageAPI.ReserveDamageType(); missile = DamageAPI.ReserveDamageType(); missileScepter = DamageAPI.ReserveDamageType(); GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/MegaConstructBubbleShield.prefab").WaitForCompletion(); shieldAttachment = PrefabAPI.InstantiateClone(val, "VoidDevastatorShieldAttachment", true); shieldAttachment.GetComponent<NetworkIdentity>().localPlayerAuthority = true; ((Renderer)((Component)shieldAttachment.transform.Find("Fairies")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ChainLightningVoid/matLightningVoid.mat").WaitForCompletion(); Transform val2 = shieldAttachment.transform.Find("Collision"); val2.localPosition = new Vector3(1f, -4f, 0f); Object.Destroy((Object)(object)((Component)val2).GetComponent<MeshCollider>()); ((Component)val2).gameObject.AddComponent<SphereCollider>().radius = 0.25f; Transform val3 = val2.Find("ActiveVisual"); val3.localScale = Vector3.one * 0.25f; Renderer component = ((Component)val3).GetComponent<Renderer>(); component.sharedMaterials = (Material[])(object)new Material[1] { Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidRaidCrab/matVoidRaidCrabTripleBeamSphere2.mat").WaitForCompletion() }; dashEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MegaCrabBlackCannonProjectile.prefab").WaitForCompletion(), "VoidDashExplosionEffect", false); Utils.RegisterEffect(dashEffect, 1f, "Play_voidman_m2_explode"); chargedBlackCannonProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MegaCrabBlackCannonProjectile.prefab").WaitForCompletion(), "ChargedBlackCannonProjectile", true); chargedBlackCannonProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(collapse); ContentAddition.AddProjectile(chargedBlackCannonProjectile); missileProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MissileVoidBigProjectile.prefab").WaitForCompletion(), "VoidMissileProjectile", true); missileProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(missile); ContentAddition.AddProjectile(missileProjectile); missileStuckProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MegaCrabWhiteCannonStuckProjectile.prefab").WaitForCompletion(), "VoidMissileStuckProjectile", true); missileStuckProjectile.GetComponent<ProjectileController>().allowPrediction = false; missileStuckProjectile.AddComponent<SphereCollider>().radius = 0.5f; ProjectileStickOnImpact val4 = missileStuckProjectile.AddComponent<ProjectileStickOnImpact>(); val4.ignoreWorld = false; val4.ignoreCharacters = false; ProjectileImpactExplosion component2 = missileStuckProjectile.GetComponent<ProjectileImpactExplosion>(); component2.lifetimeAfterImpact = 2f; component2.lifetime = 2f; component2.timerAfterImpact = true; component2.destroyOnEnemy = false; component2.destroyOnWorld = false; ((ProjectileExplosion)component2).blastDamageCoefficient = 1f; ((ProjectileExplosion)component2).explosionEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidBarnacle/VoidBarnacleImpactExplosion.prefab").WaitForCompletion(); component2.impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidBarnacle/VoidBarnacleImpactExplosion.prefab").WaitForCompletion(); missileStuckProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(collapse); ContentAddition.AddProjectile(missileStuckProjectile); missileStuckProjectileScepter = PrefabAPI.InstantiateClone(missileStuckProjectile, "VoidMissileStuckScepterProjectile", true); ((ProjectileExplosion)missileStuckProjectileScepter.GetComponent<ProjectileImpactExplosion>()).blastRadius = 6f; ContentAddition.AddProjectile(missileStuckProjectileScepter); missileScepterProjectileGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MissileVoidBigGhost.prefab").WaitForCompletion(), "VoidMissileScepterProjectileGhost", false); ((Renderer)missileScepterProjectileGhost.GetComponentInChildren<TrailRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/RandomEquipmentTrigger/matBottledChaosTrail.mat").WaitForCompletion(); missileScepterProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MissileVoidBigProjectile.prefab").WaitForCompletion(), "VoidMissileScepterProjectile", true); missileScepterProjectile.AddComponent<ProjectileController>().ghostPrefab = missileScepterProjectileGhost; missileScepterProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(missile); ContentAddition.AddProjectile(missileScepterProjectile); } } internal class CharacterMain : GenericCharacterMain { public override void Update() { ((GenericCharacterMain)this).Update(); ((BaseCharacterMain)this).modelAnimator.SetBool("isSprinting", false); } } internal class Primary : ChargeCrabWhiteCannon { public override FireCrabCannonBase GetNextState() { return (FireCrabCannonBase)(object)new FirePrimary(); } public override void OnEnter() { //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) ((ChargeCrabCannonBase)this).baseDuration = 0.6f; ((ChargeCrabCannonBase)this).chargeEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegacrabWhiteSphereChargeFX.prefab").WaitForCompletion(); ((ChargeCrabCannonBase)this).chargeMuzzleName = "MuzzleWhiteCannon"; ((ChargeCrabCannonBase)this).soundName = "Play_voidDevastator_m1_chargeUp"; ((ChargeCrabCannonBase)this).animationLayerName = "Left Gun Override (Arm)"; ((ChargeCrabCannonBase)this).animationStateName = "LeftShootPrepAndCharge"; ((ChargeCrabCannonBase)this).animationPlaybackRateParam = "LeftCharge.playbackRate"; ((ChargeCrabCannonBase)this).animationCrossfadeDuration = 0.2f; ((ChargeCrabCannonBase)this).OnEnter(); } } internal class FirePrimary : FireCrabWhiteCannon { public override void OnEnter() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) ((FireCrabCannonBase)this).projectileCount = 10; ((FireCrabCannonBase)this).muzzleflashEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MegaCrabWhiteMuzzleFlash.prefab").WaitForCompletion(); ((FireCrabCannonBase)this).projectilePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/MegaCrabWhiteCannonProjectile.prefab").WaitForCompletion(); ((FireCrabCannonBase)this).totalYawSpread = 2f; ((FireCrabCannonBase)this).spread = FireHook.spread; ((FireCrabCannonBase)this).muzzleName = "MuzzleWhiteCannon"; ((FireCrabCannonBase)this).attackSound = "Play_voidDevastator_m1_fire"; ((FireCrabCannonBase)this).OnEnter(); ((FireCrabCannonBase)this).fireDuration = 0f; } public override void FixedUpdate() { ((FireCrabCannonBase)this).FixedUpdate(); if (((FireCrabCannonBase)this).projectilesFired < ((FireCrabCannonBase)this).projectileCount) { MyFireProjectile(); } } private void MyFireProjectile() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(((FireCrabCannonBase)this).attackSound, ((EntityState)this).gameObject); ((EntityState)this).characterBody.SetAimTimer(3f); if (Object.op_Implicit((Object)(object)((FireCrabCannonBase)this).muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(((FireCrabCannonBase)this).muzzleflashEffectPrefab, ((EntityState)this).gameObject, ((FireCrabCannonBase)this).muzzleName, false); } if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); int num = Mathf.FloorToInt((float)((FireCrabCannonBase)this).projectilesFired - (float)(((FireCrabCannonBase)this).projectileCount - 1) / 2f); float num2 = Random.Range(0f - ((FireCrabCannonBase)this).spread, ((FireCrabCannonBase)this).spread) / 2f; float num3 = Random.Range(0f - ((FireCrabCannonBase)this).spread, ((FireCrabCannonBase)this).spread) / 2f; Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num3, num2); Vector3 position = ((FireCrabCannonBase)this).muzzleTransform.position; ProjectileManager.instance.FireProjectile(((FireCrabCannonBase)this).projectilePrefab, position, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, ((BaseState)this).damageStat * ((FireCrabCannonBase)this).damageCoefficient, ((FireCrabCannonBase)this).force, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f); } ((FireCrabCannonBase)this).projectilesFired = ((FireCrabCannonBase)this).projectilesFired + 1; } } internal class Secondary : ChargeCrabBlackCannon { public override void OnEnter() { //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) ((ChargeCrabCannonBase)this).baseDuration = 1f; ((ChargeCrabCannonBase)this).chargeEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegacrabBlackSphereChargeFX.prefab").WaitForCompletion(); ((ChargeCrabCannonBase)this).chargeMuzzleName = "MuzzleBlackCannon"; ((ChargeCrabCannonBase)this).soundName = "Play_voidDevastator_m2_chargeUp"; ((ChargeCrabCannonBase)this).animationLayerName = "Right Gun Override (Arm)"; ((ChargeCrabCannonBase)this).animationStateName = "RightShootPrepAndCharge"; ((ChargeCrabCannonBase)this).animationPlaybackRateParam = "RightCharge.playbackRate"; ((ChargeCrabCannonBase)this).animationCrossfadeDuration = 0.2f; ((ChargeCrabCannonBase)this).OnEnter(); } } internal class Special : FireVoidMissiles { public override void OnEnter() { FireVoidMissiles.projectilePrefab = Prefabs.missileProjectile; ((FireVoidMissiles)this).OnEnter(); } } internal class SpecialScepter : FireVoidMissiles { public override void OnEnter() { FireVoidMissiles.projectilePrefab = Prefabs.missileScepterProjectile; FireVoidMissiles.baseDurationBetweenMissiles = 0.1f; ((FireVoidMissiles)this).OnEnter(); } } internal class Utility : BaseSkillState { private float duration = 0.25f; public float speedCoefficient = 5f; private Vector3 blinkVector = Vector3.zero; private HurtBoxGroup hurtboxGroup; public override void OnEnter() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlaySound("Play_voidman_m2_shoot", ((EntityState)this).gameObject); blinkVector = GetBlinkVector(); EffectManager.SimpleEffect(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherDashEffect.prefab").WaitForCompletion(), ((EntityState)this).characterBody.corePosition, Util.QuaternionSafeLookRotation(((EntityState)this).characterDirection.forward, Vector3.up), false); Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>(); if (Object.op_Implicit((Object)(object)hurtboxGroup)) { int hurtBoxesDeactivatorCounter = hurtboxGroup.hurtBoxesDeactivatorCounter + 1; hurtboxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } PrintController component = ((Component)modelTransform).GetComponent<PrintController>(); if (Object.op_Implicit((Object)(object)component)) { component.printTime = 0.8f; ((Behaviour)component).enabled = true; } } } private Vector3 GetBlinkVector() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); return ((Vector3)(ref val)).normalized; } public override void FixedUpdate() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.isSprinting = true; if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += blinkVector * (((BaseState)this).moveSpeedStat * speedCoefficient * Time.fixedDeltaTime); } } public override void OnExit() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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) ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)hurtboxGroup)) { int hurtBoxesDeactivatorCounter = hurtboxGroup.hurtBoxesDeactivatorCounter - 1; hurtboxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } EffectManager.SimpleEffect(Prefabs.dashEffect, ((EntityState)this).characterBody.corePosition, Quaternion.identity, false); if (((EntityState)this).isAuthority) { BlastAttack val = new BlastAttack(); val.radius = 15f; val.procCoefficient = 1f; val.position = ((EntityState)this).transform.position; val.attacker = ((EntityState)this).gameObject; val.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); val.baseDamage = ((EntityState)this).characterBody.damage * 2.8f; val.falloffModel = (FalloffModel)0; val.damageType = (DamageType)32; val.baseForce = 200f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.attackerFiltering = (AttackerFiltering)2; val.Fire(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class AltUtility : BaseSkillState { private float duration = 4f; private NetworkedBodyAttachment attachment; private AimRequest request; public override void OnEnter() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlaySound("Play_voidman_shift_end", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Prefabs.shieldBuff); attachment = Object.Instantiate<GameObject>(Prefabs.shieldAttachment, new Vector3(0f, 0f, 0.1f), Quaternion.identity, (Transform)null).GetComponent<NetworkedBodyAttachment>(); attachment.AttachToGameObjectAndSpawn(((Component)((EntityState)this).characterBody).gameObject, (string)null); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { request.Dispose(); } if (NetworkServer.active && Object.op_Implicit((Object)(object)attachment)) { ((EntityState)this).characterBody.RemoveBuff(Prefabs.shieldBuff); EntityState.Destroy((Object)(object)((Component)attachment).gameObject); } } } internal class Utils { public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) SerializableEntityStateType val = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref val))..ctor(typeof(T)); EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>(); val2.customName = customName; val2.initialStateType = val; val2.mainStateType = val; return val2; } internal static T CopyComponent<T>(T original, GameObject destination) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return (T)(object)((val is T) ? val : null); } public static Sprite CreateSpriteFromTexture(Texture2D texture) { //IL_0025: 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.op_Implicit((Object)(object)texture)) { return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f)); } return null; } public static GameObject FindInActiveObjectByName(string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 Transform[] array = Resources.FindObjectsOfTypeAll<Transform>(); for (int i = 0; i < array.Length; i++) { if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name) { return ((Component)array[i]).gameObject; } } return null; } public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = scale; HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>(); HitBox val3 = val.AddComponent<HitBox>(); val.layer = LayerIndex.projectile.intVal; val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 }; val2.groupName = name; return val; } internal static void RegisterEffect(GameObject effect, float duration, string soundName = "") { //IL_0084: 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) EffectComponent val = effect.GetComponent<EffectComponent>(); if (!Object.op_Implicit((Object)(object)val)) { val = effect.AddComponent<EffectComponent>(); } if (!Object.op_Implicit((Object)(object)effect.GetComponent<DestroyOnTimer>())) { effect.AddComponent<DestroyOnTimer>().duration = duration; } if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>())) { effect.AddComponent<NetworkIdentity>(); } if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>())) { effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; } val.applyScale = false; val.effectIndex = (EffectIndex)(-1); val.parentToReferencedTransform = true; val.positionAtReferencedTransform = true; val.soundName = soundName; ContentAddition.AddEffect(effect); } public static Material InstantiateMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex) { //IL_0037: 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) Material val = Object.Instantiate<Material>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial); if (Object.op_Implicit((Object)(object)val)) { val.SetColor("_Color", color); val.SetTexture("_MainTex", tex); val.SetColor("_EmColor", emColor); val.SetFloat("_EmPower", emPower); val.SetTexture("_EmTex", emTex); val.SetFloat("_NormalStrength", 1f); val.SetTexture("_NormalTex", normTex); return val; } return val; } public static Material FindMaterial(string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 Material[] array = Resources.FindObjectsOfTypeAll<Material>(); for (int i = 0; i < array.Length; i++) { if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name) { return array[i]; } } return null; } }