Decompiled source of HEL P v2.5.0

Ultron.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Captain.Weapon;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Engi.EngiWeapon;
using EntityStates.GolemMonster;
using Grumpy;
using JetBrains.Annotations;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.AsyncManagement;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPathsBetter;
using Ultron.Modules;
using Ultron.RobStates;
using Ultron.RobStates.Beam2;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[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("Ultron")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Ultron")]
[assembly: AssemblyTitle("Ultron")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public string[] keywordTokens = new string[0];

	public Sprite icon;

	public SerializableEntityStateType activationState;

	public InterruptPriority interruptPriority;

	public string activationStateMachineName;

	public float baseRechargeInterval;

	public int baseMaxStock = 1;

	public int rechargeStock = 1;

	public int requiredStock = 1;

	public int stockToConsume = 1;

	public bool isCombatSkill = true;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool cancelSprintingOnActivation = true;

	public bool beginSkillCooldownOnSkillEnd;

	public bool fullRestockOnAssign = true;

	public bool resetCooldownTimerOnUse;

	public bool mustKeyPress;

	public SkillDefInfo()
	{
	}

	public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName, InterruptPriority interruptPriority, bool isCombatSkill, float baseRechargeInterval)
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: 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)
		this.skillName = skillName;
		this.skillNameToken = skillNameToken;
		this.skillDescriptionToken = skillDescriptionToken;
		icon = skillIcon;
		this.activationState = activationState;
		this.activationStateMachineName = activationStateMachineName;
		this.interruptPriority = interruptPriority;
		this.isCombatSkill = isCombatSkill;
		this.baseRechargeInterval = baseRechargeInterval;
	}

	public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false)
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		this.skillName = skillName;
		this.skillNameToken = skillNameToken;
		this.skillDescriptionToken = skillDescriptionToken;
		icon = skillIcon;
		this.activationState = activationState;
		this.activationStateMachineName = activationStateMachineName;
		interruptPriority = (InterruptPriority)0;
		isCombatSkill = true;
		baseRechargeInterval = 0f;
		requiredStock = 0;
		stockToConsume = 0;
		cancelSprintingOnActivation = !agile;
		if (agile)
		{
			keywordTokens = new string[1] { "KEYWORD_AGILE" };
		}
	}
}
namespace Ultron
{
	public class CrosshairRotator : MonoBehaviour
	{
		public float speed = 100f;

		private RectTransform rectTransform;

		private void Awake()
		{
			rectTransform = ((Component)this).GetComponent<RectTransform>();
		}

		private void FixedUpdate()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)rectTransform))
			{
				((Transform)rectTransform).eulerAngles = new Vector3(0f, 0f, ((Transform)rectTransform).eulerAngles.z + Time.fixedDeltaTime * speed);
			}
		}
	}
	public class DroneHeal : MonoBehaviour
	{
		[Tooltip("The area of effect.")]
		public float radius = 32f;

		[Tooltip("Heal amount (based on percentage)")]
		public float healAmount = 0.05f;

		[Tooltip("Heal amount (based on percentage)")]
		public float barrierAmount = 0.05f;

		private void Awake()
		{
			TryHeal();
		}

		private void TryHeal()
		{
			//IL_002d: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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)
			if (!NetworkServer.active)
			{
				return;
			}
			ProjectileController component = ((Component)this).GetComponent<ProjectileController>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(component.teamFilter.teamIndex);
			float num = radius * radius;
			for (int i = 0; i < teamMembers.Count; i++)
			{
				Vector3 val = ((Component)teamMembers[i]).transform.position - ((Component)this).transform.position;
				if (((Vector3)(ref val)).sqrMagnitude <= num)
				{
					HealthComponent component2 = ((Component)teamMembers[i]).GetComponent<HealthComponent>();
					if (Object.op_Implicit((Object)(object)component2))
					{
						component2.HealFraction(healAmount, default(ProcChainMask));
						component2.AddBarrier(component2.fullBarrier * barrierAmount);
					}
				}
			}
		}
	}
	public class HealOnDestroy : MonoBehaviour, IProjectileImpactBehavior
	{
		public float fraction = 0.5f;

		public void OnProjectileImpact(ProjectileImpactInfo impactInfo)
		{
			TryHeal();
		}

		private void TryHeal()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			ProjectileController component = ((Component)this).GetComponent<ProjectileController>();
			ProjectileDamage component2 = ((Component)this).GetComponent<ProjectileDamage>();
			ProjectileImpactExplosion component3 = ((Component)this).GetComponent<ProjectileImpactExplosion>();
			if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2) || !Object.op_Implicit((Object)(object)component3) || !Object.op_Implicit((Object)(object)component.owner))
			{
				return;
			}
			ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(component.teamFilter.teamIndex);
			float num = ((ProjectileExplosion)component3).blastRadius * ((ProjectileExplosion)component3).blastRadius;
			for (int i = 0; i < teamMembers.Count; i++)
			{
				Vector3 val = ((Component)teamMembers[i]).transform.position - ((Component)this).transform.position;
				if (((Vector3)(ref val)).sqrMagnitude <= num)
				{
					HealthComponent component4 = ((Component)teamMembers[i]).GetComponent<HealthComponent>();
					if (Object.op_Implicit((Object)(object)component4))
					{
						component4.Heal(component2.damage * fraction, default(ProcChainMask), true);
					}
				}
			}
		}
	}
	[BepInPlugin("com.rob.Ultron", "Ultron", "2.5.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string MODUID = "com.rob.Ultron";

		public static AssetBundle mainAssetBundle;

		internal static Material commandoMat;

		public static GameObject ultronBodyPrefab;

		public static GameObject ultronDisplayPrefab;

		public static GameObject ultronMasterPrefab;

		public static SurvivorDef ultronSurvivorDef;

		public static GameObject ultOrbProjectile;

		public static GameObject basicOrbProjectile;

		public static GameObject megaOrbProjectile;

		public static GameObject droneHealProjectile;

		public static GameObject droneDamageProjectile;

		public static GameObject helperDrone;

		public static GameObject ultronDrone;

		public static GameObject jellyDrone;

		public static GameObject wispDrone;

		public static GameObject zapChargeEffectPrefab;

		public static BuffDef ultronSpeedBuff;

		private void Awake()
		{
			//IL_0093: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: 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_00cb: 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_00db: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Ultron.ultron"))
			{
				mainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
			using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("Ultron.ultron_bank.bnk"))
			{
				byte[] array = new byte[stream2.Length];
				stream2.Read(array, 0, array.Length);
				SoundBanks.Add(array);
			}
			CreateUltronBody();
			CreateUltronSurvivor();
			CreateProjectile();
			CreateEffects();
			bool flag = default(bool);
			ContentAddition.AddEntityState<Barrage>(ref flag);
			bool flag2 = default(bool);
			ContentAddition.AddEntityState<Dash>(ref flag2);
			bool flag3 = default(bool);
			ContentAddition.AddEntityState<FireBeam>(ref flag3);
			bool flag4 = default(bool);
			ContentAddition.AddEntityState<Zap>(ref flag4);
			bool flag5 = default(bool);
			ContentAddition.AddEntityState<MainState>(ref flag5);
			bool flag6 = default(bool);
			ContentAddition.AddEntityState<FireOrb>(ref flag6);
			bool flag7 = default(bool);
			ContentAddition.AddEntityState<FireDrone>(ref flag7);
			bool flag8 = default(bool);
			ContentAddition.AddEntityState<EnterBarrage>(ref flag8);
			bool flag9 = default(bool);
			ContentAddition.AddEntityState<ChargeBomba>(ref flag9);
			bool flag10 = default(bool);
			ContentAddition.AddEntityState<Bomba>(ref flag10);
			bool flag11 = default(bool);
			ContentAddition.AddEntityState<EnterNanoBeam>(ref flag11);
			bool flag12 = default(bool);
			ContentAddition.AddEntityState<NanoBeam2>(ref flag12);
			bool flag13 = default(bool);
			ContentAddition.AddEntityState<NanoBeam3>(ref flag13);
			bool flag14 = default(bool);
			ContentAddition.AddEntityState<NanoBeam4>(ref flag14);
		}

		private void CreateEffects()
		{
			//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_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			zapChargeEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ClayBruiser/ChargeClayBruiserMinigun.prefab").WaitForCompletion(), "RobUltronZapChargeEffect", false);
			((Component)zapChargeEffectPrefab.transform.Find("FlameTrails, World")).GetComponent<ParticleSystemRenderer>().trailMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matLightningArm.mat").WaitForCompletion();
			((Renderer)((Component)zapChargeEffectPrefab.transform.Find("FlameBillboards, Local")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Loader/matLoaderLightningLarge.mat").WaitForCompletion();
			((Component)zapChargeEffectPrefab.transform.Find("SmokeBillboard")).gameObject.SetActive(false);
			((Component)zapChargeEffectPrefab.transform.Find("Point Light")).gameObject.SetActive(false);
			((Renderer)((Component)zapChargeEffectPrefab.transform.Find("Ring, Dark")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Teleporters/matTPLunarLightning.mat").WaitForCompletion();
			((Component)zapChargeEffectPrefab.transform.Find("FlameTrails, World")).GetComponent<ParticleSystemRenderer>().trailMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matLightningArm.mat").WaitForCompletion();
		}

		private void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				if (component.baseNameToken == "HEL-P" && Object.op_Implicit((Object)(object)self.body.teamComponent) && Object.op_Implicit((Object)(object)component.teamComponent) && self.body.teamComponent.teamIndex == component.teamComponent.teamIndex)
				{
					self.Heal(damageInfo.damage, default(ProcChainMask), true);
					damageInfo.damage = 0f;
					damageInfo.procCoefficient = 0f;
					damageInfo.rejected = true;
					damageInfo.force = Vector3.zero;
				}
			}
			orig.Invoke(self, damageInfo);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength)
		{
			//IL_007a: 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)
			if (!Object.op_Implicit((Object)(object)commandoMat))
			{
				commandoMat = Resources.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial;
			}
			Material val = Object.Instantiate<Material>(commandoMat);
			Material val2 = mainAssetBundle.LoadAsset<Material>(materialName);
			if (!Object.op_Implicit((Object)(object)val2))
			{
				return commandoMat;
			}
			((Object)val).name = materialName;
			val.SetColor("_Color", val2.GetColor("_Color"));
			val.SetTexture("_MainTex", val2.GetTexture("_MainTex"));
			val.SetColor("_EmColor", emissionColor);
			val.SetFloat("_EmPower", emission);
			val.SetTexture("_EmTex", val2.GetTexture("_EmissionMap"));
			if (normalStrength > 0f)
			{
				val.SetTexture("_NormalTex", val2.GetTexture("_BumpMap"));
			}
			val.SetFloat("_NormalStrength", normalStrength);
			return val;
		}

		public static Material CreateMaterial(string materialName)
		{
			return CreateMaterial(materialName, 0f);
		}

		public static Material CreateMaterial(string materialName, float emission)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, Color.black);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, emissionColor, 0f);
		}

		private void CreateProjectile()
		{
			//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_0029: 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_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_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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: 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_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_0524: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_0540: Unknown result type (might be due to invalid IL or missing references)
			//IL_054a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0584: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_064e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0658: Unknown result type (might be due to invalid IL or missing references)
			//IL_0662: Unknown result type (might be due to invalid IL or missing references)
			ultOrbProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(), "RobUltronOrbProjectile", true);
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Lemurian/FireballGhost.prefab").WaitForCompletion(), "RobUltronOrbProjectileGhost", false);
			((Renderer)((Component)val.transform.Find("Flames")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/MajorAndMinorConstruct/matMajorConstructBeam.mat").WaitForCompletion();
			SetGhostPrefab(ultOrbProjectile, val);
			ultOrbProjectile.GetComponent<ProjectileImpactExplosion>().impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/OmniExplosionVFXMinorConstruct.prefab").WaitForCompletion();
			ultOrbProjectile.AddComponent<HealOnDestroy>();
			ContentAddition.AddProjectile(ultOrbProjectile);
			basicOrbProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(), "RobUltronBasicOrbProjectile", true);
			val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarGolem/LunarGolemTwinShotProjectileGhost.prefab").WaitForCompletion(), "RobUltronBasicOrbProjectileGhost", false);
			SetGhostPrefab(basicOrbProjectile, val);
			basicOrbProjectile.GetComponent<ProjectileImpactExplosion>().impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispTrackingBombExplosion.prefab").WaitForCompletion();
			basicOrbProjectile.AddComponent<HealOnDestroy>().fraction = 1f;
			ContentAddition.AddProjectile(basicOrbProjectile);
			megaOrbProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(), "RobUltronMegaOrbProjectile", true);
			val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispTrackingBombGhost.prefab").WaitForCompletion(), "RobUltronMegaOrbProjectileGhost", false);
			SetGhostPrefab(megaOrbProjectile, val);
			megaOrbProjectile.GetComponent<ProjectileImpactExplosion>().impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispTrackingBombExplosion.prefab").WaitForCompletion();
			megaOrbProjectile.AddComponent<HealOnDestroy>().fraction = 1f;
			ContentAddition.AddProjectile(megaOrbProjectile);
			Material material = CreateMaterial("matUltron", 3f, Color.white, 0f);
			Material material2 = CreateMaterial("matHELP", 5f, Color.white, 0f);
			Material material3 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/GreaterWisp/matGreaterWispFire.mat").WaitForCompletion();
			Material material4 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGolemExplosion.mat").WaitForCompletion();
			helperDrone = PrefabAPI.InstantiateClone(mainAssetBundle.LoadAsset<GameObject>("HelperDrone"), "RobUltronHelperDrone", false);
			((Renderer)helperDrone.GetComponentInChildren<MeshRenderer>()).material = material2;
			((Renderer)helperDrone.GetComponentInChildren<ParticleSystemRenderer>()).material = material3;
			ultronDrone = PrefabAPI.InstantiateClone(mainAssetBundle.LoadAsset<GameObject>("UltronDrone"), "RobUltronDrone", false);
			((Renderer)ultronDrone.GetComponentInChildren<MeshRenderer>()).material = material;
			((Renderer)ultronDrone.GetComponentInChildren<ParticleSystemRenderer>()).material = material4;
			Material material5 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Jellyfish/matJellyfish.mat").WaitForCompletion();
			jellyDrone = PrefabAPI.InstantiateClone(mainAssetBundle.LoadAsset<GameObject>("JellyDrone"), "RobJellyDrone", false);
			MeshRenderer[] componentsInChildren = jellyDrone.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val2 in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val2))
				{
					((Renderer)val2).material = material5;
				}
			}
			SkinnedMeshRenderer[] componentsInChildren2 = jellyDrone.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val3 in componentsInChildren2)
			{
				if (Object.op_Implicit((Object)(object)val3))
				{
					((Renderer)val3).material = material5;
				}
			}
			Material material6 = Addressables.LoadAssetAsync<Material>((object)RoR2_Base_GreaterWisp.matGreaterWisp_mat).WaitForCompletion();
			Material material7 = Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Wisp.matWisp1Fire_mat).WaitForCompletion();
			wispDrone = PrefabAPI.InstantiateClone(mainAssetBundle.LoadAsset<GameObject>("WispDrone"), "RobWispDrone", false);
			MeshRenderer[] componentsInChildren3 = wispDrone.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val4 in componentsInChildren3)
			{
				if (Object.op_Implicit((Object)(object)val4))
				{
					((Renderer)val4).material = material6;
				}
			}
			ParticleSystemRenderer[] componentsInChildren4 = wispDrone.GetComponentsInChildren<ParticleSystemRenderer>();
			foreach (ParticleSystemRenderer val5 in componentsInChildren4)
			{
				if (Object.op_Implicit((Object)(object)val5))
				{
					((Renderer)val5).material = material7;
				}
			}
			droneHealProjectile = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/SporeGrenadeProjectileDotZone"), "RobUltronDroneHealProjectile", true);
			droneHealProjectile.transform.localScale = Vector3.one;
			Object.Destroy((Object)(object)droneHealProjectile.GetComponent<ProjectileDotZone>());
			droneHealProjectile.GetComponent<ProjectileController>().flightSoundLoop = null;
			droneHealProjectile.AddComponent<DestroyOnTimer>().duration = 2f;
			GameObject val6 = mainAssetBundle.LoadAsset<GameObject>("HealEffect");
			GameObject val7 = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/TPHealNovaEffect");
			Material material8 = ((Renderer)((Component)val7.transform.Find("AreaIndicator")).GetComponent<ParticleSystemRenderer>()).material;
			((Renderer)val6.GetComponentInChildren<ParticleSystemRenderer>()).material = material8;
			Object.Destroy((Object)(object)((Component)droneHealProjectile.transform.GetChild(0)).gameObject);
			GameObject val8 = PrefabAPI.InstantiateClone(val6, "DroneHealEffect", false);
			val8.transform.parent = droneHealProjectile.transform;
			val8.transform.localPosition = Vector3.zero;
			val8.transform.localScale = Vector3.one * 16f * 2f;
			ContentAddition.AddProjectile(droneHealProjectile);
			droneDamageProjectile = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/SporeGrenadeProjectileDotZone"), "RobUltronDroneDamageProjectile", true);
			droneDamageProjectile.transform.localScale = Vector3.one;
			Object.Destroy((Object)(object)droneDamageProjectile.GetComponent<ProjectileDotZone>());
			droneDamageProjectile.GetComponent<ProjectileController>().flightSoundLoop = null;
			droneDamageProjectile.AddComponent<DestroyOnTimer>().duration = 5f;
			GameObject val9 = mainAssetBundle.LoadAsset<GameObject>("BurnEffect");
			((Renderer)val9.GetComponentInChildren<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matLightningSphere.mat").WaitForCompletion();
			Object.Destroy((Object)(object)((Component)droneDamageProjectile.transform.GetChild(0)).gameObject);
			GameObject val10 = PrefabAPI.InstantiateClone(val9, "DroneDamageEffect", false);
			val10.transform.parent = droneDamageProjectile.transform;
			val10.transform.localPosition = Vector3.zero;
			val10.transform.localScale = Vector3.one * 16f * 2f;
			ContentAddition.AddProjectile(droneDamageProjectile);
		}

		private void CreateUltronBody()
		{
			//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_002e: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: 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_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: 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_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_044f: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_061f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_062a: Unknown result type (might be due to invalid IL or missing references)
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0671: Unknown result type (might be due to invalid IL or missing references)
			//IL_0673: Unknown result type (might be due to invalid IL or missing references)
			//IL_067c: Unknown result type (might be due to invalid IL or missing references)
			//IL_068e: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_0746: Unknown result type (might be due to invalid IL or missing references)
			//IL_0758: Unknown result type (might be due to invalid IL or missing references)
			//IL_078d: Unknown result type (might be due to invalid IL or missing references)
			//IL_078f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Unknown result type (might be due to invalid IL or missing references)
			//IL_07aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_07df: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0831: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_083c: Unknown result type (might be due to invalid IL or missing references)
			//IL_084e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0883: Unknown result type (might be due to invalid IL or missing references)
			//IL_0885: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_090c: Unknown result type (might be due to invalid IL or missing references)
			//IL_090e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0917: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_093f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0948: Unknown result type (might be due to invalid IL or missing references)
			//IL_096e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0970: Unknown result type (might be due to invalid IL or missing references)
			//IL_0979: Unknown result type (might be due to invalid IL or missing references)
			//IL_099f: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a79: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bfe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0de3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ecf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fbb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fc4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff5: Unknown result type (might be due to invalid IL or missing references)
			//IL_101b: Unknown result type (might be due to invalid IL or missing references)
			//IL_101d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1038: Unknown result type (might be due to invalid IL or missing references)
			//IL_1051: Unknown result type (might be due to invalid IL or missing references)
			//IL_1056: Unknown result type (might be due to invalid IL or missing references)
			//IL_106c: Unknown result type (might be due to invalid IL or missing references)
			//IL_106e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1077: Unknown result type (might be due to invalid IL or missing references)
			//IL_1090: Unknown result type (might be due to invalid IL or missing references)
			//IL_1095: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_10dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_1123: Unknown result type (might be due to invalid IL or missing references)
			//IL_1125: Unknown result type (might be due to invalid IL or missing references)
			//IL_112e: Unknown result type (might be due to invalid IL or missing references)
			//IL_113b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1140: Unknown result type (might be due to invalid IL or missing references)
			//IL_1151: Unknown result type (might be due to invalid IL or missing references)
			//IL_1186: Unknown result type (might be due to invalid IL or missing references)
			//IL_1188: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_11cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_120f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1211: Unknown result type (might be due to invalid IL or missing references)
			//IL_121a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1240: Unknown result type (might be due to invalid IL or missing references)
			//IL_1242: Unknown result type (might be due to invalid IL or missing references)
			//IL_124b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1271: Unknown result type (might be due to invalid IL or missing references)
			//IL_1273: Unknown result type (might be due to invalid IL or missing references)
			//IL_127c: Unknown result type (might be due to invalid IL or missing references)
			//IL_12a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_12a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_12d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_12d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_12de: Unknown result type (might be due to invalid IL or missing references)
			//IL_1304: Unknown result type (might be due to invalid IL or missing references)
			//IL_1306: Unknown result type (might be due to invalid IL or missing references)
			//IL_130f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1335: Unknown result type (might be due to invalid IL or missing references)
			//IL_1337: Unknown result type (might be due to invalid IL or missing references)
			//IL_1340: Unknown result type (might be due to invalid IL or missing references)
			//IL_1366: Unknown result type (might be due to invalid IL or missing references)
			//IL_1368: Unknown result type (might be due to invalid IL or missing references)
			//IL_1424: Unknown result type (might be due to invalid IL or missing references)
			//IL_14f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_14f7: Expected O, but got Unknown
			//IL_1514: Unknown result type (might be due to invalid IL or missing references)
			//IL_1533: Unknown result type (might be due to invalid IL or missing references)
			//IL_1535: Unknown result type (might be due to invalid IL or missing references)
			//IL_153e: Unknown result type (might be due to invalid IL or missing references)
			//IL_155d: Unknown result type (might be due to invalid IL or missing references)
			//IL_155f: Unknown result type (might be due to invalid IL or missing references)
			//IL_15f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_15f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_163d: Unknown result type (might be due to invalid IL or missing references)
			//IL_16d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_16d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_171d: Unknown result type (might be due to invalid IL or missing references)
			//IL_176f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1776: Expected O, but got Unknown
			//IL_1793: Unknown result type (might be due to invalid IL or missing references)
			//IL_17b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_17b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_17be: Unknown result type (might be due to invalid IL or missing references)
			//IL_17de: Unknown result type (might be due to invalid IL or missing references)
			//IL_17e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1869: Unknown result type (might be due to invalid IL or missing references)
			//IL_186e: Unknown result type (might be due to invalid IL or missing references)
			//IL_18b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1908: Unknown result type (might be due to invalid IL or missing references)
			//IL_190f: Expected O, but got Unknown
			//IL_192c: Unknown result type (might be due to invalid IL or missing references)
			//IL_194c: Unknown result type (might be due to invalid IL or missing references)
			//IL_194e: Unknown result type (might be due to invalid IL or missing references)
			//IL_19df: Unknown result type (might be due to invalid IL or missing references)
			//IL_19e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1abf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ac4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b65: Expected O, but got Unknown
			//IL_1b82: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ba2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ba4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bad: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bcf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c5f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c74: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cb8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cdb: Expected O, but got Unknown
			ultronBodyPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Drones/Drone2Body.prefab").WaitForCompletion(), "RobUltronBody", true);
			SkillDef skillDef = Skills.CreatePrimarySkillDef(new SerializableEntityStateType(typeof(FireBeam)), "Weapon", "ENCEPHALO-RAY", "UNLEASH A BURNING ENERGY BEAM THAT DEALS <style=cIsDamage>350% DAMAGE</style>, ENDING IN AN <style=cIsUtility>EXPLOSION</style> DEALING <style=cIsDamage>500% DAMAGE</style>.", mainAssetBundle.LoadAsset<Sprite>("texPrimaryIcon"), agile: false);
			SkillDef skillDef2 = Skills.CreatePrimarySkillDef(new SerializableEntityStateType(typeof(FireOrb)), "Weapon", "REPULSOR BLAST", "FIRE NANO PULSE CANNONS THAT <style=cIsHealth>HARM HOSTILE COMBATANTS</style> AND <style=cIsHealing>HEAL FRIENDLY COMBATANTS</style> FOR <style=cIsDamage>220%</style>.", mainAssetBundle.LoadAsset<Sprite>("texAltPrimaryIcon"), agile: false);
			SkillDef val = Skills.CreatePrimarySkillDef(new SerializableEntityStateType(typeof(EnterNanoBeam)), "Weapon", "NANO-BEAM", "ENGI_PRIMARY_ALT_DESCRIPTION", mainAssetBundle.LoadAsset<Sprite>("texNanoBeamIcon"), agile: false);
			GameObject val2 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainCrosshair.prefab").WaitForCompletion(), "RobUltronCrosshair", false);
			((Component)val2.transform.Find("Circle (1)")).GetComponentInChildren<RawImage>().texture = Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Captain/texCaptainCrosshairInner.png").WaitForCompletion();
			((Graphic)((Component)val2.transform.Find("Circle (1)")).GetComponentInChildren<RawImage>()).color = new Color(1f, 1f, 1f, 0.5f);
			Transform obj = val2.transform.Find("Circle (1)");
			obj.localScale *= 0.32f;
			((Component)val2.transform.Find("Circle (1)")).gameObject.AddComponent<CrosshairRotator>();
			((Behaviour)val2.GetComponentInChildren<RawImage>()).enabled = false;
			CrosshairController componentInChildren = val2.GetComponentInChildren<CrosshairController>();
			componentInChildren.minSpreadAlpha = 0.15f;
			componentInChildren.maxSpreadAlpha = 0.75f;
			componentInChildren.maxSpreadAngle = 15f;
			LanguageAPI.Add("ROB_ULTRON_BODY_NAME", "HEL-P");
			LanguageAPI.Add("ROB_ULTRON_BODY_LORE", "''Yeah, but why a dinky little healing drone?''\r\n\r\nA pile of scraps sits scattered on the bench, with the barest hint of organization. Two men in grease-covered overalls, stuffed to the brim with hand tools, preside over it.\r\n\r\n''Compact, agile, and it's already got all the ports on the mobo I need to interface all the new parts.''\r\n\r\n''This thing is ancient tech, man. I don't care how much you upgrade it, this is turd polishing.''\r\n\r\n''Just you wait til I get done with this baby. Watch and learn.''\r\n\r\n''There's no way this is gonna work...''\r\n\r\nScrews and wires fly as more modules and components are roughly patched into the drone's systems. \r\n\r\n''Voila! Now just to fire 'er up and see how she runs!''\r\n\r\nThe drone's headlights flicker and fade, and the tech swiftly knocks it with the heel of his hand. It comes to life and floats into the air above the table.\r\n\r\n''Welcome to the world, HEL-P! You're here to save lives and protect our crew.''\r\n\r\nThe drone beeps in acknowledgement.\r\n\r\n''Run weapons tests.''\r\n\r\nThe drone beeps, and a gooseneck arm snakes out of the drone's rear panel. Three claw-like appendages unfold and shudder as it amasses energy. Suddenly, a laser erupts from the arm, blasting a hole in the whiteboard behind the two technicians.\r\n\r\n''Woah! You sure that kinda power delivery is safe for this little thing?''\r\n\r\n''Just you wait, it gets better. HEL-P, command override IMPERATIVE: PATCH!''\r\n\r\nThe drone beeps, and flicks its arm towards the two techs, sending out two miniscule drones. The drones gently land on each of their shoulders, emitting a small green aura.\r\n\r\n''Holy crap, how did you get that module to fit onboard?\r\n\r\n''With enough spare parts, a RAM upgrade, and a little know-how, you can make these old things do plenty. That's not even the best part, though. HEL-P, execute Kona Protocol!''\r\n\r\nAnother beep of acknowledgement, and a port rotates open on the underside of the drone, dispensing a dark liquid into the tech's now-empty mug.\r\n\r\n''...Is that a coffee maker?''");
			LanguageAPI.Add("ROB_ULTRON_BODY_SUBTITLE", "Mildly Confused Helper");
			CharacterBody component = ultronBodyPrefab.GetComponent<CharacterBody>();
			component.baseNameToken = "ROB_ULTRON_BODY_NAME";
			component.subtitleNameToken = "ROB_ULTRON_BODY_SUBTITLE";
			component.portraitIcon = mainAssetBundle.LoadAsset<Texture>("texHELPIcon");
			component.bodyColor = new Color(0.2784314f, 56f / 85f, 0.3254902f);
			component.baseAcceleration = 50f;
			component.baseMoveSpeed = 14f;
			component.baseMaxHealth = 50f;
			component.levelMaxHealth *= 0.2f;
			component.baseDamage = 11f;
			component.levelDamage = component.baseDamage * 0.2f;
			component.baseRegen = 0.5f;
			component.levelRegen = component.baseRegen * 0.2f;
			component.armor = 0f;
			component.bodyFlags = (BodyFlags)16;
			component._defaultCrosshairPrefab = val2;
			component.preferredInitialStateType = new SerializableEntityStateType(typeof(SpawnTeleporterState));
			component.sprintingSpeedMultiplier = 1f;
			component.sprintCrosshairPrefabOverride = val2;
			CharacterBody component2 = Resources.Load<GameObject>("Prefabs/CharacterBodies/CaptainBody").GetComponent<CharacterBody>();
			component.spreadBloomCurve = component2.spreadBloomCurve;
			component.spreadBloomDecayTime = 0.1f;
			component.spreadBloomInternal = component2.spreadBloomInternal;
			component.preferredPodPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/RoboCratePod.prefab").WaitForCompletion();
			ultronBodyPrefab.GetComponent<EntityStateMachine>().initialStateType = new SerializableEntityStateType(typeof(SpawnTeleporterState));
			ultronBodyPrefab.GetComponent<EntityStateMachine>().mainStateType = new SerializableEntityStateType(typeof(MainState));
			ultronBodyPrefab.AddComponent<EquipmentSlot>();
			ultronBodyPrefab.AddComponent<UltronTracker>();
			ModelLocator component3 = ultronBodyPrefab.GetComponent<ModelLocator>();
			Transform parent = component3.modelTransform.parent;
			Object.DestroyImmediate((Object)(object)((Component)component3.modelTransform).gameObject);
			GameObject val3 = Object.Instantiate<GameObject>(mainAssetBundle.LoadAsset<GameObject>("mdlUltron"));
			val3.transform.parent = parent;
			val3.transform.localPosition = Vector3.zero;
			val3.transform.localRotation = Quaternion.identity;
			val3.transform.localScale = Vector3.one * 0.25f;
			component3.modelTransform = val3.transform;
			Material defaultMaterial = CreateMaterial("matUltron", 3f, Color.white, 0f);
			Material val4 = CreateMaterial("matHELP", 2f, Color.white, 0f);
			Mesh mesh = mainAssetBundle.LoadAsset<Mesh>("meshUltron");
			Mesh val5 = mainAssetBundle.LoadAsset<Mesh>("meshHELP");
			Mesh mesh2 = mainAssetBundle.LoadAsset<Mesh>("meshJellyfish");
			Mesh mesh3 = mainAssetBundle.LoadAsset<Mesh>("meshWisp");
			Material val6 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/GreaterWisp/matGreaterWispFire.mat").WaitForCompletion();
			ChildLocator component4 = val3.GetComponent<ChildLocator>();
			((Renderer)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()).material = val4;
			((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>().sharedMesh = val5;
			((Renderer)((Component)component4.FindChild("JetCenter")).GetComponent<ParticleSystemRenderer>()).material = val6;
			((Renderer)((Component)component4.FindChild("JetL")).GetComponent<ParticleSystemRenderer>()).material = val6;
			((Renderer)((Component)component4.FindChild("JetR")).GetComponent<ParticleSystemRenderer>()).material = val6;
			((Renderer)((Component)component4.FindChild("WispFlame")).GetComponent<ParticleSystemRenderer>()).material = val6;
			((Renderer)((Component)component4.FindChild("WispFlameHand")).GetComponent<ParticleSystemRenderer>()).material = val6;
			((Renderer)((Component)component4.FindChild("WispFlameCannon")).GetComponent<ParticleSystemRenderer>()).material = val6;
			CharacterModel val7 = val3.AddComponent<CharacterModel>();
			val7.body = component;
			val7.autoPopulateLightInfos = false;
			val7.baseLightInfos = (LightInfo[])(object)new LightInfo[0];
			val7.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[4]
			{
				new RendererInfo
				{
					defaultMaterial = val4,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val6,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetCenter")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val6,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetL")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val6,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetR")).GetComponent<ParticleSystemRenderer>()
				}
			};
			SkinDef val8 = Skins.NewSkinDef(val3.gameObject, "Default", mainAssetBundle.LoadAsset<Sprite>("texHelpySkin"), (RendererInfo[])(object)new RendererInfo[4]
			{
				new RendererInfo
				{
					defaultMaterial = val4,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val6,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetCenter")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val6,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetL")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val6,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetR")).GetComponent<ParticleSystemRenderer>()
				}
			});
			val8.skinDefParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
			{
				new MeshReplacement
				{
					mesh = val5,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				}
			};
			val8.skinDefParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[8]
			{
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetL")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetR")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetCenter")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Tentacles")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Pointer")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlame")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameHand")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameCannon")).gameObject,
					shouldActivate = false
				}
			};
			Material defaultMaterial2 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Jellyfish/matJellyfish.mat").WaitForCompletion();
			SkinDef val9 = Skins.NewSkinDef(val3.gameObject, "Jellyfish", mainAssetBundle.LoadAsset<Sprite>("texJellySkin"), (RendererInfo[])(object)new RendererInfo[2]
			{
				new RendererInfo
				{
					defaultMaterial = defaultMaterial2,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = defaultMaterial2,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Tentacles")).GetComponent<ParticleSystemRenderer>()
				}
			});
			val9.skinDefParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
			{
				new MeshReplacement
				{
					mesh = mesh2,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				}
			};
			val9.skinDefParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[8]
			{
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetL")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetR")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetCenter")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Tentacles")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Pointer")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlame")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameHand")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameCannon")).gameObject,
					shouldActivate = false
				}
			};
			val9.skinDefParams.projectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[2]
			{
				new ProjectileGhostReplacement
				{
					projectilePrefab = basicOrbProjectile,
					projectileGhostReplacementPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Vagrant/VagrantCannonGhost.prefab").WaitForCompletion(),
					ghostReplacementAddress = null
				},
				new ProjectileGhostReplacement
				{
					projectilePrefab = ultOrbProjectile,
					projectileGhostReplacementPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Vagrant/VagrantCannonGhost.prefab").WaitForCompletion(),
					ghostReplacementAddress = null
				}
			};
			SkinDef val10 = Skins.NewSkinDef(val3.gameObject, "Wisp", mainAssetBundle.LoadAsset<Sprite>("texWispSkin"), (RendererInfo[])(object)new RendererInfo[1]
			{
				new RendererInfo
				{
					defaultMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/GreaterWisp/matGreaterWisp.mat").WaitForCompletion(),
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				}
			});
			val10.skinDefParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
			{
				new MeshReplacement
				{
					mesh = mesh3,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				}
			};
			val10.skinDefParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[8]
			{
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetL")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetR")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetCenter")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Tentacles")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Pointer")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlame")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameHand")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameCannon")).gameObject,
					shouldActivate = true
				}
			};
			val10.skinDefParams.projectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[2]
			{
				new ProjectileGhostReplacement
				{
					projectilePrefab = basicOrbProjectile,
					projectileGhostReplacementPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_GreaterWisp.WispCannonGhost_prefab).WaitForCompletion(),
					ghostReplacementAddress = null
				},
				new ProjectileGhostReplacement
				{
					projectilePrefab = ultOrbProjectile,
					projectileGhostReplacementPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_GreaterWisp.WispCannonGhost_prefab).WaitForCompletion(),
					ghostReplacementAddress = null
				}
			};
			SkinDef val11 = Skins.NewSkinDef(val3.gameObject, "Ultron", mainAssetBundle.LoadAsset<Sprite>("texUltronSkin"), (RendererInfo[])(object)new RendererInfo[2]
			{
				new RendererInfo
				{
					defaultMaterial = defaultMaterial,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGolemExplosion.mat").WaitForCompletion(),
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetCenter")).GetComponent<ParticleSystemRenderer>()
				}
			});
			val11.skinDefParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
			{
				new MeshReplacement
				{
					mesh = mesh,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				}
			};
			val11.skinDefParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[8]
			{
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetL")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetR")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetCenter")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Tentacles")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("Pointer")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlame")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameHand")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("WispFlameCannon")).gameObject,
					shouldActivate = false
				}
			};
			ModelSkinController val12 = val3.gameObject.AddComponent<ModelSkinController>();
			val12.skins = (SkinDef[])(object)new SkinDef[4] { val8, val9, val10, val11 };
			val12.animator = ((Component)val7).GetComponent<Animator>();
			val12.characterModel = val7;
			val7.mainSkinnedMeshRenderer = ((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>();
			HurtBoxGroup val13 = val3.AddComponent<HurtBoxGroup>();
			HurtBox val14 = ((Component)component4.FindChild("MainHurtbox")).gameObject.AddComponent<HurtBox>();
			((Component)val14).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val14.healthComponent = ultronBodyPrefab.GetComponent<HealthComponent>();
			val14.isBullseye = true;
			val14.damageModifier = (DamageModifier)0;
			val14.hurtBoxGroup = val13;
			val14.indexInGroup = 0;
			val13.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val14 };
			val13.mainHurtBox = val14;
			val13.bullseyeCount = 1;
			SkillLocator component5 = ultronBodyPrefab.GetComponent<SkillLocator>();
			component5.passiveSkill.enabled = true;
			component5.passiveSkill.skillNameToken = "DYNAMIC FLIGHT";
			component5.passiveSkill.skillDescriptionToken = "HEL-P IS ABLE TO <style=cIsUtility>FLY FREELY</style>, BUT IS <style=cIsHealth>EXTREMELY FRAGILE</style>.";
			component5.passiveSkill.icon = mainAssetBundle.LoadAsset<Sprite>("texPassiveIcon");
			GenericSkill[] components = ultronBodyPrefab.GetComponents<GenericSkill>();
			foreach (GenericSkill val15 in components)
			{
				Object.Destroy((Object)(object)val15);
			}
			GenericSkill val16 = ultronBodyPrefab.AddComponent<GenericSkill>();
			SkillFamily val17 = new SkillFamily();
			val17.catalogIndex = 0;
			val17.defaultVariantIndex = 0u;
			SkillFamily obj2 = val17;
			Variant[] array = new Variant[2];
			Variant val18 = new Variant
			{
				skillDef = skillDef,
				unlockableDef = null
			};
			((Variant)(ref val18)).viewableNode = null;
			array[0] = val18;
			val18 = new Variant
			{
				skillDef = skillDef2,
				unlockableDef = null
			};
			((Variant)(ref val18)).viewableNode = null;
			array[1] = val18;
			obj2.variants = (Variant[])(object)array;
			SkillFamily val19 = (val16._skillFamily = val17);
			val16.skillName = "UltronPrimary";
			val16.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().primary = val16;
			ContentAddition.AddSkillFamily(val19);
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "UltronDrone";
			skillDefInfo.skillNameToken = "IMPERATIVE: PATCH";
			skillDefInfo.skillDescriptionToken = "TARGET AN <style=cIsUtility>ENTITY</style> TO DEPLOY A <style=cIsUtility>DRONE</style> TO THEM. ENEMIES SUFFER A CHAINING <style=cIsDamage>ELECTRIC SHOCK FOR <style=cIsDamage>100% DAMAGE</style>, WHILE ALLIES <style=cIsHealing>HEAL 25% MAX HEALTH</style>.";
			skillDefInfo.icon = mainAssetBundle.LoadAsset<Sprite>("texSecondaryIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(FireDrone));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 10f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.cancelSprintingOnActivation = true;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			SkillDef skillDef3 = (SkillDef)(object)Skills.CreateTrackingSkillDef(skillDefInfo);
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "UltronZap";
			skillDefInfo.skillNameToken = "IMPERATIVE: NEUTRALIZE";
			skillDefInfo.skillDescriptionToken = "ZAP A HOSTILE COMBATANT TO <style=cIsUtility>SHOCK</style> THEM FOR <style=cIsDamage>30%</style> DAMAGE. <style=cIsUtility>HOLD UP TO 3 CHARGES.</style>";
			skillDefInfo.icon = mainAssetBundle.LoadAsset<Sprite>("texTazerIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Zap));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 3;
			skillDefInfo.baseRechargeInterval = 5f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			SkillDef skillDef4 = Skills.CreateSkillDef(skillDefInfo);
			GenericSkill val20 = ultronBodyPrefab.AddComponent<GenericSkill>();
			val17 = new SkillFamily();
			val17.catalogIndex = 0;
			val17.defaultVariantIndex = 0u;
			SkillFamily obj3 = val17;
			Variant[] array2 = new Variant[2];
			val18 = new Variant
			{
				skillDef = skillDef3,
				unlockableDef = null
			};
			((Variant)(ref val18)).viewableNode = null;
			array2[0] = val18;
			val18 = new Variant
			{
				skillDef = skillDef4,
				unlockableDef = null
			};
			((Variant)(ref val18)).viewableNode = null;
			array2[1] = val18;
			obj3.variants = (Variant[])(object)array2;
			val19 = val17;
			val20._skillFamily = val19;
			val20.skillName = "Ultrons";
			val20.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().secondary = val20;
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "UltronDash";
			skillDefInfo.skillNameToken = "IMPERATIVE: FLEE";
			skillDefInfo.skillDescriptionToken = "DASH, GAINING <style=cIsHealing>25% BARRIER</style>, AND THEN ENTER AN <style=cIsUtility>ACCELERATED</style> STATE FOR THE NEXT <style=cIsDamage>7 SECONDS</style>.";
			skillDefInfo.icon = mainAssetBundle.LoadAsset<Sprite>("texUtilityIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Dash));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 12f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)2;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = false;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			SkillDef skillDef5 = Skills.CreateSkillDef(skillDefInfo);
			GenericSkill val21 = ultronBodyPrefab.AddComponent<GenericSkill>();
			val17 = new SkillFamily();
			val17.catalogIndex = 0;
			val17.defaultVariantIndex = 0u;
			SkillFamily obj4 = val17;
			Variant[] array3 = new Variant[1];
			val18 = new Variant
			{
				skillDef = skillDef5,
				unlockableDef = null
			};
			((Variant)(ref val18)).viewableNode = null;
			array3[0] = val18;
			obj4.variants = (Variant[])(object)array3;
			val19 = (val21._skillFamily = val17);
			val21.skillName = "UltronUtility";
			val21.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().utility = val21;
			ContentAddition.AddSkillFamily(val19);
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "UltronBarrage";
			skillDefInfo.skillNameToken = "IMPERATIVE: EXTERMINATE";
			skillDefInfo.skillDescriptionToken = "FIRE A BARRAGE OF ENERGY THAT <style=cIsHealth>HARMS HOSTILE COMBATANTS</style> AND <style=cIsHealing>HEALS FRIENDLY COMBATANTS</style> FOR <style=cIsDamage>5x600%</style>. <style=cIsUtility>HOLD UP TO 3 CHARGES.</style>";
			skillDefInfo.icon = mainAssetBundle.LoadAsset<Sprite>("texSpecialIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(EnterBarrage));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 3;
			skillDefInfo.baseRechargeInterval = 12f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = false;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			SkillDef skillDef6 = Skills.CreateSkillDef(skillDefInfo);
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "UltronBomba";
			skillDefInfo.skillNameToken = "INVINCIBLE PULSE CANNON";
			skillDefInfo.skillDescriptionToken = "FIRE A DEVASTATING PULSE CANNON THAT <style=cIsHealth>HARMS HOSTILE COMBATANTS</style> AND <style=cIsHealing>HEALS FRIENDLY COMBATANTS</style> FOR <style=cIsDamage>4000%</style>.";
			skillDefInfo.icon = mainAssetBundle.LoadAsset<Sprite>("texAltSpecialIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(ChargeBomba));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 30f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = false;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			SkillDef skillDef7 = Skills.CreateSkillDef(skillDefInfo);
			GenericSkill val22 = ultronBodyPrefab.AddComponent<GenericSkill>();
			val17 = new SkillFamily();
			val17.catalogIndex = 0;
			val17.defaultVariantIndex = 0u;
			SkillFamily obj5 = val17;
			Variant[] array4 = new Variant[2];
			val18 = new Variant
			{
				skillDef = skillDef6,
				unlockableDef = null
			};
			((Variant)(ref val18)).viewableNode = null;
			array4[0] = val18;
			val18 = new Variant
			{
				skillDef = skillDef7,
				unlockableDef = null
			};
			((Variant)(ref val18)).viewableNode = null;
			array4[1] = val18;
			obj5.variants = (Variant[])(object)array4;
			val19 = val17;
			val22._skillFamily = val19;
			val22.skillName = "Ultronu";
			val22.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().special = val22;
			ContentAddition.AddBody(ultronBodyPrefab);
			ultronDisplayPrefab = PrefabAPI.InstantiateClone(((Component)ultronBodyPrefab.transform.GetChild(0)).gameObject, "RobUltronDisplay", true);
			((Component)ultronDisplayPrefab.transform.GetChild(0)).transform.localPosition = new Vector3(0f, 1.75f, 0f);
			ultronMasterPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Drones/Drone2Master.prefab").WaitForCompletion(), "RobUltronMonsterMaster", true);
			CharacterMaster component6 = ultronMasterPrefab.GetComponent<CharacterMaster>();
			component6.bodyPrefab = ultronBodyPrefab;
			ContentAddition.AddMaster(ultronMasterPrefab);
			ultronSpeedBuff = AddNewBuff("bdUltronSpeed", null, component.bodyColor, canStack: false, isDebuff: false);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(ultronSpeedBuff))
			{
				self.moveSpeed += 5f;
			}
		}

		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isHidden = false)
		{
			//IL_0010: 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)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = buffName;
			val.buffColor = buffColor;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.eliteDef = null;
			val.iconSprite = buffIcon;
			val.isHidden = isHidden;
			ContentAddition.AddBuffDef(val);
			return val;
		}

		private void CreateUltronSurvivor()
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			ultronSurvivorDef = ScriptableObject.CreateInstance<SurvivorDef>();
			ultronSurvivorDef.bodyPrefab = ultronBodyPrefab;
			ultronSurvivorDef.displayPrefab = ultronDisplayPrefab;
			ultronSurvivorDef.displayNameToken = "HEL-P";
			ultronSurvivorDef.descriptionToken = "";
			ultronSurvivorDef.outroFlavorToken = "..and so he left.";
			ultronSurvivorDef.mainEndingEscapeFailureFlavorToken = "..and so he vanished.";
			ultronSurvivorDef.desiredSortPosition = 20f;
			ultronSurvivorDef.unlockableDef = null;
			ultronSurvivorDef.cachedName = "Ultron";
			ultronSurvivorDef.primaryColor = new Color(0.2784314f, 56f / 85f, 0.3254902f);
			ultronSurvivorDef.hidden = false;
			ContentAddition.AddSurvivorDef(ultronSurvivorDef);
		}

		private static RendererInfo[] SkinRendererInfos(RendererInfo[] defaultRenderers, Material[] materials)
		{
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length];
			defaultRenderers.CopyTo(array, 0);
			for (int i = 0; i < materials.Length; i++)
			{
				if (Object.op_Implicit((Object)(object)materials[i]))
				{
					array[i].defaultMaterial = materials[i];
				}
			}
			return array;
		}

		public static void SetGhostPrefab(GameObject p, GameObject ghost)
		{
			ProjectileController component = p.GetComponent<ProjectileController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				SetGhostPrefab(component, ghost);
			}
		}

		public static void SetGhostPrefab(ProjectileController pc, GameObject ghost)
		{
			if (Object.op_Implicit((Object)(object)pc))
			{
				pc.ghostPrefab = ghost;
				pc.ghostPrefabAddress = null;
				pc.ghostAssetOrDirectReference = new AssetOrDirectReference<GameObject>
				{
					address = null,
					_address = null,
					directRef = ghost,
					_directRef = ghost,
					loadOnAssigned = true
				};
			}
		}
	}
	public class UltronDroneController : MonoBehaviour
	{
		private enum SubState
		{
			Spawning,
			Flying,
			Active
		}

		[Tooltip("The area of effect.")]
		public float radius = 16f;

		[Tooltip("Heal amount (based on percentage)")]
		public float healAmount = 0.05f;

		[Tooltip("Heal amount (based on percentage)")]
		public float barrierAmount = 0.05f;

		public CharacterBody ownerBody;

		public GameObject droneModelInstance;

		public HealthComponent target;

		public float tickRate = 1f;

		public bool isHealer = false;

		public float spawnDuration = 0.65f;

		private float flyDuration;

		private float stopwatch;

		private float tickStopwatch;

		private SubState subState = SubState.Spawning;

		private float baseSize;

		private bool isJelly = false;

		private bool isWisp = false;

		private void Start()
		{
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)ownerBody))
			{
				return;
			}
			ModelSkinController componentInChildren = ((Component)ownerBody).GetComponentInChildren<ModelSkinController>();
			if (Object.op_Implicit((Object)(object)componentInChildren) && componentInChildren.skins != null && componentInChildren.skins.Length != 0 && componentInChildren.currentSkinIndex < componentInChildren.skins.Length)
			{
				SkinDef val = componentInChildren.skins[componentInChildren.currentSkinIndex];
				if (Object.op_Implicit((Object)(object)val))
				{
					if (val.nameToken == "Ultron")
					{
						droneModelInstance = Object.Instantiate<GameObject>(Plugin.ultronDrone);
					}
					else if (val.nameToken == "Jellyfish")
					{
						droneModelInstance = Object.Instantiate<GameObject>(Plugin.jellyDrone);
						isJelly = true;
						Util.PlaySound("Play_jellyfish_spawn", ((Component)this).gameObject);
					}
					else if (val.nameToken == "Wisp")
					{
						droneModelInstance = Object.Instantiate<GameObject>(Plugin.wispDrone);
						isWisp = true;
						Util.PlaySound("Play_wisp_spawn", ((Component)this).gameObject);
					}
					else
					{
						droneModelInstance = Object.Instantiate<GameObject>(Plugin.helperDrone);
					}
				}
			}
			droneModelInstance.transform.position = ownerBody.corePosition;
			baseSize = droneModelInstance.transform.localScale.x;
			droneModelInstance.transform.localScale = Vector3.one * 0.01f;
			Vector3 position = ownerBody.corePosition + new Vector3(0f, 4f, 0f);
			droneModelInstance.transform.position = position;
		}

		private void OnDestroy()
		{
			if (Object.op_Implicit((Object)(object)droneModelInstance))
			{
				Object.Destroy((Object)(object)droneModelInstance);
			}
		}

		private void OnDisable()
		{
			if (Object.op_Implicit((Object)(object)droneModelInstance))
			{
				Object.Destroy((Object)(object)droneModelInstance);
			}
		}

		private void FixedUpdate()
		{
			//IL_0070: 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_01e4: 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_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
			stopwatch += Time.fixedDeltaTime;
			tickStopwatch -= Time.fixedDeltaTime;
			if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)ownerBody))
			{
				SelfDestruct();
				return;
			}
			if (subState == SubState.Spawning)
			{
				droneModelInstance.transform.localScale = Vector3.one * Util.Remap(stopwatch, 0f, spawnDuration, 0.01f, baseSize);
				if (stopwatch >= spawnDuration)
				{
					subState = SubState.Flying;
					stopwatch = 0f;
					if (Object.op_Implicit((Object)(object)target))
					{
						flyDuration = Mathf.Clamp(Util.Remap(Vector3.Distance(droneModelInstance.transform.position, target.body.corePosition), 10f, 60f, 0.5f, 1.5f), 0.5f, 1.5f);
					}
				}
				return;
			}
			if (subState == SubState.Flying)
			{
				Vector3 val = target.body.corePosition + new Vector3(0f, 3f, 0f);
				droneModelInstance.transform.position = Vector3.Lerp(droneModelInstance.transform.position, val, stopwatch / flyDuration);
				if (stopwatch >= flyDuration)
				{
					subState = SubState.Active;
					stopwatch = 0f;
				}
				return;
			}
			Vector3 position = target.body.corePosition + new Vector3(0f, 3f, 0f);
			droneModelInstance.transform.position = position;
			if (tickStopwatch <= 0f)
			{
				tickStopwatch = tickRate;
				Fire();
			}
			if (stopwatch >= 4.9f)
			{
				SelfDestruct();
			}
		}

		public void SelfDestruct()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			Fire(isFinal: true);
			GameObject val = new GameObject();
			val.transform.position = droneModelInstance.transform.position;
			Object.Destroy((Object)(object)val, 5f);
			GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/OmniExplosionVFXCommandoGrenade.prefab").WaitForCompletion();
			if (isHealer)
			{
				val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/OmniExplosionVFXEngiTurretDeath.prefab").WaitForCompletion();
			}
			if (isJelly)
			{
				val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Jellyfish/JellyfishNova.prefab").WaitForCompletion();
				Util.PlaySound("Play_jellyfish_death", val);
				Util.PlaySound("Play_jellyfish_detonate", val);
			}
			else if (isWisp)
			{
				val2 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Wisp.WispDeath_prefab).WaitForCompletion();
				Util.PlaySound("Play_wisp_death", val);
				Util.PlaySound("Play_lemurianBruiser_m1_explode", val);
			}
			else
			{
				Util.PlaySound("Play_lemurianBruiser_m1_explode", val);
				Util.PlaySound("Play_lemurianBruiser_m1_explode", val);
				Util.PlaySound("Play_lemurianBruiser_m1_explode", val);
				Util.PlaySound("Play_lemurianBruiser_m1_explode", val);
				Util.PlaySound("Play_lemurianBruiser_m1_explode", val);
			}
			EffectManager.SpawnEffect(val2, new EffectData
			{
				origin = droneModelInstance.transform.position,
				scale = 5f
			}, true);
			if (Object.op_Implicit((Object)(object)droneModelInstance))
			{
				Object.Destroy((Object)(object)droneModelInstance);
			}
			Object.Destroy((Object)(object)this);
		}

		private void Fire(bool isFinal = false)
		{
			if (isHealer)
			{
				FireHeal(isFinal);
			}
			else
			{
				FireDamage(isFinal);
			}
		}

		private void FireHeal(bool isFinal = false)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val;
			if (!isFinal)
			{
				Util.PlaySound("sfx_ultron_reload", droneModelInstance);
				if (!NetworkServer.active)
				{
					return;
				}
				ProjectileManager.instance.FireProjectile(Plugin.droneHealProjectile, droneModelInstance.transform.position, Quaternion.identity, ((Component)this).gameObject, 0f, 0f, false, (DamageColorIndex)1, (GameObject)null, 0f, (DamageTypeCombo?)null);
				ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(ownerBody.teamComponent.teamIndex);
				float num = radius * radius;
				for (int i = 0; i < teamMembers.Count; i++)
				{
					val = ((Component)teamMembers[i]).transform.position - droneModelInstance.transform.position;
					if (((Vector3)(ref val)).sqrMagnitude <= num)
					{
						HealthComponent component = ((Component)teamMembers[i]).GetComponent<HealthComponent>();
						if (Object.op_Implicit((Object)(object)component))
						{
							component.HealFraction(healAmount, default(ProcChainMask));
							component.AddBarrier(component.fullBarrier * barrierAmount);
						}
					}
				}
			}
			else
			{
				if (!NetworkServer.active)
				{
					return;
				}
				ReadOnlyCollection<TeamComponent> teamMembers2 = TeamComponent.GetTeamMembers(ownerBody.teamComponent.teamIndex);
				float num2 = radius * radius;
				num2 *= 0.5f;
				for (int j = 0; j < teamMembers2.Count; j++)
				{
					val = ((Component)teamMembers2[j]).transform.position - droneModelInstance.transform.position;
					if (((Vector3)(ref val)).sqrMagnitude <= num2)
					{
						HealthComponent component2 = ((Component)teamMembers2[j]).GetComponent<HealthComponent>();
						if (Object.op_Implicit((Object)(object)component2))
						{
							component2.HealFraction(healAmount * 3f, default(ProcChainMask));
							component2.AddBarrier(component2.fullBarrier * barrierAmount * 3f);
						}
					}
				}
			}
		}

		private void FireDamage(bool isFinal = false)
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//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_00a2: Unknown result