Decompiled source of GroovyEquipment v1.1.0

plugins/GroovyEquipment/GroovyEquipment.dll

Decompiled 20 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using GroovyEquipment.Equipment;
using HG.Reflection;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2BepInExPack.GameAssetPathsBetter;
using TMPro;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
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: OptIn]
[assembly: NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("GroovyEquipment")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c988079955e49d627ea90ee7f89be9a0c0585f20")]
[assembly: AssemblyProduct("GroovyEquipment")]
[assembly: AssemblyTitle("GroovyEquipment")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace GroovyEquipment
{
	internal static class Assets
	{
		internal static AssetBundle Bundle;

		private static Shader _hgStandard;

		internal static void Load()
		{
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("GroovyEquipment.groovyequipment_assets"))
			{
				using MemoryStream memoryStream = new MemoryStream();
				stream.CopyTo(memoryStream);
				Bundle = AssetBundle.LoadFromMemory(memoryStream.ToArray());
			}
			_hgStandard = Load<Shader>(RoR2_Base_Shaders.HGStandard_shader);
		}

		internal static T LoadBundleAsset<T>(string path) where T : Object
		{
			T val = Bundle.LoadAsset<T>(path);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Log.Error("Missing asset " + path + " in the GroovyEquipment asset bundle.", "D:\\Games\\LostItems\\rampagerevived\\GroovyEquipmentRevived\\GroovyEquipment\\Assets.cs", "LoadBundleAsset", 34);
			}
			return val;
		}

		internal static GameObject LoadModel(string path, bool keepBundledShaders = false)
		{
			GameObject val = Assets.LoadBundleAsset<GameObject>(path);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)_hgStandard))
			{
				Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true);
				foreach (Renderer val2 in componentsInChildren)
				{
					Material[] sharedMaterials = val2.sharedMaterials;
					foreach (Material val3 in sharedMaterials)
					{
						if (Object.op_Implicit((Object)(object)val3) && (!keepBundledShaders || !Object.op_Implicit((Object)(object)val3.shader) || !val3.shader.isSupported))
						{
							val3.shader = _hgStandard;
						}
					}
				}
			}
			return val;
		}

		internal static GameObject PrepareDisplayModel(GameObject model)
		{
			ItemDisplay val = model.GetComponent<ItemDisplay>() ?? model.AddComponent<ItemDisplay>();
			val.rendererInfos = ((IEnumerable<Renderer>)model.GetComponentsInChildren<Renderer>(true)).Select((Func<Renderer, RendererInfo>)((Renderer renderer) => new RendererInfo
			{
				renderer = renderer,
				defaultMaterial = renderer.sharedMaterial
			})).ToArray();
			return model;
		}

		internal static T Load<T>(string assetGuid)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return Addressables.LoadAssetAsync<T>((object)assetGuid).WaitForCompletion();
		}

		internal static Material Tint(Material material, Color color)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)material))
			{
				return null;
			}
			Material val = new Material(material);
			val.SetColor("_TintColor", color);
			return val;
		}

		internal static Transform FindChild(GameObject root, string path)
		{
			Transform val = root.transform.Find(path);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Log.Warning("Could not find " + path + " in " + ((Object)root).name + ", it was probably changed by a game update.", "D:\\Games\\LostItems\\rampagerevived\\GroovyEquipmentRevived\\GroovyEquipment\\Assets.cs", "FindChild", 88);
			}
			return val;
		}

		internal static Renderer GetRenderer(GameObject root, int index)
		{
			Renderer[] array = (from renderer in root.GetComponentsInChildren<Renderer>(true)
				where IsActiveUpTo(((Component)renderer).transform, root.transform)
				select renderer).ToArray();
			if (index >= array.Length)
			{
				Log.Warning($"{((Object)root).name} only has {array.Length} renderers, could not get renderer {index}.", "D:\\Games\\LostItems\\rampagerevived\\GroovyEquipmentRevived\\GroovyEquipment\\Assets.cs", "GetRenderer", 101);
				return null;
			}
			return array[index];
		}

		private static bool IsActiveUpTo(Transform transform, Transform root)
		{
			while (Object.op_Implicit((Object)(object)transform) && (Object)(object)transform != (Object)(object)root)
			{
				if (!((Component)transform).gameObject.activeSelf)
				{
					return false;
				}
				transform = transform.parent;
			}
			return true;
		}
	}
	internal abstract class GroovyEquipmentBase
	{
		internal EquipmentDef EquipmentDef;

		internal abstract string Name { get; }

		protected abstract string LangToken { get; }

		protected abstract string PickupText { get; }

		protected abstract string DescriptionText { get; }

		protected abstract string LoreText { get; }

		protected abstract GameObject PickupModel { get; }

		protected abstract Sprite Icon { get; }

		protected virtual float Cooldown => 60f;

		protected virtual bool IsLunar => false;

		protected virtual bool IsBoss => false;

		protected virtual bool EnigmaCompatible => true;

		protected virtual bool CanBeRandomlyTriggered => true;

		internal void Init()
		{
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Expected O, but got Unknown
			LanguageAPI.Add("EQUIPMENT_" + LangToken + "_NAME", Name);
			LanguageAPI.Add("EQUIPMENT_" + LangToken + "_PICKUP", PickupText);
			LanguageAPI.Add("EQUIPMENT_" + LangToken + "_DESCRIPTION", DescriptionText);
			LanguageAPI.Add("EQUIPMENT_" + LangToken + "_LORE", LoreText);
			EquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)EquipmentDef).name = "EQUIPMENT_" + LangToken;
			EquipmentDef.nameToken = "EQUIPMENT_" + LangToken + "_NAME";
			EquipmentDef.pickupToken = "EQUIPMENT_" + LangToken + "_PICKUP";
			EquipmentDef.descriptionToken = "EQUIPMENT_" + LangToken + "_DESCRIPTION";
			EquipmentDef.loreToken = "EQUIPMENT_" + LangToken + "_LORE";
			EquipmentDef.pickupModelPrefab = PickupModel;
			EquipmentDef.pickupIconSprite = Icon;
			EquipmentDef.appearsInSinglePlayer = true;
			EquipmentDef.appearsInMultiPlayer = true;
			EquipmentDef.canDrop = true;
			EquipmentDef.cooldown = Cooldown;
			EquipmentDef.enigmaCompatible = EnigmaCompatible;
			EquipmentDef.canBeRandomlyTriggered = CanBeRandomlyTriggered;
			EquipmentDef.isLunar = IsLunar;
			EquipmentDef.isBoss = IsBoss;
			EquipmentDef.colorIndex = (ColorIndex)(IsLunar ? 4 : (IsBoss ? 13 : 5));
			ItemAPI.Add(new CustomEquipment(EquipmentDef, CreateItemDisplayRules()));
			Setup();
		}

		protected abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected virtual void Setup()
		{
		}

		internal virtual bool Activate(EquipmentSlot equipmentSlot)
		{
			return false;
		}

		protected static ItemDisplayRule ParentedRule(GameObject displayModel, string childName, Vector3 localPos, Vector3 localAngles, float localScale)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			return new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = displayModel,
				childName = childName,
				localPos = localPos,
				localAngles = localAngles,
				localScale = new Vector3(localScale, localScale, localScale)
			};
		}
	}
	internal class GroovyLightningOrb : Orb
	{
		public GameObject effectPrefab;

		public float damageValue;

		public GameObject attacker;

		public TeamIndex teamIndex;

		public bool isCrit;

		public ProcChainMask procChainMask;

		public float procCoefficient = 1f;

		public DamageColorIndex damageColorIndex;

		public int bouncesRemaining;

		public float range = 20f;

		private List<HealthComponent> _bouncedObjects = new List<HealthComponent>();

		private BullseyeSearch _search;

		public override void Begin()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			EffectData val = new EffectData
			{
				origin = base.origin,
				genericFloat = ((Orb)this).duration
			};
			val.SetHurtBoxReference(base.target);
			EffectManager.SpawnEffect(effectPrefab, val, true);
		}

		public override void OnArrival()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)base.target))
			{
				return;
			}
			HealthComponent healthComponent = base.target.healthComponent;
			if (Object.op_Implicit((Object)(object)healthComponent))
			{
				DamageInfo val = new DamageInfo
				{
					damage = damageValue,
					attacker = attacker,
					inflictor = null,
					force = Vector3.zero,
					crit = isCrit,
					procChainMask = procChainMask,
					procCoefficient = procCoefficient,
					position = ((Component)base.target).transform.position,
					damageColorIndex = damageColorIndex,
					damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)8192, (DamageSource)64),
					inflictedHurtbox = base.target
				};
				healthComponent.TakeDamage(val);
				GlobalEventManager.instance.OnHitEnemy(val, ((Component)healthComponent).gameObject);
				GlobalEventManager.instance.OnHitAll(val, ((Component)healthComponent).gameObject);
				_bouncedObjects.Add(healthComponent);
			}
			if (bouncesRemaining > 0)
			{
				HurtBox val2 = PickNextTarget(((Component)base.target).transform.position);
				if (Object.op_Implicit((Object)(object)val2))
				{
					OrbManager instance = OrbManager.instance;
					GroovyLightningOrb groovyLightningOrb = new GroovyLightningOrb();
					((Orb)groovyLightningOrb).duration = ((Orb)this).duration;
					((Orb)groovyLightningOrb).origin = ((Component)base.target).transform.position;
					((Orb)groovyLightningOrb).target = val2;
					groovyLightningOrb.effectPrefab = effectPrefab;
					groovyLightningOrb.damageValue = damageValue;
					groovyLightningOrb.attacker = attacker;
					groovyLightningOrb.teamIndex = teamIndex;
					groovyLightningOrb.isCrit = isCrit;
					groovyLightningOrb.procChainMask = procChainMask;
					groovyLightningOrb.procCoefficient = procCoefficient;
					groovyLightningOrb.damageColorIndex = damageColorIndex;
					groovyLightningOrb.bouncesRemaining = bouncesRemaining - 1;
					groovyLightningOrb.range = range;
					groovyLightningOrb._bouncedObjects = _bouncedObjects;
					groovyLightningOrb._search = _search;
					instance.AddOrb((Orb)(object)groovyLightningOrb);
				}
			}
		}

		private HurtBox PickNextTarget(Vector3 position)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			if (_search == null)
			{
				_search = new BullseyeSearch();
			}
			_search.searchOrigin = position;
			_search.searchDirection = Vector3.zero;
			_search.teamMaskFilter = TeamMask.allButNeutral;
			((TeamMask)(ref _search.teamMaskFilter)).RemoveTeam(teamIndex);
			_search.filterByLoS = false;
			_search.sortMode = (SortMode)1;
			_search.maxDistanceFilter = range;
			_search.RefreshCandidates();
			return _search.GetResults().FirstOrDefault((Func<HurtBox, bool>)((HurtBox hurtBox) => !_bouncedObjects.Contains(hurtBox.healthComponent)));
		}
	}
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber)
		{
			int num = callerPath.LastIndexOf("GroovyEquipment");
			if (num >= 0)
			{
				callerPath = callerPath.Substring(num + "GroovyEquipment".Length + 1);
			}
			return $"{callerPath}:{callerLineNumber} ({callerMemberName}) ";
		}

		internal static void Debug(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogDebug((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Debug_NoCallerPrefix(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Error_NoCallerPrefix(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Fatal_NoCallerPrefix(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Info_NoCallerPrefix(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Message_NoCallerPrefix(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Warning_NoCallerPrefix(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.groovesalad.GroovyEquipment", "GroovyEquipment", "1.1.0")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "com.groovesalad.GroovyEquipment";

		public const string PluginAuthor = "Groove_Salad";

		public const string PluginName = "GroovyEquipment";

		public const string PluginVersion = "1.1.0";

		private readonly Dictionary<EquipmentDef, GroovyEquipmentBase> _equipmentByDef = new Dictionary<EquipmentDef, GroovyEquipmentBase>();

		internal static Main Instance { get; private set; }

		public void Awake()
		{
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			Instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Assets.Load();
			NetworkingAPI.RegisterMessageType<GatewaySwapMessage>();
			GroovyEquipmentBase[] array = new GroovyEquipmentBase[4]
			{
				new GroundZero(),
				new OffensiveMicrobot(),
				new ForgottenGateway(),
				new PerennialRemnant()
			};
			GroovyEquipmentBase[] array2 = array;
			foreach (GroovyEquipmentBase groovyEquipmentBase in array2)
			{
				if (((BaseUnityPlugin)this).Config.Bind<bool>(groovyEquipmentBase.Name, "Enable " + groovyEquipmentBase.Name + "?", true, "Enable/Disable this equipment").Value)
				{
					groovyEquipmentBase.Init();
					_equipmentByDef[groovyEquipmentBase.EquipmentDef] = groovyEquipmentBase;
				}
			}
			EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction);
		}

		private bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
		{
			if (Object.op_Implicit((Object)(object)equipmentDef) && _equipmentByDef.TryGetValue(equipmentDef, out var value))
			{
				return !self.equipmentDisabled && value.Activate(self);
			}
			return orig.Invoke(self, equipmentDef);
		}
	}
}
namespace GroovyEquipment.Equipment
{
	internal class ForgottenGateway : GroovyEquipmentBase
	{
		private const float TargetRange = 65f;

		private static readonly Color IndicatorColor = new Color(0.655f, 0.69f, 0.92f);

		private GameObject _targetIndicator;

		internal static GameObject BlinkEffect { get; private set; }

		internal override string Name => "Forgotten Gateway";

		protected override string LangToken => "LUNARTELEPORT";

		protected override string PickupText => "Swap places with a targeted monster.";

		protected override string DescriptionText => "Quickly <style=cIsUtility>swap places</style> with a targeted monster. Can target monsters within <style=cIsUtility>" + 65f + "m</style>.";

		protected override string LoreText => "<style=cMono># File Search\n# Rallypoint [Redacted]\n# Survivor Log\n# Day 83\n> AUTOTRANSCRIPTION</style>\n\nDay 84. Er, 83. We recovered Emma after her transponder cut out over a week ago. It pains me to say that she is no longer with us. She had various relics about her, we assume they were for protection.\n\nOf note was a set of alien rings, intially dormant, but they sprung to life when Josh approached the body. The account is that they started rotating widly and stayed near him throughout the journey home. Crew members were spooked but they seem harmless.\n\nMoreover, they have applications for near instant travel. Some survivors here have a feel for it, they say you can reach out through them to where you wish to be. Many cannot replicate it, myself included.\n\nOur one man \"science\" department thinks he can link them to the ancient teleporters we have discovered nearby. He says the rings help him understand how the structures function. I wish I could understand how he functions, half of what the guy says is gibberish.\n\nWe hope someone gets this. This could be big.\n\n<style=cMono>//--END OF TRANSCRIPTION--//</style>";

		protected override GameObject PickupModel { get; } = Assets.LoadModel("Assets/Models/LunarTeleport/PickupLunarTeleport.prefab");

		protected override Sprite Icon { get; } = Assets.LoadBundleAsset<Sprite>("Assets/Icons/texIconPickupLunarTeleport.png");

		protected override float Cooldown => 15f;

		protected override bool IsLunar => true;

		protected override void Setup()
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			bool flag = default(bool);
			ContentAddition.AddEntityState<GatewayBlinkState>(ref flag);
			CreateIndicator();
			BlinkEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_moon.MoonExitArenaOrbEffect_prefab), "TeleportMovementBlink", false);
			BlinkEffect.GetComponent<EffectComponent>().applyScale = true;
			ContentAddition.AddEffect(BlinkEffect);
			EquipmentSlot.UpdateTargets += new hook_UpdateTargets(UpdateTargets);
		}

		private void CreateIndicator()
		{
			//IL_0048: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			_targetIndicator = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/LightningIndicator"), "LunarTeleportIndicator", false);
			Transform val = Assets.FindChild(_targetIndicator, "TextMeshPro");
			TextMeshPro val2 = default(TextMeshPro);
			if (Object.op_Implicit((Object)(object)val) && ((Component)val).TryGetComponent<TextMeshPro>(ref val2))
			{
				((Graphic)val2).color = IndicatorColor;
			}
			Transform val3 = Assets.FindChild(_targetIndicator, "Holder/Brackets");
			if (Object.op_Implicit((Object)(object)val3))
			{
				Object.DestroyImmediate((Object)(object)((Component)val3).gameObject);
			}
			Transform val4 = Assets.FindChild(Assets.Load<GameObject>(RoR2_Base_Captain.CaptainAirstrikeCrosshair_prefab), "Center (1)");
			Image val6 = default(Image);
			Sprite val5 = ((Object.op_Implicit((Object)(object)val4) && ((Component)val4).TryGetComponent<Image>(ref val6)) ? val6.sprite : null);
			SpriteRenderer[] componentsInChildren = _targetIndicator.GetComponentsInChildren<SpriteRenderer>(true);
			foreach (SpriteRenderer val7 in componentsInChildren)
			{
				val7.color = IndicatorColor;
				if (Object.op_Implicit((Object)(object)val5))
				{
					val7.sprite = val5;
				}
				((Component)val7).transform.localScale = new Vector3(0.5f, 0.5f, 1f);
			}
		}

		private void UpdateTargets(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			if ((int)targetingEquipmentIndex == -1 || targetingEquipmentIndex != EquipmentDef.equipmentIndex)
			{
				orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget);
				return;
			}
			if (self.remoteClientTargetOverride.HasValue)
			{
				self.currentTarget = self.remoteClientTargetOverride.Value;
			}
			else if (userShouldAnticipateTarget && Object.op_Implicit((Object)(object)self.teamComponent))
			{
				BullseyeSearch targetFinder = self.targetFinder;
				float num = default(float);
				Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num);
				targetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.teamComponent.teamIndex);
				targetFinder.sortMode = (SortMode)2;
				targetFinder.filterByLoS = true;
				targetFinder.searchOrigin = ((Ray)(ref val)).origin;
				targetFinder.searchDirection = ((Ray)(ref val)).direction;
				targetFinder.maxAngleFilter = 10f;
				targetFinder.maxDistanceFilter = 65f + num;
				targetFinder.viewer = self.characterBody;
				targetFinder.RefreshCandidates();
				targetFinder.FilterOutGameObject(((Component)self).gameObject);
				self.currentTarget = new UserTargetInfo(targetFinder.GetResults().FirstOrDefault());
				targetFinder.maxDistanceFilter = float.PositiveInfinity;
			}
			else
			{
				self.currentTarget = default(UserTargetInfo);
			}
			bool flag = Object.op_Implicit((Object)(object)self.currentTarget.transformToIndicateAt);
			if (self.targetIndicator != null)
			{
				if (flag)
				{
					self.targetIndicator.visualizerPrefab = _targetIndicator;
				}
				self.targetIndicator.active = flag;
				self.targetIndicator.targetTransform = (flag ? self.currentTarget.transformToIndicateAt : null);
			}
		}

		internal override bool Activate(EquipmentSlot equipmentSlot)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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)
			CharacterBody characterBody = equipmentSlot.characterBody;
			if (!Object.op_Implicit((Object)(object)characterBody))
			{
				return false;
			}
			equipmentSlot.UpdateTargets(EquipmentDef.equipmentIndex, true);
			HurtBox hurtBox = equipmentSlot.currentTarget.hurtBox;
			CharacterBody val = ((Object.op_Implicit((Object)(object)hurtBox) && Object.op_Implicit((Object)(object)hurtBox.healthComponent)) ? hurtBox.healthComponent.body : null);
			if (!Object.op_Implicit((Object)(object)val) || (Object)(object)val == (Object)(object)characterBody)
			{
				return false;
			}
			Vector3 position = characterBody.transform.position;
			Vector3 position2 = val.transform.position;
			StartBlink(val, position, ignoreNodes: false);
			StartBlink(characterBody, position2, ignoreNodes: true);
			equipmentSlot.InvalidateCurrentTarget();
			return true;
		}

		private static void StartBlink(CharacterBody body, Vector3 destination, bool ignoreNodes)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			if (body.hasEffectiveAuthority)
			{
				GatewayBlinkState.Begin(body, destination, ignoreNodes);
			}
			else
			{
				NetMessageExtensions.Send((INetMessage)(object)new GatewaySwapMessage(((NetworkBehaviour)body).netId, destination, ignoreNodes), (NetworkDestination)1);
			}
		}

		protected override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: 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_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Assets.PrepareDisplayModel(Assets.LoadModel("Assets/Models/LunarTeleport/LunarTeleportDisplay.prefab", keepBundledShaders: true));
			AddRingRotation(val, "Ring (1)", 60f);
			AddRingRotation(val, "Ring (2)", -40f);
			AddRingRotation(val, "Ring (3)", 20f);
			AddRingRotation(val, "Ring (4)", -50f);
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val2.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmR", new Vector3(-0.01499f, 0.3849f, 0.01668f), new Vector3(0.72371f, 140.8009f, 175.8595f), 0.11687f) });
			val2.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmR", new Vector3(0.01525f, 0.28057f, -0.00644f), new Vector3(355.8147f, 3.38143f, 176.8621f), 0.08726f) });
			val2.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmR", new Vector3(0.00014f, 4.11163f, -0.02346f), new Vector3(359.2167f, 133.8593f, 358.0013f), 1.31762f) });
			val2.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmR", new Vector3(-0.01053f, 0.20799f, 0.01551f), new Vector3(1.29187f, 284.0298f, 355.5136f), 0.136f) });
			val2.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmR", new Vector3(-0.00254f, 0.20906f, -0.00773f), new Vector3(0.43699f, 45.4785f, 356.8247f), 0.1457f) });
			val2.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "Chest", new Vector3(-0.00238f, 0.16628f, -0.22046f), new Vector3(285.8216f, 27.31519f, 332.6601f), 0.1162f) });
			val2.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "WeaponPlatform", new Vector3(-0.00581f, 0.04873f, 0.34198f), new Vector3(359.9016f, 122.6209f, 359.4202f), 0.29269f) });
			val2.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "MechLowerArmL", new Vector3(0.01207f, 0.54728f, -0.02222f), new Vector3(355.8719f, 15.82778f, 3.46181f), 0.19808f) });
			val2.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "MouthMuzzle", new Vector3(0.00665f, 0.08985f, -0.23356f), new Vector3(307.0141f, 121.9761f, 50.50682f), 2.11859f) });
			val2.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmR", new Vector3(0.00522f, 0.37717f, -0.0071f), new Vector3(6.67231f, 15.95711f, 359.4266f), 0.14574f) });
			val2.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "SideWeapon", new Vector3(-0.00237f, -0.22585f, 0.11418f), new Vector3(358.0904f, 49.65118f, 180.0239f), 0.06458f) });
			val2.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmL", new Vector3(0.14249f, 3.03238f, 0.09675f), new Vector3(3.12649f, 7.07253f, 356.1373f), 1.25916f) });
			val2.Add("mdlEquipmentDrone", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "GunBarrelBase", new Vector3(-0.06608f, -0.55368f, 1.0439f), new Vector3(352.9329f, 282.5455f, 358.9288f), 0.49771f) });
			return val2;
		}

		private static void AddRingRotation(GameObject display, string ringName, float speed)
		{
			Transform val = Assets.FindChild(display, ringName);
			if (Object.op_Implicit((Object)(object)val))
			{
				RotateAroundAxis val2 = ((Component)val).gameObject.AddComponent<RotateAroundAxis>();
				val2.rotateAroundAxis = (RotationAxis)2;
				val2.relativeTo = (Space)1;
				val2.fastRotationSpeed = speed * 2f;
				val2.slowRotationSpeed = speed;
				val2.speed = (Speed)1;
			}
		}
	}
	internal class GatewayBlinkState : BaseState
	{
		private const float Speed = 150f;

		private Vector3 _blinkStart;

		private Vector3 _blinkDestination;

		private bool _ignoreNodes;

		private float _duration;

		private bool _hasBlinked;

		private bool _hasExited;

		private CharacterModel _characterModel;

		private HurtBoxGroup _hurtBoxGroup;

		internal static void Begin(CharacterBody body, Vector3 destination, bool ignoreNodes)
		{
			//IL_003c: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)body).gameObject, "Body");
			if (Object.op_Implicit((Object)(object)val))
			{
				val.SetNextState((EntityState)(object)new GatewayBlinkState
				{
					_blinkDestination = destination,
					_ignoreNodes = ignoreNodes
				});
			}
			else
			{
				TeleportHelper.TeleportBody(body, destination, false);
			}
		}

		public override void OnEnter()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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();
			_blinkStart = ((EntityState)this).transform.position;
			if (((EntityState)this).isAuthority && !_ignoreNodes && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				SnapDestinationToGround();
			}
			_duration = Vector3.Distance(_blinkStart, _blinkDestination) / 150f;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				_characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
				_hurtBoxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			}
			if (Object.op_Implicit((Object)(object)_characterModel))
			{
				CharacterModel characterModel = _characterModel;
				int invisibilityCount = characterModel.invisibilityCount;
				characterModel.invisibilityCount = invisibilityCount + 1;
			}
			if (Object.op_Implicit((Object)(object)_hurtBoxGroup))
			{
				HurtBoxGroup hurtBoxGroup = _hurtBoxGroup;
				int invisibilityCount = hurtBoxGroup.hurtBoxesDeactivatorCounter;
				hurtBoxGroup.hurtBoxesDeactivatorCounter = invisibilityCount + 1;
			}
			SpawnBlinkEffect();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((Behaviour)((EntityState)this).characterMotor).enabled = false;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor))
			{
				((Behaviour)((EntityState)this).rigidbodyMotor).enabled = false;
			}
			((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
			}
		}

		private void SnapDestinationToGround()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			NodeGraph val = (Object.op_Implicit((Object)(object)SceneInfo.instance) ? SceneInfo.instance.groundNodes : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				NodeIndex val2 = val.FindClosestNode(_blinkDestination, ((EntityState)this).characterBody.hullClassification, float.PositiveInfinity);
				Vector3 val3 = default(Vector3);
				if (val2 != NodeIndex.invalid && val.GetNodePosition(val2, ref val3))
				{
					_blinkDestination = val3 + (((EntityState)this).transform.position - ((EntityState)this).characterBody.footPosition);
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0079: 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)
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
			}
			if (!_hasBlinked)
			{
				float num = ((_duration > 0f) ? (((EntityState)this).fixedAge / _duration) : 1f);
				SetPosition(Vector3.Lerp(_blinkStart, _blinkDestination, num));
				if (num >= 1f)
				{
					_hasBlinked = true;
					SetPosition(_blinkDestination);
				}
			}
			if (((EntityState)this).fixedAge >= _duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void SetPosition(Vector3 position)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPositionAndRotation(position, Quaternion.identity, true);
			}
			else
			{
				TeleportHelper.TeleportGameObject(((EntityState)this).gameObject, position);
			}
		}

		public override void OnExit()
		{
			if (!_hasExited)
			{
				_hasExited = true;
				((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
					((Behaviour)((EntityState)this).characterMotor).enabled = true;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor))
				{
					((Behaviour)((EntityState)this).rigidbodyMotor).enabled = true;
				}
				if (Object.op_Implicit((Object)(object)_characterModel))
				{
					CharacterModel characterModel = _characterModel;
					int invisibilityCount = characterModel.invisibilityCount;
					characterModel.invisibilityCount = invisibilityCount - 1;
				}
				if (Object.op_Implicit((Object)(object)_hurtBoxGroup))
				{
					HurtBoxGroup hurtBoxGroup = _hurtBoxGroup;
					int invisibilityCount = hurtBoxGroup.hurtBoxesDeactivatorCounter;
					hurtBoxGroup.hurtBoxesDeactivatorCounter = invisibilityCount - 1;
				}
				SpawnBlinkEffect();
			}
			((EntityState)this).OnExit();
		}

		private void SpawnBlinkEffect()
		{
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_003f: Expected O, but got Unknown
			EffectManager.SpawnEffect(ForgottenGateway.BlinkEffect, new EffectData
			{
				origin = ((EntityState)this).characterBody.corePosition,
				rotation = Random.rotation,
				scale = ((EntityState)this).characterBody.bestFitRadius
			}, false);
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnSerialize(writer);
			writer.Write(_blinkDestination);
			writer.Write(_ignoreNodes);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnDeserialize(reader);
			_blinkDestination = reader.ReadVector3();
			_ignoreNodes = reader.ReadBoolean();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)9;
		}
	}
	internal struct GatewaySwapMessage : INetMessage, ISerializableObject
	{
		private NetworkInstanceId _bodyNetId;

		private Vector3 _destination;

		private bool _ignoreNodes;

		internal GatewaySwapMessage(NetworkInstanceId bodyNetId, Vector3 destination, bool ignoreNodes)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			_bodyNetId = bodyNetId;
			_destination = destination;
			_ignoreNodes = ignoreNodes;
		}

		public void Serialize(NetworkWriter writer)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			writer.Write(_bodyNetId);
			writer.Write(_destination);
			writer.Write(_ignoreNodes);
		}

		public void Deserialize(NetworkReader reader)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			_bodyNetId = reader.ReadNetworkId();
			_destination = reader.ReadVector3();
			_ignoreNodes = reader.ReadBoolean();
		}

		public void OnReceived()
		{
			//IL_0002: 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)
			GameObject val = Util.FindNetworkObject(_bodyNetId);
			CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<CharacterBody>() : null);
			if (Object.op_Implicit((Object)(object)val2) && val2.hasEffectiveAuthority)
			{
				GatewayBlinkState.Begin(val2, _destination, _ignoreNodes);
			}
		}
	}
	internal class GroundZero : GroovyEquipmentBase
	{
		private class GroundZeroDeafenOnImpact : MonoBehaviour
		{
			private bool _pending;

			private void OnEnable()
			{
				_pending = true;
			}

			private void Update()
			{
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				if (!_pending)
				{
					return;
				}
				_pending = false;
				foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList)
				{
					GameObject target = readOnlyInstances.target;
					if (Object.op_Implicit((Object)(object)target))
					{
						Vector3 val = target.transform.position - ((Component)this).transform.position;
						if (((Vector3)(ref val)).sqrMagnitude <= 14400f)
						{
							GroundZeroDeafenedTracker groundZeroDeafenedTracker = target.GetComponent<GroundZeroDeafenedTracker>() ?? target.AddComponent<GroundZeroDeafenedTracker>();
							groundZeroDeafenedTracker.Restart();
						}
					}
				}
			}
		}

		private class GroundZeroDeafenedTracker : MonoBehaviour
		{
			private float _age;

			internal float MusicHealthValue => Mathf.Lerp(-100f, 100f, _age / 5f);

			internal void Restart()
			{
				_age = 0f;
			}

			private void FixedUpdate()
			{
				_age += Time.fixedDeltaTime;
				if (_age >= 5f)
				{
					Object.Destroy((Object)(object)this);
				}
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_RecalculateHealth <0>__MuffleMusicWhileDeafened;
		}

		private const float DamageCoefficient = 25f;

		private const float Radius = 120f;

		private const float ArrivalDelay = 4f;

		private const float DeafenDuration = 5f;

		private static readonly Color Orange = new Color(1f, 0.33f, 0f);

		private GameObject _activationEffect;

		private GameObject _impactEffect;

		private GameObject _bombProjectile;

		internal override string Name => "Ground Zero";

		protected override string LangToken => "GROUNDZERO";

		protected override string PickupText => "Request an explosive payload that destroys most things in the vicinity.";

		protected override string DescriptionText => "Request an <style=cIsDamage>explosive payload</style> from a <style=cIsDamage>high-altitude drone</style>. Lands after <style=cIsUtility>" + 4f + "</style> seconds, dealing <style=cIsDamage>" + 2500f + "% damage</style> in a large area and burning enemies.";

		protected override string LoreText => "\"The next step in offensive technology . . . The TZ-980 is a terror of modern engineering. Three ze-light thrusters provide aerial support from as high as 15,000 meters with automated flight control. A modified mili-tech printer ingrained within the system offers near-infinite ammo recycling and repair. But the best part, the creators mention, is the 'Ground Zero' protocol. They've been quiet about the details, but it's not long before this menace will be publicly available.\n\nAnd what a menace it will be . . . This is not some specialized military machine. No, this is affordable technology. Price estimations fall as low as 12k credits. If the future of this product doesn't mortify you, then you've likely already purchased one!\"\n\n- Lunar Tech Tips Weekly, Collection 3";

		protected override GameObject PickupModel { get; } = Assets.LoadModel("Assets/Models/GroundZero/PickupGroundZero.prefab");

		protected override Sprite Icon { get; } = Assets.LoadBundleAsset<Sprite>("Assets/Icons/texIconPickupGroundZero.png");

		protected override float Cooldown => 140f;

		protected override void Setup()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			CreateActivationEffect();
			CreateImpactEffect();
			CreateProjectile();
			object obj = <>O.<0>__MuffleMusicWhileDeafened;
			if (obj == null)
			{
				hook_RecalculateHealth val = MuffleMusicWhileDeafened;
				<>O.<0>__MuffleMusicWhileDeafened = val;
				obj = (object)val;
			}
			MusicController.RecalculateHealth += (hook_RecalculateHealth)obj;
		}

		private void CreateActivationEffect()
		{
			//IL_0036: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			_activationEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_RoboBallBoss.RoboBallBossDelayKnockupEffect_prefab), "GroundZeroActivationEffect", false);
			_activationEffect.transform.localScale = new Vector3(0.2f, 0.6f, 0.2f);
			_activationEffect.GetComponent<EffectComponent>().soundName = "Play_item_use_gateway_vanish";
			Transform val = Assets.FindChild(_activationEffect, "Point light");
			Light val2 = default(Light);
			if (Object.op_Implicit((Object)(object)val) && ((Component)val).TryGetComponent<Light>(ref val2))
			{
				val2.color = Orange;
			}
			Renderer renderer = Assets.GetRenderer(Assets.Load<GameObject>(RoR2_Base_Captain.CaptainAirstrikeGhost1_prefab), 3);
			Material val3 = Assets.Tint(Object.op_Implicit((Object)(object)renderer) ? renderer.sharedMaterial : null, Orange);
			if (Object.op_Implicit((Object)(object)val3))
			{
				Renderer[] componentsInChildren = _activationEffect.GetComponentsInChildren<Renderer>(true);
				foreach (Renderer val4 in componentsInChildren)
				{
					val4.sharedMaterial = val3;
				}
			}
			Transform val5 = Assets.FindChild(_activationEffect, "3DDebris");
			if (Object.op_Implicit((Object)(object)val5))
			{
				Object.DestroyImmediate((Object)(object)((Component)val5).gameObject);
			}
			ContentAddition.AddEffect(_activationEffect);
		}

		private void CreateImpactEffect()
		{
			//IL_0052: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			_impactEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_Grandparent.GrandParentSunSpawn_prefab), "GroundZeroImpactEffect", false);
			_impactEffect.GetComponent<EffectComponent>().soundName = "Play_grandParent_attack3_sun_spawn";
			Vector3 localScale = default(Vector3);
			((Vector3)(ref localScale))..ctor(20f, 20f, 20f);
			_impactEffect.transform.localScale = localScale;
			Transform val = Assets.FindChild(_impactEffect, "Particles");
			if (Object.op_Implicit((Object)(object)val))
			{
				val.localScale = localScale;
			}
			Transform val2 = Assets.FindChild(_impactEffect, "Point Light");
			if (Object.op_Implicit((Object)(object)val2))
			{
				Light val3 = default(Light);
				if (((Component)val2).TryGetComponent<Light>(ref val3))
				{
					val3.color = Color.white;
					val3.intensity = 20000f;
					val3.colorTemperature = 20000f;
				}
				LightIntensityCurve val4 = default(LightIntensityCurve);
				if (((Component)val2).TryGetComponent<LightIntensityCurve>(ref val4))
				{
					val4.timeMax = 0.5f;
				}
			}
			GameObject root = Assets.Load<GameObject>(RoR2_Base_Common_VFX.ExplosionVFX_prefab);
			Renderer renderer = Assets.GetRenderer(root, 0);
			Renderer renderer2 = Assets.GetRenderer(root, 1);
			SetMaterial(_impactEffect, 0, Assets.Tint(Object.op_Implicit((Object)(object)renderer) ? renderer.sharedMaterial : null, Orange));
			SetMaterial(_impactEffect, 1, Object.op_Implicit((Object)(object)renderer2) ? renderer2.sharedMaterial : null);
			SetMaterial(_impactEffect, 3, Object.op_Implicit((Object)(object)renderer2) ? renderer2.sharedMaterial : null);
			string[] array = new string[2] { "Particles/Goo, Drip", "Particles/Trails" };
			foreach (string path in array)
			{
				Transform val5 = Assets.FindChild(_impactEffect, path);
				if (Object.op_Implicit((Object)(object)val5))
				{
					((Component)val5).gameObject.SetActive(false);
				}
			}
			_impactEffect.AddComponent<GroundZeroDeafenOnImpact>();
			ContentAddition.AddEffect(_impactEffect);
		}

		private void CreateProjectile()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Expected O, but got Unknown
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Expected O, but got Unknown
			GameObject val = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_Captain.CaptainAirstrikeGhost1_prefab), "GroundZeroBombGhost", false);
			for (int i = 1; i <= 3; i++)
			{
				Renderer renderer = Assets.GetRenderer(val, i);
				if (Object.op_Implicit((Object)(object)renderer))
				{
					renderer.sharedMaterial = Assets.Tint(renderer.sharedMaterial, Orange);
				}
			}
			Transform val2 = Assets.FindChild(val, "Expander/AreaIndicatorCenter/Rings");
			ParticleSystemRenderer val3 = default(ParticleSystemRenderer);
			if (Object.op_Implicit((Object)(object)val2) && ((Component)val2).TryGetComponent<ParticleSystemRenderer>(ref val3))
			{
				((Renderer)val3).sharedMaterial = Assets.Tint(((Renderer)val3).sharedMaterial, Orange);
			}
			Transform val4 = Assets.FindChild(val, "Expander");
			if (Object.op_Implicit((Object)(object)val4))
			{
				val4.localScale = new Vector3(120f, 120f, 120f);
			}
			Transform val5 = Assets.FindChild(val, "Expander/Sphere, Inner Expanding");
			if (Object.op_Implicit((Object)(object)val5))
			{
				MeshRenderer val6 = default(MeshRenderer);
				if (((Component)val5).TryGetComponent<MeshRenderer>(ref val6))
				{
					((Renderer)val6).sharedMaterial = Assets.Tint(((Renderer)val6).sharedMaterial, Orange);
				}
				ObjectScaleCurve val7 = default(ObjectScaleCurve);
				if (((Component)val5).TryGetComponent<ObjectScaleCurve>(ref val7))
				{
					val7.timeMax = 4f;
				}
			}
			Transform val8 = Assets.FindChild(val, "AirstrikeOrientation/FallingProjectile");
			if (Object.op_Implicit((Object)(object)val8))
			{
				ObjectTransformCurve val9 = default(ObjectTransformCurve);
				if (((Component)val8).TryGetComponent<ObjectTransformCurve>(ref val9))
				{
					val9.translationCurveX = new AnimationCurve();
					val9.translationCurveY = AnimationCurve.Linear(0f, -500f, 1f, 0f);
					val9.translationCurveZ = new AnimationCurve();
					val9.timeMax = 4f;
				}
				Transform val10 = val8.Find("Core/Soft Glow");
				if (Object.op_Implicit((Object)(object)val10))
				{
					((Component)val10).gameObject.SetActive(false);
				}
			}
			_bombProjectile = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_Captain.CaptainAirstrikeProjectile1_prefab), "GroundZeroBombProjectile", true);
			ProjectileController component = _bombProjectile.GetComponent<ProjectileController>();
			component.ghostPrefabAddress = new AssetReferenceT<GameObject>("");
			component.ghostPrefab = val;
			ProjectileDamage component2 = _bombProjectile.GetComponent<ProjectileDamage>();
			ref DamageType damageType = ref component2.damageType.damageType;
			damageType = (DamageType)((uint)damageType | 0x80u);
			component2.damageType.damageSource = (DamageSource)64;
			ProjectileImpactExplosion component3 = _bombProjectile.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component3).blastRadius = 120f;
			component3.impactEffect = _impactEffect;
			component3.lifetime = 4f;
			ContentAddition.AddProjectile(_bombProjectile);
		}

		private static void SetMaterial(GameObject root, int rendererIndex, Material material)
		{
			Renderer renderer = Assets.GetRenderer(root, rendererIndex);
			if (Object.op_Implicit((Object)(object)renderer) && Object.op_Implicit((Object)(object)material))
			{
				renderer.sharedMaterial = material;
			}
		}

		private static void MuffleMusicWhileDeafened(orig_RecalculateHealth orig, MusicController self, GameObject playerObject)
		{
			orig.Invoke(self, playerObject);
			GroundZeroDeafenedTracker groundZeroDeafenedTracker = default(GroundZeroDeafenedTracker);
			if (Object.op_Implicit((Object)(object)self.target) && self.target.TryGetComponent<GroundZeroDeafenedTracker>(ref groundZeroDeafenedTracker))
			{
				self.rtpcPlayerHealthValue.value = Mathf.Min(groundZeroDeafenedTracker.MusicHealthValue, self.rtpcPlayerHealthValue.value);
			}
		}

		internal override bool Activate(EquipmentSlot equipmentSlot)
		{
			//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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody characterBody = equipmentSlot.characterBody;
			if (!Object.op_Implicit((Object)(object)characterBody))
			{
				return false;
			}
			Vector3 position = characterBody.transform.position;
			EffectManager.SpawnEffect(_activationEffect, new EffectData
			{
				origin = position,
				rotation = characterBody.transform.rotation
			}, true);
			Vector3 val = position + new Vector3(Random.onUnitSphere.x * 40f, 0f, Random.onUnitSphere.z * 40f);
			NodeGraph val2 = (Object.op_Implicit((Object)(object)SceneInfo.instance) ? SceneInfo.instance.groundNodes : null);
			if (Object.op_Implicit((Object)(object)val2))
			{
				NodeIndex val3 = val2.FindClosestNode(val, (HullClassification)0, 120f);
				if (val3 != NodeIndex.invalid)
				{
					val2.GetNodePosition(val3, ref val);
				}
			}
			ProjectileManager instance = ProjectileManager.instance;
			FireProjectileInfo val4 = new FireProjectileInfo
			{
				projectilePrefab = _bombProjectile,
				crit = characterBody.RollCrit(),
				damage = characterBody.damage * 25f,
				damageColorIndex = (DamageColorIndex)3,
				force = 0f,
				owner = ((Component)characterBody).gameObject,
				position = val,
				rotation = Util.QuaternionSafeLookRotation(Vector3.up)
			};
			((FireProjectileInfo)(ref val4)).speedOverride = 0f;
			instance.FireProjectile(val4);
			return true;
		}

		protected override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			GameObject displayModel = Assets.PrepareDisplayModel(PickupModel);
			ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "Pelvis", new Vector3(0.15451f, 0.03344f, -0.13724f), new Vector3(25.72593f, 134.079f, 187.9464f), 0.03f) });
			val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "ThighL", new Vector3(0.01348f, 0.28293f, 0.16492f), new Vector3(351.4297f, 3.84624f, 168.8454f), 0.03f) });
			val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "HandR", new Vector3(0.21713f, 2.07651f, 0.31533f), new Vector3(350.1311f, 73.11926f, 87.21719f), 0.5f) });
			val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "HandL", new Vector3(0.00226f, 0.34001f, -0.04921f), new Vector3(9.88647f, 184.2898f, 261.3252f), 0.07f) });
			val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "LowerArmR", new Vector3(0.1131f, 0.15844f, -0.01742f), new Vector3(351.7809f, 88.41628f, 84.74796f), 0.05f) });
			val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "ThighL", new Vector3(0.02532f, 0.25882f, 0.16609f), new Vector3(356.4894f, 348.0898f, 158.6888f), 0.04f) });
			val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "FlowerBase", new Vector3(0.70496f, 0.89979f, -0.48762f), new Vector3(356.6534f, 122.7962f, 357.2982f), 0.1f) });
			val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "Chest", new Vector3(-0.00397f, 0.1948f, 0.20689f), new Vector3(356.4328f, 16.65194f, 355.9486f), 0.05f) });
			val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "Neck", new Vector3(1.85595f, 2.36447f, -2.03972f), new Vector3(331.5596f, 123.4068f, 348.1623f), 0.4f) });
			val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "ThighR", new Vector3(-0.10076f, 0.09968f, 0.12428f), new Vector3(3.88237f, 310.0208f, 177.4998f), 0.03f) });
			val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "Hat", new Vector3(0.00102f, 0.10506f, 0.134f), new Vector3(313.406f, 32.51733f, 337.5683f), 0.025f) });
			val.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "Weapon", new Vector3(-4.14449f, -0.57608f, 0.01178f), new Vector3(12.3029f, 277.4858f, 271.6548f), 0.7f) });
			val.Add("mdlEquipmentDrone", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(displayModel, "GunBarrelBase", new Vector3(0.03055f, 0.24645f, 1.33844f), new Vector3(293.0769f, 93.15293f, 265.6196f), 0.23149f) });
			return val;
		}
	}
	internal class OffensiveMicrobot : GroovyEquipmentBase
	{
		private class DisplayOffensiveMicrobotController : MonoBehaviour
		{
			private GameObject _spinner;

			private RotateAroundAxis[] _rotations;

			private CharacterBody _body;

			internal Transform MicrobotMesh { get; private set; }

			private void Start()
			{
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				CharacterModel componentInParent = ((Component)this).GetComponentInParent<CharacterModel>();
				_body = (Object.op_Implicit((Object)(object)componentInParent) ? componentInParent.body : null);
				if (Object.op_Implicit((Object)(object)_body))
				{
					_spinner = Object.Instantiate<GameObject>(_spinnerPrefab, _body.transform, false);
					_spinner.transform.localPosition = Vector3.zero;
					_rotations = _spinner.GetComponentsInChildren<RotateAroundAxis>();
					MicrobotMesh = _spinner.transform.Find("DisplayOffensiveMicrobotMesh");
				}
			}

			private void Update()
			{
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)_body) || _rotations == null)
				{
					return;
				}
				Speed val = (Speed)((!_body.HasBuff(_microbotBuff)) ? 1 : 2);
				RotateAroundAxis[] rotations = _rotations;
				foreach (RotateAroundAxis val2 in rotations)
				{
					if (val2.speed != val)
					{
						val2.speed = val;
					}
				}
			}

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

		private const float BuffDuration = 12f;

		private const float DamageMultiplier = 9f;

		private const int MaxBounces = 25;

		private const float TargetRange = 60f;

		private static BuffDef _microbotBuff;

		private static GameObject _spinnerPrefab;

		private GameObject _orbEffect;

		private EquipmentIndex _equipmentIndex => EquipmentDef.equipmentIndex;

		internal override string Name => "Offensive Microbot";

		protected override string LangToken => "OFFENSIVEMICROBOT";

		protected override string PickupText => "Retaliate against the next attack with a deadly particle beam.";

		protected override string DescriptionText => "Fire a powerful <style=cIsDamage>particle beam</style> at the next attacker within " + 12f + " seconds. The beam deals <style=cIsDamage>" + 9f + "x</style> the damage of the initial attack and arcs between up to <style=cIsDamage>" + 25 + "</style> targets.";

		protected override string LoreText => "<style=cMono>//--Research Lab Gamma : UES Faraday--//\n//--13/4/2053 14:46--//\n//--Experiment ID: 279A44E6--//</style>\n\n> RESULT CODE 9: Unscheduled Termination of Experiment\n\n> Output Log:\n> Exernal Temperature: 44 Celsius\n> Internal Temperature: 117 Celsius\n> Pressure: 1,236 Kilo-Pascal\n> Stored Power: 5,267 Amp-Hour\n> Elapsed Time: 3,244 Seconds\n\n<style=cMono>//--FILE APPENDED -- 13/4/2053 14:45--//\n//--BEGIN AUDIO TRANSCRIPTION--//</style>\n\n\"I can't believe the guys at manufacturing got this thing so small! you'd think the printers wouldn't be able to deal with such small tolerances for the inertia locks, let alone the-\"\n[Doors opening]\n\"Ah, Grace! You brought... do you need a hand with those? I cant even see you over the boxes\"\n\"Nah I got i- woah!\"\n[Loud crash]\n[High-pitched whine]\n\"OH GOD GET DOWN\"\n[UNKNOWN_SOUND]\n[UNKNOWN_SOUND]\n[UNKNOWN_SOUND]\n[Sizzling]\n\n<style=cMono>//--END AUDIO TRANSCRIPTION--//</style>";

		protected override GameObject PickupModel { get; } = Assets.LoadModel("Assets/Models/OffensiveMicrobotS/PickupOffensiveMicrobot.prefab");

		protected override Sprite Icon { get; } = Assets.LoadBundleAsset<Sprite>("Assets/Icons/texIconPickupOffensiveMicrobot.png");

		protected override float Cooldown => 45f;

		protected override void Setup()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			_microbotBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)_microbotBuff).name = "bdOffensiveMicrobot";
			_microbotBuff.buffColor = new Color(1f, 1f, 0.5f);
			_microbotBuff.iconSprite = Assets.LoadBundleAsset<Sprite>("Assets/Icons/texBuffOffensiveMicrobot.png");
			_microbotBuff.canStack = true;
			_microbotBuff.isDebuff = false;
			ContentAddition.AddBuffDef(_microbotBuff);
			CreateEffects();
			GlobalEventManager.onServerDamageDealt += Retaliate;
		}

		private void CreateEffects()
		{
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_Loader.LoaderGroundSlam_prefab), "OffensiveMicrobotOrbStartEffect", false);
			val.GetComponent<EffectComponent>().soundName = "Play_captain_drone_zap";
			List<GameObject> list = new List<GameObject>();
			int[] array = new int[3] { 5, 6, 8 };
			foreach (int index in array)
			{
				Renderer renderer = Assets.GetRenderer(val, index);
				if (Object.op_Implicit((Object)(object)renderer))
				{
					list.Add(((Component)renderer).gameObject);
				}
			}
			list.ForEach((Action<GameObject>)Object.DestroyImmediate);
			ContentAddition.AddEffect(val);
			GameObject val2 = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_Loader.OmniImpactVFXLoaderLightning_prefab), "OffensiveMicrobotOrbEndEffect", false);
			val2.GetComponent<EffectComponent>().soundName = "Play_commando_M2";
			ContentAddition.AddEffect(val2);
			_orbEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>(RoR2_Base_Loader.LoaderLightningOrbEffect_prefab), "OffensiveMicrobotOrbEffect", false);
			_orbEffect.GetComponent<EffectComponent>().soundName = "Play_captain_m2_tazer_shoot";
			OrbEffect component = _orbEffect.GetComponent<OrbEffect>();
			component.startEffect = val;
			component.startEffectScale = 4f;
			component.endEffect = val2;
			LineRenderer componentInChildren = _orbEffect.GetComponentInChildren<LineRenderer>(true);
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				componentInChildren.startColor = Color.yellow;
				componentInChildren.endColor = Color.yellow;
				componentInChildren.startWidth = 1f;
				componentInChildren.endWidth = 1f;
			}
			Renderer renderer2 = Assets.GetRenderer(Assets.Load<GameObject>(RoR2_Base_Loader.LoaderGroundSlam_prefab), 1);
			Renderer renderer3 = Assets.GetRenderer(_orbEffect, 0);
			if (Object.op_Implicit((Object)(object)renderer2) && Object.op_Implicit((Object)(object)renderer3))
			{
				renderer3.sharedMaterial = Assets.Tint(renderer2.sharedMaterial, Color.yellow);
			}
			ContentAddition.AddEffect(_orbEffect);
		}

		internal override bool Activate(EquipmentSlot equipmentSlot)
		{
			if (!Object.op_Implicit((Object)(object)equipmentSlot.characterBody))
			{
				return false;
			}
			equipmentSlot.characterBody.AddTimedBuff(_microbotBuff, 12f);
			return true;
		}

		private void Retaliate(DamageReport damageReport)
		{
			//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_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: 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_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody victimBody = damageReport.victimBody;
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)victimBody) || !victimBody.HasBuff(_microbotBuff) || damageReport.damageDealt <= 0f || damageReport.damageInfo.procCoefficient <= 0f)
			{
				return;
			}
			victimBody.RemoveOldestTimedBuff(_microbotBuff);
			TeamIndex teamIndex = victimBody.teamComponent.teamIndex;
			HurtBox val = null;
			CharacterBody attackerBody = damageReport.attackerBody;
			if (Object.op_Implicit((Object)(object)attackerBody) && (Object)(object)attackerBody != (Object)(object)victimBody && Object.op_Implicit((Object)(object)attackerBody.mainHurtBox) && attackerBody.teamComponent.teamIndex != teamIndex)
			{
				val = attackerBody.mainHurtBox;
			}
			else
			{
				HurtBox[] hurtBoxes = new SphereSearch
				{
					origin = damageReport.damageInfo.position,
					radius = 60f,
					mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
					queryTriggerInteraction = (QueryTriggerInteraction)0
				}.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(teamIndex)).OrderCandidatesByDistance()
					.FilterCandidatesByDistinctHurtBoxEntities()
					.GetHurtBoxes();
				if (hurtBoxes.Length != 0)
				{
					val = hurtBoxes[0];
				}
			}
			if (Object.op_Implicit((Object)(object)val))
			{
				OrbManager instance = OrbManager.instance;
				GroovyLightningOrb groovyLightningOrb = new GroovyLightningOrb();
				((Orb)groovyLightningOrb).duration = 0.1f;
				((Orb)groovyLightningOrb).origin = (Vector3)(((??)FindMicrobotPosition(victimBody)) ?? victimBody.corePosition);
				((Orb)groovyLightningOrb).target = val;
				groovyLightningOrb.effectPrefab = _orbEffect;
				groovyLightningOrb.damageValue = damageReport.damageDealt * 9f;
				groovyLightningOrb.attacker = ((Component)victimBody).gameObject;
				groovyLightningOrb.teamIndex = teamIndex;
				groovyLightningOrb.isCrit = victimBody.RollCrit();
				groovyLightningOrb.procCoefficient = 1f;
				groovyLightningOrb.damageColorIndex = (DamageColorIndex)3;
				groovyLightningOrb.bouncesRemaining = 25;
				groovyLightningOrb.range = 60f;
				instance.AddOrb((Orb)(object)groovyLightningOrb);
			}
		}

		private Vector3? FindMicrobotPosition(CharacterBody body)
		{
			//IL_0053: 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)
			CharacterModel val = ((Object.op_Implicit((Object)(object)body.modelLocator) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) ? ((Component)body.modelLocator.modelTransform).GetComponent<CharacterModel>() : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return null;
			}
			foreach (GameObject equipmentDisplayObject in val.GetEquipmentDisplayObjects(_equipmentIndex))
			{
				DisplayOffensiveMicrobotController displayOffensiveMicrobotController = (Object.op_Implicit((Object)(object)equipmentDisplayObject) ? equipmentDisplayObject.GetComponent<DisplayOffensiveMicrobotController>() : null);
				if (Object.op_Implicit((Object)(object)displayOffensiveMicrobotController) && Object.op_Implicit((Object)(object)displayOffensiveMicrobotController.MicrobotMesh))
				{
					return displayOffensiveMicrobotController.MicrobotMesh.position;
				}
			}
			return null;
		}

		protected override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: 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_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: 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_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_040e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Assets.PrepareDisplayModel(Assets.LoadBundleAsset<GameObject>("Assets/Models/OffensiveMicrobotS/DisplayOffensiveMicrobotHolder.prefab"));
			val.AddComponent<DisplayOffensiveMicrobotController>();
			CreateSpinnerPrefab();
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val2.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "Chest", Vector3.zero, Vector3.zero, 0.1f) });
			val2.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "ThighL", new Vector3(0.01348f, 0.28293f, 0.16492f), new Vector3(351.4297f, 3.84624f, 168.8454f), 0.03f) });
			val2.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "HandR", new Vector3(0.21713f, 2.07651f, 0.31533f), new Vector3(350.1311f, 73.11926f, 87.21719f), 0.5f) });
			val2.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "HandL", new Vector3(0.00226f, 0.34001f, -0.04921f), new Vector3(9.88647f, 184.2898f, 261.3252f), 0.07f) });
			val2.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "LowerArmR", new Vector3(0.1131f, 0.15844f, -0.01742f), new Vector3(351.7809f, 88.41628f, 84.74796f), 0.05f) });
			val2.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "ThighL", new Vector3(0.02532f, 0.25882f, 0.16609f), new Vector3(356.4894f, 348.0898f, 158.6888f), 0.04f) });
			val2.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "FlowerBase", new Vector3(0.70496f, 0.89979f, -0.48762f), new Vector3(356.6534f, 122.7962f, 357.2982f), 0.1f) });
			val2.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "Chest", new Vector3(-0.00397f, 0.1948f, 0.20689f), new Vector3(356.4328f, 16.65194f, 355.9486f), 0.05f) });
			val2.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "Neck", new Vector3(1.85595f, 2.36447f, -2.03972f), new Vector3(331.5596f, 123.4068f, 348.1623f), 0.4f) });
			val2.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "ThighR", new Vector3(-0.10076f, 0.09968f, 0.12428f), new Vector3(3.88237f, 310.0208f, 177.4998f), 0.03f) });
			val2.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "Hat", new Vector3(0.00102f, 0.10506f, 0.134f), new Vector3(313.406f, 32.51733f, 337.5683f), 0.025f) });
			val2.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "Weapon", new Vector3(-4.14449f, -0.57608f, 0.01178f), new Vector3(12.3029f, 277.4858f, 271.6548f), 0.7f) });
			val2.Add("mdlEquipmentDrone", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { GroovyEquipmentBase.ParentedRule(val, "GunBarrelBase", new Vector3(-4.14449f, -0.57608f, 0.01178f), new Vector3(12.3029f, 277.4858f, 271.6548f), 0.7f) });
			return val2;
		}

		private static void CreateSpinnerPrefab()
		{
			//IL_0062: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			_spinnerPrefab = PrefabAPI.InstantiateClone(Assets.LoadBundleAsset<GameObject>("Assets/Models/OffensiveMicrobotS/OffensiveMicrobotSpinner.prefab"), "OffensiveMicrobotSpinner", false);
			AddRotation(_spinnerPrefab);
			GameObject val = Object.Instantiate<GameObject>(Assets.LoadModel("Assets/Models/OffensiveMicrobotS/DisplayOffensiveMicrobotMesh.prefab", keepBundledShaders: true), _spinnerPrefab.transform);
			((Object)val).name = "DisplayOffensiveMicrobotMesh";
			val.transform.localPosition = new Vector3(3f, 1f, 0f);
			val.transform.localRotation = Util.QuaternionSafeLookRotation(Vector3.back + 0.2f * Vector3.up);
			val.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
			AddRotation(val);
			Light componentInChildren = val.GetComponentInChildren<Light>(true);
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				componentInChildren.intensity *= 3f;
			}
		}

		private static void AddRotation(GameObject gameObject)
		{
			RotateAroundAxis val = gameObject.AddComponent<RotateAroundAxis>();
			val.rotateAroundAxis = (RotationAxis)1;
			val.relativeTo = (Space)0;
			val.fastRotationSpeed = 100f;
			val.slowRotationSpeed = 40f;
			val.speed = (Speed)1;
		}
	}
	internal class PerennialRemnant : GroovyEquipmentBase
	{
		private class TarWardDamage : MonoBehaviour
		{
			private BuffWard _buffWard;

			private TeamFilter _teamFilter;

			private GenericOwnership _ownership;

			private float _pulseTimer;

			private void Awake()
			{
				_buffWard = ((Component)this).GetComponent<BuffWard>();
				_teamFilter = ((Component)this).GetComponent<TeamFilter>();
				_ownership = ((Component)this).GetComponent<GenericOwnership>();
			}

			private void FixedUpdate()
			{
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_017d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0180: Invalid comparison between Unknown and I4
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0176: Unknown result type (might be due to invalid IL or missing references)
				//IL_0179: 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_0131: Unknown result type (might be due to invalid IL or missing references)
				//IL_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				if (!NetworkServer.active || !Object.op_Implicit((Object)(object)_ownership.ownerObject))
				{
					return;
				}
				_pulseTimer -= Time.fixedDeltaTime;
				if (_pulseTimer > 0f)
				{