Decompiled source of HEL P v1.2.0

Ultron.dll

Decompiled 2 weeks 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.GolemMonster;
using Grumpy;
using JetBrains.Annotations;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using Ultron.Modules;
using Ultron.RobStates;
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 = "")]
[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 = 16f;

		[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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: 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++)
			{
				if (!((Object)(object)((Component)teamMembers[i]).gameObject != (Object)(object)component.owner))
				{
					continue;
				}
				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", "1.2.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 droneHealProjectile;

		public static GameObject droneDamageProjectile;

		public static GameObject helperDrone;

		public static GameObject ultronDrone;

		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)
			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);
		}

		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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: 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_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: 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_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: 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();
			ultOrbProjectile.GetComponent<ProjectileController>().ghostPrefab = 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);
			basicOrbProjectile.GetComponent<ProjectileController>().ghostPrefab = val;
			basicOrbProjectile.GetComponent<ProjectileImpactExplosion>().impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispTrackingBombExplosion.prefab").WaitForCompletion();
			basicOrbProjectile.AddComponent<HealOnDestroy>().fraction = 0.25f;
			ContentAddition.AddProjectile(basicOrbProjectile);
			Material material = CreateMaterial("matUltron", 3f, Color.white, 0f);
			Material material2 = CreateMaterial("matHELP", 2f, 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");
			((Renderer)helperDrone.GetComponentInChildren<MeshRenderer>()).material = material2;
			((Renderer)helperDrone.GetComponentInChildren<ParticleSystemRenderer>()).material = material3;
			ultronDrone = PrefabAPI.InstantiateClone(mainAssetBundle.LoadAsset<GameObject>("UltronDrone"), "RobUltronDrone");
			((Renderer)ultronDrone.GetComponentInChildren<MeshRenderer>()).material = material;
			((Renderer)ultronDrone.GetComponentInChildren<ParticleSystemRenderer>()).material = material4;
			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 val2 = mainAssetBundle.LoadAsset<GameObject>("HealEffect");
			GameObject val3 = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/TPHealNovaEffect");
			Material material5 = ((Renderer)((Component)val3.transform.Find("AreaIndicator")).GetComponent<ParticleSystemRenderer>()).material;
			((Renderer)val2.GetComponentInChildren<ParticleSystemRenderer>()).material = material5;
			Object.Destroy((Object)(object)((Component)droneHealProjectile.transform.GetChild(0)).gameObject);
			GameObject val4 = PrefabAPI.InstantiateClone(val2, "DroneHealEffect", false);
			val4.transform.parent = droneHealProjectile.transform;
			val4.transform.localPosition = Vector3.zero;
			val4.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 val5 = mainAssetBundle.LoadAsset<GameObject>("BurnEffect");
			((Renderer)val5.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 val6 = PrefabAPI.InstantiateClone(val5, "DroneDamageEffect", false);
			val6.transform.parent = droneDamageProjectile.transform;
			val6.transform.localPosition = Vector3.zero;
			val6.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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0503: Unknown result type (might be due to invalid IL or missing references)
			//IL_0515: 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_054c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_0567: Unknown result type (might be due to invalid IL or missing references)
			//IL_059c: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_0642: 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_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: 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_06d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_070c: 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_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_075c: Unknown result type (might be due to invalid IL or missing references)
			//IL_075e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0767: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0811: Unknown result type (might be due to invalid IL or missing references)
			//IL_0837: Unknown result type (might be due to invalid IL or missing references)
			//IL_0839: Unknown result type (might be due to invalid IL or missing references)
			//IL_0842: Unknown result type (might be due to invalid IL or missing references)
			//IL_0868: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0899: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fd: 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_0943: Unknown result type (might be due to invalid IL or missing references)
			//IL_0945: Unknown result type (might be due to invalid IL or missing references)
			//IL_0962: Unknown result type (might be due to invalid IL or missing references)
			//IL_0989: Unknown result type (might be due to invalid IL or missing references)
			//IL_098b: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b69: Expected O, but got Unknown
			//IL_0b86: 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_0ba7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d2b: 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_0dc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dcc: Expected O, but got Unknown
			//IL_0de9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0efe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f57: Expected O, but got Unknown
			//IL_0f74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f96: Unknown result type (might be due to invalid IL or missing references)
			//IL_1019: Unknown result type (might be due to invalid IL or missing references)
			//IL_101e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1066: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bf: Expected O, but got Unknown
			//IL_10dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_10fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_10fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_118e: Unknown result type (might be due to invalid IL or missing references)
			//IL_119e: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1200: Unknown result type (might be due to invalid IL or missing references)
			//IL_120a: 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>.", null, 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>.", null, agile: false);
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainCrosshair.prefab").WaitForCompletion(), "RobUltronCrosshair", false);
			((Component)val.transform.Find("Circle (1)")).GetComponentInChildren<RawImage>().texture = Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Captain/texCaptainCrosshairInner.png").WaitForCompletion();
			((Graphic)((Component)val.transform.Find("Circle (1)")).GetComponentInChildren<RawImage>()).color = new Color(1f, 1f, 1f, 0.5f);
			Transform obj = val.transform.Find("Circle (1)");
			obj.localScale *= 0.32f;
			((Component)val.transform.Find("Circle (1)")).gameObject.AddComponent<CrosshairRotator>();
			((Behaviour)val.GetComponentInChildren<RawImage>()).enabled = false;
			CrosshairController componentInChildren = val.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?''\n\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.\n\n''Compact, agile, and it's already got all the ports on the mobo I need to interface all the new parts.''\n\n''This thing is ancient tech, man. I don't care how much you upgrade it, this is turd polishing.''\n\n''Just you wait til I get done with this baby. Watch and learn.''\n\n''There's no way this is gonna work...''\n\nScrews and wires fly as more modules and components are roughly patched into the drone's systems.\n\n''Voila! Now just to fire 'er up and see how she runs!''\n\nThe drone's lights 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.\n\n''Welcome to the world, HEL-P! You're here to save lives and protect our crew.''\n\nThe drone beeps in acknowledgement.\n\n''Run weapons tests.''\n\nThe drone beeps, and the arm pivots out from its rest position. Nanobots hover around the wrist as a laser charges from the tips of the actuators, blasting a hole in the whiteboard behind the two technicians.\n\n''Woah! You sure that kinda power delivery is safe for this little thing?''\n\n''Just you wait, it gets better. HEL-P, proceed with Nanobot Aid protocols!''\n\nThe drone beeps, and flicks its hand towards the two techs, sending out the nanobots around the arm. The nanobots gently land on their shoulders, emitting small green auras.\n\n''Holy crap, how did you get that module to fit onboard?\n\n''With enough spare parts, a RAM upgrade, and a little know how, you can make these things do plenty. That's not even the best part, though. HEL-P, execute Kona Protocol.''\n\nAnother acknowledgement beep, and a port flips open on the underside of the drone, dispensing a dark liquid.\n\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 = val;
			component.preferredInitialStateType = new SerializableEntityStateType(typeof(SpawnTeleporterState));
			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 val2 = Object.Instantiate<GameObject>(mainAssetBundle.LoadAsset<GameObject>("mdlUltron"));
			val2.transform.parent = parent;
			val2.transform.localPosition = Vector3.zero;
			val2.transform.localRotation = Quaternion.identity;
			val2.transform.localScale = Vector3.one * 0.25f;
			component3.modelTransform = val2.transform;
			Material defaultMaterial = CreateMaterial("matUltron", 3f, Color.white, 0f);
			Material val3 = CreateMaterial("matHELP", 2f, Color.white, 0f);
			Mesh mesh = mainAssetBundle.LoadAsset<Mesh>("meshUltron");
			Mesh val4 = mainAssetBundle.LoadAsset<Mesh>("meshHELP");
			Material val5 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/GreaterWisp/matGreaterWispFire.mat").WaitForCompletion();
			ChildLocator component4 = val2.GetComponent<ChildLocator>();
			((Renderer)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()).material = val3;
			((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>().sharedMesh = val4;
			((Renderer)((Component)component4.FindChild("JetCenter")).GetComponent<ParticleSystemRenderer>()).material = val5;
			((Renderer)((Component)component4.FindChild("JetL")).GetComponent<ParticleSystemRenderer>()).material = val5;
			((Renderer)((Component)component4.FindChild("JetR")).GetComponent<ParticleSystemRenderer>()).material = val5;
			CharacterModel val6 = val2.AddComponent<CharacterModel>();
			val6.body = component;
			val6.autoPopulateLightInfos = false;
			val6.baseLightInfos = (LightInfo[])(object)new LightInfo[0];
			val6.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[4]
			{
				new RendererInfo
				{
					defaultMaterial = val3,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val5,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetCenter")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val5,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetL")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val5,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetR")).GetComponent<ParticleSystemRenderer>()
				}
			};
			SkinDef val7 = Skins.NewSkinDef(val2.gameObject, "Default", mainAssetBundle.LoadAsset<Sprite>("texDefaultSkin"), (RendererInfo[])(object)new RendererInfo[4]
			{
				new RendererInfo
				{
					defaultMaterial = val3,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val5,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetCenter")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val5,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetL")).GetComponent<ParticleSystemRenderer>()
				},
				new RendererInfo
				{
					defaultMaterial = val5,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					hideOnDeath = false,
					ignoreOverlays = false,
					ignoresMaterialOverrides = false,
					renderer = (Renderer)(object)((Component)component4.FindChild("JetR")).GetComponent<ParticleSystemRenderer>()
				}
			});
			val7.skinDefParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
			{
				new MeshReplacement
				{
					mesh = val4,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				}
			};
			val7.skinDefParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[2]
			{
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetL")).gameObject,
					shouldActivate = true
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetR")).gameObject,
					shouldActivate = true
				}
			};
			SkinDef val8 = Skins.NewSkinDef(val2.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>()
				}
			});
			val8.skinDefParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
			{
				new MeshReplacement
				{
					mesh = mesh,
					renderer = (Renderer)(object)((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>()
				}
			};
			val8.skinDefParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[2]
			{
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetL")).gameObject,
					shouldActivate = false
				},
				new GameObjectActivation
				{
					gameObject = ((Component)component4.FindChild("JetR")).gameObject,
					shouldActivate = false
				}
			};
			ModelSkinController val9 = val2.gameObject.AddComponent<ModelSkinController>();
			val9.skins = (SkinDef[])(object)new SkinDef[2] { val7, val8 };
			val9.animator = ((Component)val6).GetComponent<Animator>();
			val9.characterModel = val6;
			val6.mainSkinnedMeshRenderer = ((Component)component4.FindChild("Model")).GetComponent<SkinnedMeshRenderer>();
			HurtBoxGroup val10 = val2.AddComponent<HurtBoxGroup>();
			HurtBox val11 = ((Component)component4.FindChild("MainHurtbox")).gameObject.AddComponent<HurtBox>();
			((Component)val11).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val11.healthComponent = ultronBodyPrefab.GetComponent<HealthComponent>();
			val11.isBullseye = true;
			val11.damageModifier = (DamageModifier)0;
			val11.hurtBoxGroup = val10;
			val11.indexInGroup = 0;
			val10.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val11 };
			val10.mainHurtBox = val11;
			val10.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>.";
			GenericSkill[] components = ultronBodyPrefab.GetComponents<GenericSkill>();
			foreach (GenericSkill val12 in components)
			{
				Object.Destroy((Object)(object)val12);
			}
			GenericSkill val13 = ultronBodyPrefab.AddComponent<GenericSkill>();
			SkillFamily val14 = new SkillFamily();
			val14.catalogIndex = 0;
			val14.defaultVariantIndex = 0u;
			SkillFamily obj2 = val14;
			Variant[] array = new Variant[2];
			Variant val15 = new Variant
			{
				skillDef = skillDef,
				unlockableDef = null
			};
			((Variant)(ref val15)).viewableNode = null;
			array[0] = val15;
			val15 = new Variant
			{
				skillDef = skillDef2,
				unlockableDef = null
			};
			((Variant)(ref val15)).viewableNode = null;
			array[1] = val15;
			obj2.variants = (Variant[])(object)array;
			SkillFamily val16 = (val13._skillFamily = val14);
			val13.skillName = "UltronPrimary";
			val13.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().primary = val13;
			ContentAddition.AddSkillFamily(val16);
			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 = null;
			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 2 CHARGES.</style>";
			skillDefInfo.icon = null;
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Zap));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 2;
			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 val17 = ultronBodyPrefab.AddComponent<GenericSkill>();
			val14 = new SkillFamily();
			val14.catalogIndex = 0;
			val14.defaultVariantIndex = 0u;
			SkillFamily obj3 = val14;
			Variant[] array2 = new Variant[2];
			val15 = new Variant
			{
				skillDef = skillDef3,
				unlockableDef = null
			};
			((Variant)(ref val15)).viewableNode = null;
			array2[0] = val15;
			val15 = new Variant
			{
				skillDef = skillDef4,
				unlockableDef = null
			};
			((Variant)(ref val15)).viewableNode = null;
			array2[1] = val15;
			obj3.variants = (Variant[])(object)array2;
			val16 = val14;
			val17._skillFamily = val16;
			val17.skillName = "Ultrons";
			val17.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().secondary = val17;
			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 = null;
			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 val18 = ultronBodyPrefab.AddComponent<GenericSkill>();
			val14 = new SkillFamily();
			val14.catalogIndex = 0;
			val14.defaultVariantIndex = 0u;
			SkillFamily obj4 = val14;
			Variant[] array3 = new Variant[1];
			val15 = new Variant
			{
				skillDef = skillDef5,
				unlockableDef = null
			};
			((Variant)(ref val15)).viewableNode = null;
			array3[0] = val15;
			obj4.variants = (Variant[])(object)array3;
			val16 = (val18._skillFamily = val14);
			val18.skillName = "UltronUtility";
			val18.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().utility = val18;
			ContentAddition.AddSkillFamily(val16);
			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>5x300%</style>. <style=cIsUtility>HOLD UP TO 3 CHARGES.</style>";
			skillDefInfo.icon = null;
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Barrage));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 3;
			skillDefInfo.baseRechargeInterval = 10f;
			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);
			GenericSkill val19 = ultronBodyPrefab.AddComponent<GenericSkill>();
			val14 = new SkillFamily();
			val14.catalogIndex = 0;
			val14.defaultVariantIndex = 0u;
			SkillFamily obj5 = val14;
			Variant[] array4 = new Variant[1];
			val15 = new Variant
			{
				skillDef = skillDef6,
				unlockableDef = null
			};
			((Variant)(ref val15)).viewableNode = null;
			array4[0] = val15;
			obj5.variants = (Variant[])(object)array4;
			val16 = val14;
			val19._skillFamily = val16;
			val19.skillName = "Ultronu";
			val19.hideInCharacterSelect = false;
			ultronBodyPrefab.GetComponent<SkillLocator>().special = val19;
			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 += 8f;
			}
		}

		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 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.5f;

		private float flyDuration;

		private float stopwatch;

		private float tickStopwatch;

		private SubState subState = SubState.Spawning;

		private void Start()
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)ownerBody))
			{
				ModelSkinController componentInChildren = ((Component)ownerBody).GetComponentInChildren<ModelSkinController>();
				if (Object.op_Implicit((Object)(object)componentInChildren) && componentInChildren.currentSkinIndex > 0)
				{
					droneModelInstance = Object.Instantiate<GameObject>(Plugin.ultronDrone);
				}
				else
				{
					droneModelInstance = Object.Instantiate<GameObject>(Plugin.helperDrone);
				}
				((Component)this).transform.position = ownerBody.corePosition;
			}
		}

		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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			stopwatch += Time.fixedDeltaTime;
			tickStopwatch -= Time.fixedDeltaTime;
			if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)ownerBody))
			{
				SelfDestruct();
			}
			else if (subState == SubState.Spawning)
			{
				Vector3 position = droneModelInstance.transform.position;
				if (Object.op_Implicit((Object)(object)ownerBody))
				{
					position = ownerBody.corePosition + new Vector3(0f, Util.Remap(stopwatch, 0f, spawnDuration, 1f, 4f), 0f);
				}
				droneModelInstance.transform.position = position;
				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);
					}
				}
			}
			else 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;
				}
			}
			else
			{
				Vector3 position2 = target.body.corePosition + new Vector3(0f, 3f, 0f);
				droneModelInstance.transform.position = position2;
				if (tickStopwatch <= 0f)
				{
					tickStopwatch = tickRate;
					Fire();
				}
				if (stopwatch >= 5.1f)
				{
					SelfDestruct();
				}
			}
		}

		public void SelfDestruct()
		{
			if (Object.op_Implicit((Object)(object)droneModelInstance))
			{
				Object.Destroy((Object)(object)droneModelInstance);
			}
			Object.Destroy((Object)(object)this);
		}

		private void Fire()
		{
			if (isHealer)
			{
				FireHeal();
			}
			else
			{
				FireDamage();
			}
		}

		private void FireHeal()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			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++)
			{
				Vector3 val = ((Component)teamMembers[i]).transform.position - ((Component)this).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);
					}
				}
			}
		}

		private void FireDamage()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound("sfx_ultron_reload2", droneModelInstance);
			if (((NetworkBehaviour)ownerBody).hasAuthority)
			{
				new BlastAttack
				{
					attacker = ((Component)ownerBody).gameObject,
					inflictor = ((Component)this).gameObject,
					teamIndex = ownerBody.teamComponent.teamIndex,
					baseDamage = ownerBody.damage * 1f,
					damageType = DamageTypeCombo.GenericSecondary,
					baseForce = 0f,
					position = droneModelInstance.transform.position,
					radius = 16f,
					falloffModel = (FalloffModel)0,
					bonusForce = Vector3.zero,
					crit = ownerBody.RollCrit(),
					procChainMask = default(ProcChainMask),
					procCoefficient = 0.25f,
					losType = (LoSType)0,
					attackerFiltering = (AttackerFiltering)2,
					damageColorIndex = (DamageColorIndex)0
				}.Fire();
			}
			if (NetworkServer.active)
			{
				ProjectileManager.instance.FireProjectile(Plugin.droneDamageProjectile, droneModelInstance.transform.position, Quaternion.identity, ((Component)this).gameObject, 0f, 0f, false, (DamageColorIndex)0, (GameObject)null, 0f, (DamageTypeCombo?)null);
			}
		}
	}
	public class UltronTracker : MonoBehaviour
	{
		public float maxTrackingDistance = 50f;

		public float maxTrackingAngle = 20f;

		public float trackerUpdateFrequency = 10f;

		private HurtBox trackingTarget;

		private TeamComponent teamComponent;

		private InputBankTest inputBank;

		private SkillLocator skillLocator;

		private float trackerUpdateStopwatch;

		private Indicator indicator;

		private readonly BullseyeSearch search = new BullseyeSearch();

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			indicator = new Indicator(((Component)this).gameObject, Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressTrackingIndicator.prefab").WaitForCompletion());
		}

		private void Start()
		{
			inputBank = ((Component)this).GetComponent<InputBankTest>();
			skillLocator = ((Component)this).GetComponent<SkillLocator>();
			teamComponent = ((Component)this).GetComponent<TeamComponent>();
		}

		public HurtBox GetTrackingTarget()
		{
			return trackingTarget;
		}

		private void OnEnable()
		{
			indicator.active = true;
		}

		private void OnDisable()
		{
			indicator.active = false;
		}

		private void OnDestroy()
		{
			indicator.active = false;
		}

		private void FixedUpdate()
		{
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			trackerUpdateStopwatch += Time.fixedDeltaTime;
			if (Object.op_Implicit((Object)(object)skillLocator) && Object.op_Implicit((Object)(object)skillLocator.secondary) && skillLocator.secondary.stock > 0)
			{
				indicator.active = true;
				if (trackerUpdateStopwatch >= 1f / trackerUpdateFrequency)
				{
					trackerUpdateStopwatch -= 1f / trackerUpdateFrequency;
					Ray aimRay = default(Ray);
					((Ray)(ref aimRay))..ctor(inputBank.aimOrigin, inputBank.aimDirection);
					SearchForTarget(aimRay);
					indicator.targetTransform = (Object.op_Implicit((Object)(object)trackingTarget) ? ((Component)trackingTarget).transform : null);
				}
			}
			else
			{
				indicator.active = false;
			}
		}

		private void SearchForTarget(Ray aimRay)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			search.teamMaskFilter = TeamMask.all;
			search.filterByLoS = true;
			search.searchOrigin = ((Ray)(ref aimRay)).origin;
			search.searchDirection = ((Ray)(ref aimRay)).direction;
			search.sortMode = (SortMode)1;
			search.maxDistanceFilter = maxTrackingDistance;
			search.maxAngleFilter = maxTrackingAngle;
			search.RefreshCandidates();
			search.FilterOutGameObject(((Component)this).gameObject);
			trackingTarget = search.GetResults().FirstOrDefault();
		}
	}
	public class UltronTrackingSkillDef : SkillDef
	{
		protected class InstanceData : BaseSkillInstanceData
		{
			public UltronTracker tracker;
		}

		public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot)
		{
			return (BaseSkillInstanceData)(object)new InstanceData
			{
				tracker = ((Component)skillSlot).GetComponent<UltronTracker>()
			};
		}

		private static bool HasTarget([NotNull] GenericSkill skillSlot)
		{
			UltronTracker tracker = ((InstanceData)(object)skillSlot.skillInstanceData).tracker;
			return Object.op_Implicit((Object)(object)(((Object)(object)tracker != (Object)null) ? tracker.GetTrackingTarget() : null));
		}

		public override bool CanExecute([NotNull] GenericSkill skillSlot)
		{
			return HasTarget(skillSlot) && ((SkillDef)this).CanExecute(skillSlot);
		}

		public override bool IsReady([NotNull] GenericSkill skillSlot)
		{
			return ((SkillDef)this).IsReady(skillSlot) && HasTarget(skillSlot);
		}
	}
}
namespace Ultron.RobStates
{
	public class Barrage : BaseSkillState
	{
		public float baseDuration = 1f;

		public float damageCoefficient = 3f;

		private float duration;

		private bool fired1;

		private bool fired2;

		private bool fired3;

		private bool fired4;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			FireOrb();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.Slow50);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= 0.15f * duration && !fired1)
			{
				fired1 = true;
				FireOrb();
			}
			if ((double)((EntityState)this).fixedAge >= 0.3 * (double)duration && !fired2)
			{
				fired2 = true;
				FireOrb();
			}
			if (((EntityState)this).fixedAge >= 0.45f * duration && !fired3)
			{
				fired3 = true;
				FireOrb();
			}
			if ((double)((EntityState)this).fixedAge >= 0.6 * (double)duration && !fired4)
			{
				fired4 = true;
				FireOrb();
			}
			if (((EntityState)this).fixedAge >= 0.5f + duration)
			{
				Util.PlaySound("sfx_ultron_reload", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		private void FireOrb()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound("sfx_ultron_ult_fire", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("Body", "FireBlast", "FireBeam.playbackRate", 2f, 0f);
			((EntityState)this).characterBody.AddSpreadBloom(4f);
			EffectManager.SimpleMuzzleFlash(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/MuzzleflashSmokeRing.prefab").WaitForCompletion(), ((EntityState)this).gameObject, "Muzzle", false);
			if (((EntityState)this).isAuthority)
			{
				float num = 5f / ((BaseState)this).attackSpeedStat;
				((BaseState)this).AddRecoil(-0.4f * num, -0.8f * num, -0.3f * num, 0.3f * num);
				Ray aimRay = ((BaseState)this).GetAimRay();
				ProjectileManager.instance.FireProjectile(Plugin.ultOrbProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 500f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 150f, (DamageTypeCombo?)null);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).fixedAge >= duration)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)2;
		}
	}
	public class Dash : BaseSkillState
	{
		public float baseDuration = 0.15f;

		protected Vector3 slipVector = Vector3.zero;

		public float duration = 0.15f;

		public override void OnEnter()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration;
			Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
			slipVector = ((Vector3)(ref val)).normalized;
			ApplyBuff();
			CreateDashEffect();
			((EntityState)this).PlayAnimation("Body", "Dodge", "Dodge.playbackRate", 0.5f, 0f);
			Util.PlaySound("sfx_ultron_dash", ((EntityState)this).gameObject);
		}

		public virtual void ApplyBuff()
		{
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, duration);
				((EntityState)this).characterBody.AddTimedBuff(Plugin.ultronSpeedBuff, 7f);
			}
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).healthComponent.AddBarrierAuthority(0.25f * ((EntityState)this).healthComponent.fullBarrier);
			}
		}

		public virtual void CreateDashEffect()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			float num = 3f;
			if (((EntityState)this).isAuthority)
			{
				((BaseState)this).AddRecoil(-1f * num, -2f * num, -0.5f * num, 0.5f * num);
			}
			EffectData val = new EffectData();
			val.rotation = Util.QuaternionSafeLookRotation(slipVector);
			val.origin = ((EntityState)this).transform.position;
			EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), val, false);
		}

		public override void FixedUpdate()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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)
			((EntityState)this).FixedUpdate();
			((EntityState)this).rigidbody.velocity = slipVector * ((BaseState)this).moveSpeedStat * 200f * Time.fixedDeltaTime;
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public virtual void DampenVelocity()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Rigidbody rigidbody = ((EntityState)this).rigidbody;
			rigidbody.velocity *= 0.54f;
		}

		public override void OnExit()
		{
			DampenVelocity();
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}
	}
	public class FireBeam : BaseSkillState
	{
		private enum SubState
		{
			Beam,
			Blast
		}

		public float maxDistance = 150f;

		public float baseBeamDuration = 0.5f;

		public float baseBlastDuration = 1f;

		public float beamDamageCoefficient = 3.5f;

		public float blastDamageCoefficient = 5f;

		public float beamProcCoefficient = 0.75f;

		public float blastProcCoefficient = 1f;

		public float blastRadius = 6f;

		public float maxWidth = 1.75f;

		public float minSpreadBloom = 0f;

		public float maxSpreadBloom = 1f;

		private float beamDuration;

		private float blastDuration;

		private SubState subState;

		private float stopwatch;

		private float beamTickStopwatch;

		private bool firedBlast;

		private GameObject beamEffectInstance;

		private GameObject beamEndEffectInstance;

		private LineRenderer beamLine;

		private Ray storedAimRay;

		public override void OnEnter()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			((EntityState)this).characterBody.SetAimTimer(2f);
			beamDuration = baseBeamDuration / ((BaseState)this).attackSpeedStat;
			blastDuration = baseBlastDuration / ((BaseState)this).attackSpeedStat;
			Util.PlayAttackSpeedSound("sfx_ultron_beam", ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
			beamEffectInstance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/LaserMajorConstruct.prefab").WaitForCompletion());
			beamEffectInstance.transform.SetParent(((BaseState)this).FindModelChild("Muzzle"), false);
			beamEffectInstance.transform.localPosition = Vector3.zero;
			Transform obj = beamEffectInstance.transform.Find("LaserStart");
			obj.localScale *= 0.25f;
			((Component)beamEffectInstance.transform.Find("LaserStart/Fire, Electric")).gameObject.SetActive(false);
			Transform obj2 = beamEffectInstance.transform.Find("LaserStart/SoftGlowFlash");
			obj2.localScale *= 0.25f;
			Transform obj3 = beamEffectInstance.transform.Find("LaserStart/Hexagon");
			obj3.localScale *= 0.25f;
			Transform obj4 = beamEffectInstance.transform.Find("LaserStart/Flare (1)");
			obj4.localScale *= 0.25f;
			((Component)beamEffectInstance.transform.Find("LaserEnd/PP")).gameObject.SetActive(false);
			Transform obj5 = beamEffectInstance.transform.Find("LaserEnd/SoftGlowFlash");
			obj5.localScale *= 0.25f;
			Transform obj6 = beamEffectInstance.transform.Find("LaserEnd/Flare");
			obj6.localScale *= 0.5f;
			Transform obj7 = beamEffectInstance.transform.Find("LaserEnd/LightShafts");
			obj7.localScale *= 0.5f;
			Transform obj8 = beamEffectInstance.transform.Find("LaserEnd/SoftGlowFlash");
			obj8.localScale *= 0.25f;
			((Component)beamEffectInstance.transform.Find("LaserEnd/Debris")).gameObject.SetActive(false);
			((Component)beamEffectInstance.transform.Find("LaserEnd/Point light")).GetComponent<Light>().range = 2.5f;
			beamLine = beamEffectInstance.GetComponentInChildren<LineRenderer>();
			beamEndEffectInstance = ((Component)beamEffectInstance.transform.Find("LaserEnd")).gameObject;
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.Slow50);
			}
			((EntityState)this).PlayCrossfade("Body", "FireBeam", "FireBeam.playbackRate", beamDuration, 0.05f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)beamEffectInstance))
			{
				EntityState.Destroy((Object)(object)beamEffectInstance);
			}
			if (Object.op_Implicit((Object)(object)beamEndEffectInstance))
			{
				EntityState.Destroy((Object)(object)beamEndEffectInstance);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50);
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			if (subState == SubState.Beam)
			{
				((EntityState)this).characterBody.SetSpreadBloom(((EntityState)this).age / beamDuration, true);
			}
		}

		public override void FixedUpdate()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: 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_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: 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_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (subState == SubState.Beam)
			{
				beamTickStopwatch -= Time.fixedDeltaTime;
				if (beamTickStopwatch <= 0f)
				{
					FireLazer();
				}
				if (Object.op_Implicit((Object)(object)beamEffectInstance))
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((Ray)(ref storedAimRay)).origin = ((Ray)(ref aimRay)).origin;
					((Ray)(ref storedAimRay)).direction = Vector3.Lerp(((Ray)(ref storedAimRay)).direction, ((Ray)(ref aimRay)).direction, Time.fixedDeltaTime * 60f);
					Vector3 val = ((Ray)(ref storedAimRay)).origin + ((Ray)(ref storedAimRay)).direction * maxDistance;
					RaycastHit val2 = default(RaycastHit);
					if (Physics.Raycast(storedAimRay, ref val2, maxDistance, LayerMask.op_Implicit(CommonMasks.laser)))
					{
						val = ((RaycastHit)(ref val2)).point;
					}
					Vector3 position = Vector3.Lerp(((Component)beamEffectInstance.GetComponent<ChildLocator>().FindChild("LaserEnd")).transform.position, val, Time.fixedDeltaTime * 60f);
					((Component)beamEffectInstance.GetComponent<ChildLocator>().FindChild("LaserEnd")).transform.position = position;
					beamLine.widthMultiplier = Util.Remap(stopwatch, 0f, beamDuration, maxWidth, 0.1f);
				}
				if (stopwatch >= beamDuration)
				{
					stopwatch = 0f;
					subState = SubState.Blast;
					if (Object.op_Implicit((Object)(object)beamEffectInstance))
					{
						EntityState.Destroy((Object)(object)beamEffectInstance);
					}
					if (Object.op_Implicit((Object)(object)beamEndEffectInstance))
					{
						EntityState.Destroy((Object)(object)beamEndEffectInstance);
					}
				}
			}
			else if (subState == SubState.Blast)
			{
				if (!firedBlast)
				{
					firedBlast = true;
					FireBlast();
				}
				if (stopwatch >= blastDuration && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		private void FireBlast()
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: 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_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Expected O, but got Unknown
			Util.PlaySound("sfx_ultron_blast", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("Body", "FireBlast", "FireBeam.playbackRate", blastDuration + 0.1f, 0f);
			if (((EntityState)this).isAuthority)
			{
				float num = 5f / ((BaseState)this).attackSpeedStat;
				((BaseState)this).AddRecoil(-0.4f * num, -0.8f * num, -0.3f * num, 0.3f * num);
				Ray aimRay = ((BaseState)this).GetAimRay();
				((Ray)(ref aimRay)).origin = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction;
				Vector3 val = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * maxDistance;
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(aimRay, ref val2, maxDistance, LayerMask.op_Implicit(CommonMasks.laser)))
				{
					val = ((RaycastHit)(ref val2)).point;
				}
				new BlastAttack
				{
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject,
					teamIndex = ((BaseState)this).GetTeam(),
					baseDamage = ((BaseState)this).damageStat * blastDamageCoefficient,
					damageType = DamageTypeCombo.GenericPrimary,
					baseForce = 250f,
					position = val,
					radius = blastRadius,
					falloffModel = (FalloffModel)2,
					bonusForce = 500f * ((Ray)(ref aimRay)).direction,
					crit = ((BaseState)this).RollCrit(),
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					losType = (LoSType)1,
					attackerFiltering = (AttackerFiltering)2,
					damageColorIndex = (DamageColorIndex)0
				}.Fire();
				if (Object.op_Implicit((Object)(object)FireLaser.tracerEffectPrefab))
				{
					EffectData val3 = new EffectData
					{
						origin = val,
						start = ((Ray)(ref aimRay)).origin
					};
					val3.SetChildLocatorTransformReference(((EntityState)this).gameObject, ((EntityState)this).GetModelChildLocator().FindChildIndex("Muzzle"));
					EffectManager.SpawnEffect(FireLaser.tracerEffectPrefab, val3, true);
					EffectManager.SpawnEffect(FireLaser.hitEffectPrefab, val3, true);
				}
			}
			((EntityState)this).characterBody.AddSpreadBloom(4f);
		}

		private void FireLazer()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type