Decompiled source of Demolisher v0.3.4

plugins/Demolisher.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BodyModelAdditionsAPI;
using Demolisher;
using DemolisherComponents;
using EmotesAPI;
using EntityStates;
using EntityStates.ImpMonster;
using EntityStates.SurvivorPod;
using HG.BlendableTypes;
using HG.Reflection;
using JetBrains.Annotations;
using KinematicCharacterController;
using LoadoutSkillTitles;
using Microsoft.CodeAnalysis;
using NetworkConfigs;
using On.EntityStates;
using On.EntityStates.SurvivorPod;
using On.RoR2;
using On.RoR2.Skills;
using On.RoR2.UI;
using On.RoR2.UI.LogBook;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using Rewired;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.ContentManagement;
using RoR2.HudOverlay;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2.UI.LogBook;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Demolisher")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+1ffcab203c2f0956b2d242b04a72d7d2c6ed9f4d")]
[assembly: AssemblyProduct("Demolisher")]
[assembly: AssemblyTitle("Demolisher")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public static class EmoteCompatAbility
{
	public class DemoEmotesComponent : MonoBehaviour
	{
		public List<MainModule> customSpaceParticles = new List<MainModule>();
	}

	[CompilerGenerated]
	private static class <>O
	{
		public static AnimationChanged <0>__CustomEmotesAPI_animChanged;
	}

	public const string customEmotesApiGUID = "com.weliveinasociety.CustomEmotesAPI";

	public static void EmoteCompatability()
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Expected O, but got Unknown
		string text = "Assets/Demoman/DemoEmotes.prefab";
		GameObject val = Main.ThunderkitAssets.LoadAsset<GameObject>(text);
		val.AddComponent<DemoEmotesComponent>();
		CustomEmotesAPI.ImportArmature(Main.DemoBody, val, 0, true);
		val.GetComponentInChildren<BoneMapper>().scale = 1f;
		val.transform.localPosition = new Vector3(0f, -0f, 0f);
		val.transform.localRotation = Quaternion.identity;
		object obj = <>O.<0>__CustomEmotesAPI_animChanged;
		if (obj == null)
		{
			AnimationChanged val2 = CustomEmotesAPI_animChanged;
			<>O.<0>__CustomEmotesAPI_animChanged = val2;
			obj = (object)val2;
		}
		CustomEmotesAPI.animChanged += (AnimationChanged)obj;
	}

	public static void EmoteCompatabilityModelPartSizeSet(GameObject gameObject, float scaleAddition)
	{
		BoneMapper componentInChildren = gameObject.GetComponentInChildren<BoneMapper>();
		if ((Object)(object)componentInChildren != (Object)null)
		{
			componentInChildren.scale *= scaleAddition;
		}
	}

	private static void CustomEmotesAPI_animChanged(string newAnimation, BoneMapper mapper)
	{
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		if (!(((Object)((Component)mapper).transform).name == "DemoEmotes"))
		{
			return;
		}
		DemoEmotesComponent component = ((Component)mapper).GetComponent<DemoEmotesComponent>();
		ChildLocator component2 = ((Component)((Component)mapper).transform.parent).GetComponent<ChildLocator>();
		ChildLocator component3 = ((Component)mapper).GetComponent<ChildLocator>();
		Transform val = component2.FindChild("WeaponR");
		Transform val2 = component2.FindChild("WeaponL");
		Transform val3 = component2.FindChild("Shield");
		if (newAnimation != "none")
		{
			((Component)val).gameObject.SetActive(false);
			((Component)val2).gameObject.SetActive(false);
			((Component)val3).gameObject.SetActive(false);
			for (int i = 0; i < component.customSpaceParticles.Count; i++)
			{
				MainModule val4 = component.customSpaceParticles[i];
				((MainModule)(ref val4)).simulationSpace = (ParticleSystemSimulationSpace)0;
			}
		}
		else
		{
			((Component)val).gameObject.SetActive(true);
			((Component)val2).gameObject.SetActive(true);
			((Component)val3).gameObject.SetActive(true);
			for (int j = 0; j < component.customSpaceParticles.Count; j++)
			{
				MainModule val5 = component.customSpaceParticles[j];
				((MainModule)(ref val5)).simulationSpace = (ParticleSystemSimulationSpace)2;
			}
		}
	}
}
public static class LoadoutSkillTitlesCompatability
{
	public const string loadoutSKillTitlesGUID = "com.TheTimeSweeper.LoadoutSkillTitles";

	public static void AddCompatability()
	{
		LoadoutSkillTitlesPlugin.AddTitleToken("DemolisherBody", 2, "LOADOUT_SKILL_PRIMARY");
		LoadoutSkillTitlesPlugin.AddTitleToken("DemolisherBody", 5, "LOADOUT_SKILL_UTILITY");
	}
}
public static class RiskOfOptionsCompatability
{
	public const string riskOfOptionsGUID = "com.rune580.riskofoptions";

	public static void AddFloatConfig(ConfigEntry<float> configEntry)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(configEntry));
	}

	public static void AddIntConfig(ConfigEntry<int> configEntry)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		ModSettingsManager.AddOption((BaseOption)new IntFieldOption(configEntry));
	}

	public static void AddBoolConfig(ConfigEntry<bool> configEntry)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(configEntry));
	}
}
public static class Extensions
{
	public static void AddBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		characterBody.AddBuffAuthotiry(buffDef.buffIndex);
	}

	public static void AddBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		characterBody.AddOrRemoveBuffAuthotiry(buffIndex, 1);
	}

	public static void RemoveBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		characterBody.RemoveBuffAuthotiry(buffDef.buffIndex);
	}

	public static void RemoveBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		characterBody.AddOrRemoveBuffAuthotiry(buffIndex, -1);
	}

	public static void AddOrRemoveBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef, int amount)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		characterBody.AddOrRemoveBuffAuthotiry(buffDef.buffIndex, amount);
	}

	public static void AddOrRemoveBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex, int amount)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		NetMessageExtensions.Send((INetMessage)(object)new Main.AddBuffNetMessage(((NetworkBehaviour)characterBody).netId, buffIndex, amount, -1f), (NetworkDestination)2);
	}

	public static void AddTimedBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef, int amount, float duration)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		characterBody.AddTimedBuffAuthotiry(buffDef.buffIndex, amount, duration);
	}

	public static void AddTimedBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex, int amount, float duration)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		NetMessageExtensions.Send((INetMessage)(object)new Main.AddBuffNetMessage(((NetworkBehaviour)characterBody).netId, buffIndex, amount, duration), (NetworkDestination)2);
	}

	public static void ReplaceOrAddValueInDictionary<T1, T2>(this Dictionary<T1, T2> dictionary, T1 key, T2 value)
	{
		if (dictionary.ContainsKey(key))
		{
			dictionary[key] = value;
		}
		else
		{
			dictionary.Add(key, value);
		}
	}

	public static void CheckIfLanded(this CharacterMotor characterMotor)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		if (characterMotor.isGrounded)
		{
			characterMotor.body.SetBuffCount(Main.VelocityPreserve.buffIndex, 0);
		}
	}
}
namespace DemolisherComponents
{
	public class DemoVoicelinesComponent : MonoBehaviour
	{
		public int kills = 0;

		public NetworkBehaviour networkBehaviour;

		public Main.DemoVoiceline currentVoiceline;

		private bool isAudioInvoking = false;

		public void PlayAudio(Main.DemoVoiceline demoVoiceline)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			StopCurrentAudio();
			currentVoiceline = demoVoiceline;
			NetMessageExtensions.Send((INetMessage)(object)new Main.PlaySoundNetMessage(networkBehaviour.netId, currentVoiceline.playString, isVoiceline: true), (NetworkDestination)1);
			isAudioInvoking = false;
		}

		public void PlayGenericKillAudio()
		{
			Main.DemoVoiceline demoVoiceline = Main.demoVoiceLines[Main.DemoVoicelineType.Kill][Random.Range(0, Main.demoVoiceLines[Main.DemoVoicelineType.Kill].Count)];
			PlayAudio(demoVoiceline);
		}

		public void PlayTrapKillAudio()
		{
			Main.DemoVoiceline demoVoiceline = Main.demoVoiceLines[Main.DemoVoicelineType.TrapKill][Random.Range(0, Main.demoVoiceLines[Main.DemoVoicelineType.TrapKill].Count)];
			PlayAudio(demoVoiceline);
		}

		public void PlayDeathAudio()
		{
			Main.DemoVoiceline demoVoiceline = Main.demoVoiceLines[Main.DemoVoicelineType.Death][Random.Range(0, Main.demoVoiceLines[Main.DemoVoicelineType.Death].Count)];
			PlayAudio(demoVoiceline);
		}

		public void PlayReleaseAudio()
		{
			Main.DemoVoiceline demoVoiceline = Main.demoVoiceLines[Main.DemoVoicelineType.Landing][Random.Range(0, Main.demoVoiceLines[Main.DemoVoicelineType.Landing].Count)];
			PlayAudio(demoVoiceline);
		}

		public void StopCurrentAudio()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			if (currentVoiceline != null)
			{
				NetMessageExtensions.Send((INetMessage)(object)new Main.PlaySoundNetMessage(networkBehaviour.netId, currentVoiceline.stopString, isVoiceline: true), (NetworkDestination)1);
			}
		}

		public void RegisterKill(CharacterBody characterBody, DamageReport damageReport)
		{
			kills += ((!Object.op_Implicit((Object)(object)characterBody) || !characterBody.isChampion) ? 1 : 500);
			if (!isAudioInvoking && Random.Range(0f, 100f - Main.VoicelineOnKillBaseChance.Value - (float)kills * Main.VoicelineOnKillChanceAddition.Value) < 10f)
			{
				if ((Object)(object)damageReport.damageInfo.inflictor != (Object)null && Object.op_Implicit((Object)(object)damageReport.damageInfo.inflictor.GetComponent<Main.StickyComponent>()))
				{
					((MonoBehaviour)this).Invoke("PlayTrapKillAudio", Random.Range(0.2f, 1f));
				}
				else
				{
					((MonoBehaviour)this).Invoke("PlayGenericKillAudio", Random.Range(0.2f, 1f));
				}
				kills = 0;
				isAudioInvoking = true;
			}
		}

		public void Update()
		{
		}
	}
	public class DemoCharacterBody : CharacterBody
	{
		public DemoComponent demoComponent;

		public DemoVoicelinesComponent demoVoicelinesComponent;
	}
	public class DemoComponent : MonoBehaviour
	{
		public Dictionary<string, List<Main.StickyComponent>> stickies = new Dictionary<string, List<Main.StickyComponent>>();

		public int noLimitStickies = 0;

		public int maxAdditionalStickies = 0;

		public float additionalArmTime = 0f;

		public InputBankTest inputBank;

		public SkillLocator skillLocator;

		public int secondaryStocks = 0;

		public float secondaryCooldown = 0f;

		public int primaryStocks = 0;

		public float primaryCooldown = 0f;

		public int primaryReplaceStocks = 0;

		public float primaryReplaceCooldown = 0f;

		public GenericSkill primaryReplace;

		public GenericSkill utilityReplace;

		public GenericSkill secondaryReplace;

		public GenericSkill specialReplace;

		public GameObject chargeMeter;

		public OverlayController overlayController;

		public bool updateMeter = true;

		public GameObject hudObject;

		public GameObject altCrosshair;

		public ChildLocator childLocator;

		public CharacterModel characterModel;

		public CharacterBody characterBody;

		private OverrideRequest overrideRequest;

		public Transform primarystockCounter;

		public Image primaryStopwatch;

		public Transform secondarystockCounter;

		public Image secondaryStopwatch;

		public Image leftMeter;

		public Image rightMeter;

		public Image leftMeterBase;

		public Image rightMeterBase;

		public TextMeshProUGUI stickyText;

		public TextMeshProUGUI extraPrimaryText;

		public TextMeshProUGUI extraSecondaryText;

		private GenericSkill trackStickies;

		private GenericSkill trackSword;

		private GenericSkill trackUtility;

		private CameraTargetParams cameraTargetParams;

		public bool canUseUtility = true;

		public float canUseUtilityTimer = 0f;

		public bool canUseSecondary = true;

		public float canUseSecondaryTimer = 0f;

		public bool useUtility;

		public EntityStateMachine bodyStateMachine;

		public GameObject swordObject;

		public GameObject shieldObject;

		public SpritePosition[] spritePositions;

		private bool isUtilitydown = false;

		private bool wasUtilitydown = false;

		public Main.GmodPropDef currentProp;

		public Image currentPropImage;

		public OverlayController gmodOverlayController;

		public GameObject gmodPropsListObject;

		public int index = 0;

		public int stickyCount
		{
			get
			{
				int num = 0;
				foreach (KeyValuePair<string, List<Main.StickyComponent>> sticky in stickies)
				{
					num += sticky.Value.Count;
				}
				return num;
			}
		}

		public bool isSwapped
		{
			get
			{
				if (Object.op_Implicit((Object)(object)skillLocator) && Skills.stickySkills.Contains(skillLocator.primary.baseSkill))
				{
					return true;
				}
				return false;
			}
		}

		public bool justReleased => !isUtilitydown && wasUtilitydown;

		public bool justPressed => isUtilitydown && !wasUtilitydown;

		public void Awake()
		{
			primaryReplace = skillLocator.FindSkillByFamilyName("DemoStickies");
			primaryReplace.RecalculateValues();
			trackStickies = primaryReplace;
			SkillDef detonateSkillDef = Skills.DetonateSkillDef;
			if (Skills.customDetonationSkills.ContainsKey(primaryReplace.baseSkill))
			{
				detonateSkillDef = Skills.customDetonationSkills[primaryReplace.baseSkill];
			}
			utilityReplace = skillLocator.FindSkillByFamilyName("DemoDetonate");
			utilityReplace.RecalculateValues();
			trackUtility = skillLocator.utility;
			if (!stickies.ContainsKey("All"))
			{
				stickies.Add("All", new List<Main.StickyComponent>());
			}
			cameraTargetParams = ((Component)this).GetComponent<CameraTargetParams>();
		}

		public void OnEnable()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: 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)
			((Component)((Component)this).GetComponent<ModelLocator>().modelTransform).GetComponent<DynamicBone>().m_Weight = 0.07f;
			OverlayCreationParams val = default(OverlayCreationParams);
			val.prefab = chargeMeter;
			val.childLocatorEntry = "CrosshairExtras";
			OverlayCreationParams val2 = val;
			overlayController = HudOverlayManager.AddOverlay(((Component)this).gameObject, val2);
			overlayController.onInstanceAdded += OnOverlayInstanceAdded;
			overlayController.onInstanceRemove += OnOverlayInstanceRemoved;
		}

		private void OnOverlayInstanceRemoved(OverlayController controller, GameObject @object)
		{
		}

		public void DetonateNoLimitStickies()
		{
			if (!stickies.ContainsKey("All"))
			{
				return;
			}
			while (stickies["All"].Count > 0)
			{
				for (int i = 0; i < stickies["All"].Count; i++)
				{
					stickies["All"][i].DetonateSticky(0f);
				}
			}
		}

		public void DetonateAllStickies()
		{
			foreach (KeyValuePair<string, List<Main.StickyComponent>> sticky in stickies)
			{
				while (sticky.Value.Count > 0)
				{
					for (int i = 0; i < sticky.Value.Count; i++)
					{
						sticky.Value[i].DetonateSticky(0f);
					}
				}
			}
		}

		private void OnOverlayInstanceAdded(OverlayController controller, GameObject @object)
		{
		}

		public void Swap()
		{
			bool flag = isSwapped;
			if (Object.op_Implicit((Object)(object)hudObject))
			{
				if (flag)
				{
					if (Object.op_Implicit((Object)(object)altCrosshair))
					{
						overrideRequest = CrosshairUtils.RequestOverrideForBody(characterBody, altCrosshair, (OverridePriority)1);
					}
					leftMeter.sprite = Main.StickyIndicator;
					rightMeter.sprite = Main.StickyIndicator;
					leftMeterBase.sprite = Main.StickyIndicator;
					rightMeterBase.sprite = Main.StickyIndicator;
				}
				else
				{
					if (overrideRequest != null)
					{
						overrideRequest.Dispose();
					}
					leftMeter.sprite = Main.SwordIndicator;
					rightMeter.sprite = Main.SwordIndicator;
					leftMeterBase.sprite = Main.SwordIndicator;
					rightMeterBase.sprite = Main.SwordIndicator;
				}
			}
			if (flag)
			{
				Util.PlaySound(Main.DemoStickyReloadSound.playSoundString, ((Component)this).gameObject);
			}
			else
			{
				Util.PlaySound(Main.DemoDrawSwordSound.playSoundString, ((Component)this).gameObject);
			}
			characterBody.AddSpreadBloom(0.5f);
		}

		public void LateUpdate()
		{
			//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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if (!Util.HasEffectiveAuthority(characterBody.networkIdentity))
			{
				return;
			}
			float num = 0f;
			if (Object.op_Implicit((Object)(object)characterBody))
			{
				num = characterBody.spreadBloomAngle;
			}
			if (spritePositions != null)
			{
				for (int i = 0; i < spritePositions.Length; i++)
				{
					SpritePosition val = spritePositions[i];
					((Transform)val.target).localPosition = Vector3.Lerp(val.zeroPosition, val.onePosition, num / 3f);
				}
			}
		}

		public void FixedUpdate()
		{
			//IL_0105: 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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: 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_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_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: 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)
			if (canUseUtility && canUseUtilityTimer > 0f)
			{
				canUseUtilityTimer -= Time.fixedDeltaTime;
			}
			if (canUseSecondary && canUseSecondaryTimer > 0f)
			{
				canUseSecondaryTimer -= Time.fixedDeltaTime;
			}
			if (!Object.op_Implicit((Object)(object)hudObject) && overlayController != null && overlayController.instancesList.Count > 0)
			{
				List<SpritePosition> list = new List<SpritePosition>();
				hudObject = overlayController.instancesList[0];
				ChildLocator component = hudObject.GetComponent<ChildLocator>();
				leftMeter = ((Component)component.FindChild("LeftIndicator")).GetComponent<Image>();
				rightMeter = ((Component)component.FindChild("RightIndicator")).GetComponent<Image>();
				leftMeterBase = ((Component)((Component)leftMeter).transform.parent).GetComponent<Image>();
				SpritePosition val = default(SpritePosition);
				val.target = ((Component)leftMeterBase).GetComponent<RectTransform>();
				val.onePosition = new Vector3(16f, 0f, 0f);
				val.zeroPosition = new Vector3(2f, 0f, 0f);
				SpritePosition item = val;
				list.Add(item);
				rightMeterBase = ((Component)((Component)rightMeter).transform.parent).GetComponent<Image>();
				val = default(SpritePosition);
				val.target = ((Component)rightMeterBase).GetComponent<RectTransform>();
				val.onePosition = new Vector3(-16f, 0f, 0f);
				val.zeroPosition = new Vector3(-2f, 0f, 0f);
				item = val;
				list.Add(item);
				spritePositions = list.ToArray();
				extraPrimaryText = ((Component)component.FindChild("LeftText")).GetComponent<TextMeshProUGUI>();
				extraSecondaryText = ((Component)component.FindChild("RightText")).GetComponent<TextMeshProUGUI>();
				primaryStopwatch = ((Component)component.FindChild("LeftStick")).GetComponent<Image>();
				secondaryStopwatch = ((Component)component.FindChild("RightStick")).GetComponent<Image>();
				Swap();
			}
			if (Object.op_Implicit((Object)(object)extraPrimaryText) && Object.op_Implicit((Object)(object)trackStickies))
			{
				int stock = trackStickies.stock;
				if (stock > 0)
				{
					((TMP_Text)extraPrimaryText).text = stock.ToString();
				}
				else
				{
					((TMP_Text)extraPrimaryText).text = stock.ToString();
				}
			}
			if (Object.op_Implicit((Object)(object)inputBank))
			{
			}
			if (Object.op_Implicit((Object)(object)skillLocator))
			{
				if (Object.op_Implicit((Object)(object)extraSecondaryText))
				{
					int stock2 = skillLocator.secondary.stock;
					if (stock2 > 0)
					{
						((TMP_Text)extraSecondaryText).text = stock2.ToString();
					}
					else
					{
						((TMP_Text)extraSecondaryText).text = stock2.ToString();
					}
				}
				if (Object.op_Implicit((Object)(object)primaryStopwatch) && Object.op_Implicit((Object)(object)trackStickies))
				{
					if (trackStickies.stock >= trackStickies.maxStock)
					{
						primaryStopwatch.fillAmount = 1f;
					}
					else
					{
						primaryStopwatch.fillAmount = 1f - (trackStickies.finalRechargeInterval - trackStickies.rechargeStopwatch) / trackStickies.finalRechargeInterval;
					}
				}
				if (Object.op_Implicit((Object)(object)secondaryStopwatch))
				{
					if (skillLocator.secondary.stock >= skillLocator.secondary.maxStock)
					{
						secondaryStopwatch.fillAmount = 1f;
					}
					else
					{
						secondaryStopwatch.fillAmount = 1f - (skillLocator.secondary.finalRechargeInterval - skillLocator.secondary.rechargeStopwatch) / skillLocator.secondary.finalRechargeInterval;
					}
				}
			}
			if (Object.op_Implicit((Object)(object)stickyText))
			{
				((TMP_Text)stickyText).text = stickyCount.ToString();
			}
			if (Object.op_Implicit((Object)(object)leftMeter) && Object.op_Implicit((Object)(object)trackUtility) && updateMeter)
			{
				if (trackUtility.stock >= trackUtility.maxStock)
				{
					leftMeter.fillAmount = 1f;
				}
				else
				{
					leftMeter.fillAmount = 1f - (trackUtility.finalRechargeInterval - trackUtility.rechargeStopwatch) / trackUtility.finalRechargeInterval;
				}
			}
		}

		public void Update()
		{
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Invalid comparison between Unknown and I4
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Invalid comparison between Unknown and I4
			if (!Object.op_Implicit((Object)(object)inputBank) || !Object.op_Implicit((Object)(object)skillLocator))
			{
				return;
			}
			wasUtilitydown = isUtilitydown;
			if (inputBank.skill3.down)
			{
				isUtilitydown = true;
			}
			else
			{
				isUtilitydown = false;
			}
			if (justPressed)
			{
				bool flag = false;
				if (skillLocator.secondary.skillOverrides.Length != 0)
				{
					SkillOverride[] skillOverrides = skillLocator.secondary.skillOverrides;
					foreach (SkillOverride val in skillOverrides)
					{
						if ((Object)(object)val.skillDef == (Object)(object)Skills.SwapSkillDef && (int)val.priority == 4)
						{
							flag = true;
							break;
						}
					}
				}
				if (!flag)
				{
					secondaryCooldown = skillLocator.secondary.rechargeStopwatch;
					secondaryStocks = skillLocator.secondary.stock;
					skillLocator.secondary.SetSkillOverride((object)this, Skills.SwapSkillDef, (SkillOverridePriority)4);
					primaryReplaceCooldown = skillLocator.special.rechargeStopwatch;
					primaryReplaceStocks = skillLocator.special.stock;
					skillLocator.special.SetSkillOverride((object)this, Skills.SwapSkillDef, (SkillOverridePriority)4);
				}
			}
			if (!justReleased)
			{
				return;
			}
			bool flag2 = false;
			if (skillLocator.secondary.skillOverrides.Length != 0)
			{
				SkillOverride[] skillOverrides2 = skillLocator.secondary.skillOverrides;
				foreach (SkillOverride val2 in skillOverrides2)
				{
					if ((Object)(object)val2.skillDef == (Object)(object)Skills.SwapSkillDef && (int)val2.priority == 4)
					{
						flag2 = true;
						break;
					}
				}
			}
			if (flag2)
			{
				skillLocator.secondary.UnsetSkillOverride((object)this, Skills.SwapSkillDef, (SkillOverridePriority)4);
				skillLocator.secondary.stock = secondaryStocks;
				skillLocator.secondary.rechargeStopwatch = secondaryCooldown;
				skillLocator.special.UnsetSkillOverride((object)this, Skills.SwapSkillDef, (SkillOverridePriority)4);
				skillLocator.special.stock = primaryReplaceStocks;
				skillLocator.special.rechargeStopwatch = primaryReplaceCooldown;
			}
			if (canUseUtilityTimer <= 0f && Object.op_Implicit((Object)(object)bodyStateMachine) && ((object)bodyStateMachine.state).GetType() == ((SerializableEntityStateType)(ref bodyStateMachine.mainStateType)).stateType)
			{
				skillLocator.utility.ExecuteIfReady();
			}
			canUseUtility = true;
			useUtility = false;
		}
	}
}
namespace Demolisher
{
	[Serializable]
	[BepInPlugin("com.brynzananas.demolisher", "Demolisher", "0.3.4")]
	[BepInDependency("com.bepis.r2api", "5.1.5")]
	[BepInDependency("com.bepis.r2api.skills", "1.0.1")]
	[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.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public class LobbyIconMGGEComponent : MonoBehaviour
		{
			public int time = 0;

			public int maxTimes = 10;
		}

		public class MGEcomponent : MonoBehaviour
		{
			public RawImage rawImage;

			public float stopwatch = 0f;

			public void Awake()
			{
				Util.PlaySound(OohSound.playSoundString, ((Component)RoR2Application.instance).gameObject);
				rawImage = ((Component)((Component)this).transform.GetChild(0)).GetComponent<RawImage>();
			}

			public void Update()
			{
				//IL_0032: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				stopwatch += Time.unscaledDeltaTime;
				if (Object.op_Implicit((Object)(object)rawImage))
				{
					((Graphic)rawImage).color = new Color(((Graphic)rawImage).color.r, ((Graphic)rawImage).color.g, ((Graphic)rawImage).color.b, 1f - (stopwatch - 0.2f));
					if (((Graphic)rawImage).color.a <= 0f)
					{
						Object.Destroy((Object)(object)((Component)this).gameObject);
					}
				}
			}

			public void OnDestroy()
			{
			}
		}

		public class RemoveBodyEffectNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private string effectName;

			private string bone;

			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)
				instanceId = reader.ReadNetworkId();
				effectName = reader.ReadString();
				bone = reader.ReadString();
			}

			public RemoveBodyEffectNetMessage(NetworkInstanceId networkInstanceId, string effectName, string bone)
			{
				//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)
				instanceId = networkInstanceId;
				this.effectName = effectName;
				this.bone = bone;
			}

			public RemoveBodyEffectNetMessage()
			{
			}

			public void OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!Object.op_Implicit((Object)(object)val))
				{
					return;
				}
				CharacterBody component = val.GetComponent<CharacterBody>();
				if ((Object)(object)component == (Object)null)
				{
					return;
				}
				Transform modelTransform = component.modelLocator.modelTransform;
				ChildLocator val2 = (Object.op_Implicit((Object)(object)modelTransform) ? ((Component)modelTransform).GetComponent<ChildLocator>() : null);
				if ((Object)(object)val2 == (Object)null)
				{
					return;
				}
				if (bone != null && bone != "" && Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.FindChild(bone)))
				{
					do
					{
						GameObject gameObject = ((Component)val2.FindChild(bone).Find(effectName)).gameObject;
						((Object)gameObject).name = "gone";
						StopAndDestroyVFX(gameObject, 1f);
					}
					while (Object.op_Implicit((Object)(object)val2.FindChild(bone).Find(effectName)));
				}
				else
				{
					do
					{
						GameObject gameObject2 = ((Component)modelTransform.Find(effectName)).gameObject;
						((Object)gameObject2).name = "gone";
						StopAndDestroyVFX(gameObject2, 1f);
					}
					while (Object.op_Implicit((Object)(object)modelTransform.Find(effectName)));
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(instanceId);
				writer.Write(effectName);
				writer.Write(bone);
			}
		}

		public class RemoveComponentFromNetworkObjectNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private string componentName;

			public RemoveComponentFromNetworkObjectNetMessage(NetworkInstanceId networkInstanceId, string componentName)
			{
				//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)
				instanceId = networkInstanceId;
				this.componentName = componentName;
			}

			public RemoveComponentFromNetworkObjectNetMessage()
			{
			}

			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)
				instanceId = reader.ReadNetworkId();
				componentName = reader.ReadString();
			}

			public void OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (Object.op_Implicit((Object)(object)val))
				{
					Component componentByName = val.GetComponentByName(componentName);
					if (!((Object)(object)componentByName == (Object)null))
					{
						Object.Destroy((Object)(object)componentByName);
					}
				}
			}

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

		public class ModifyVectorOfCharacterMotorNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private string vectorField;

			private Vector3 value;

			public ModifyVectorOfCharacterMotorNetMessage(NetworkInstanceId networkInstanceId, string vectorField, Vector3 value)
			{
				//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)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				instanceId = networkInstanceId;
				this.vectorField = vectorField;
				this.value = value;
			}

			public ModifyVectorOfCharacterMotorNetMessage()
			{
			}

			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_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				instanceId = reader.ReadNetworkId();
				vectorField = reader.ReadString();
				value = reader.ReadVector3();
			}

			public void OnReceived()
			{
				//IL_0002: 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)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!((Object)(object)val == (Object)null))
				{
					CharacterMotor component = val.GetComponent<CharacterMotor>();
					if (!((Object)(object)component == (Object)null))
					{
						Reflection.SetFieldValue<Vector3>((object)component, vectorField, value);
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: 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)
				writer.Write(instanceId);
				writer.Write(vectorField);
				writer.Write(value);
			}
		}

		public class ModifyVectorOfRigidBodyNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private string vectorField;

			private Vector3 value;

			public ModifyVectorOfRigidBodyNetMessage(NetworkInstanceId networkInstanceId, string vectorField, Vector3 value)
			{
				//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)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				instanceId = networkInstanceId;
				this.vectorField = vectorField;
				this.value = value;
			}

			public ModifyVectorOfRigidBodyNetMessage()
			{
			}

			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_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				instanceId = reader.ReadNetworkId();
				vectorField = reader.ReadString();
				value = reader.ReadVector3();
			}

			public void OnReceived()
			{
				//IL_0002: 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)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!((Object)(object)val == (Object)null))
				{
					Rigidbody component = val.GetComponent<Rigidbody>();
					if (!((Object)(object)component == (Object)null))
					{
						Reflection.SetFieldValue<Vector3>((object)component, vectorField, value);
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: 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)
				writer.Write(instanceId);
				writer.Write(vectorField);
				writer.Write(value);
			}
		}

		public class ModifyFloatOfCharacterMotortNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private string floatField;

			private float value;

			public ModifyFloatOfCharacterMotortNetMessage(NetworkInstanceId networkInstanceId, string floatField, float value)
			{
				//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)
				instanceId = networkInstanceId;
				this.floatField = floatField;
				this.value = value;
			}

			public ModifyFloatOfCharacterMotortNetMessage()
			{
			}

			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)
				instanceId = reader.ReadNetworkId();
				floatField = reader.ReadString();
				value = reader.ReadSingle();
			}

			public void OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!((Object)(object)val == (Object)null))
				{
					CharacterMotor component = val.GetComponent<CharacterMotor>();
					if (!((Object)(object)component == (Object)null))
					{
						Reflection.SetFieldValue<float>((object)component, floatField, value);
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(instanceId);
				writer.Write(floatField);
				writer.Write(value);
			}
		}

		public class PlayVoicelineNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			public void Deserialize(NetworkReader reader)
			{
				throw new NotImplementedException();
			}

			public void OnReceived()
			{
				throw new NotImplementedException();
			}

			public void Serialize(NetworkWriter writer)
			{
				throw new NotImplementedException();
			}
		}

		public class PlaySoundNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private string sound;

			private bool isVoiceline;

			public PlaySoundNetMessage(NetworkInstanceId networkInstanceId, string soundString, bool isVoiceline)
			{
				//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)
				instanceId = networkInstanceId;
				sound = soundString;
				this.isVoiceline = isVoiceline;
			}

			public PlaySoundNetMessage()
			{
			}

			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)
				instanceId = reader.ReadNetworkId();
				sound = reader.ReadString();
				isVoiceline = reader.ReadBoolean();
			}

			public void OnReceived()
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				if (!isVoiceline || EnableVoicelines.Value)
				{
					GameObject val = Util.FindNetworkObject(instanceId);
					if (Object.op_Implicit((Object)(object)val))
					{
						Util.PlaySound(sound, val);
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(instanceId);
				writer.Write(sound);
				writer.Write(isVoiceline);
			}
		}

		public class UngroundNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			public UngroundNetMessage(NetworkInstanceId networkInstanceId)
			{
				//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)
				instanceId = networkInstanceId;
			}

			public UngroundNetMessage()
			{
			}

			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)
				instanceId = reader.ReadNetworkId();
			}

			public void OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!((Object)(object)val == (Object)null))
				{
					KinematicCharacterMotor component = val.GetComponent<KinematicCharacterMotor>();
					if (!((Object)(object)component == (Object)null))
					{
						component.ForceUnground(0.1f);
					}
				}
			}

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

		public class ModifyBooleanOfCharacterMotorNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private string boolean;

			private bool value;

			public ModifyBooleanOfCharacterMotorNetMessage(NetworkInstanceId networkInstanceId, string boolean, bool value)
			{
				//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)
				instanceId = networkInstanceId;
				this.boolean = boolean;
				this.value = value;
			}

			public ModifyBooleanOfCharacterMotorNetMessage()
			{
			}

			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)
				instanceId = reader.ReadNetworkId();
				boolean = reader.ReadString();
				value = reader.ReadBoolean();
			}

			public void OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!((Object)(object)val == (Object)null))
				{
					CharacterMotor component = val.GetComponent<CharacterMotor>();
					if (!((Object)(object)component == (Object)null))
					{
						Reflection.SetFieldValue<bool>((object)component, boolean, value);
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(instanceId);
				writer.Write(boolean);
				writer.Write(value);
			}
		}

		public class InstantiateObjectNetMessage : INetMessage, ISerializableObject
		{
			private int id;

			private Vector3 position;

			private Vector3 rotation;

			private Vector3 scale;

			private float time;

			public InstantiateObjectNetMessage(int id, Vector3 position, Vector3 rotation, Vector3 scale, float time = 0f)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: 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)
				this.id = id;
				this.position = position;
				this.rotation = rotation;
				this.scale = scale;
				this.time = time;
			}

			public InstantiateObjectNetMessage()
			{
			}

			public void Deserialize(NetworkReader reader)
			{
				//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_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				id = reader.ReadInt32();
				position = reader.ReadVector3();
				rotation = reader.ReadVector3();
				scale = reader.ReadVector3();
				time = reader.ReadSingle();
			}

			public void OnReceived()
			{
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Object.Instantiate<GameObject>(idToObject[id]);
				val.transform.position = position;
				val.transform.eulerAngles = rotation;
				val.transform.localScale = scale;
				if (time != 0f)
				{
					Object.Destroy((Object)(object)val, time);
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0010: 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_002a: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(id);
				writer.Write(position);
				writer.Write(rotation);
				writer.Write(scale);
				writer.Write(time);
			}
		}

		public class AddBodyEffectNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private int effectId;

			private string effectName;

			private string bone;

			private Vector3 position;

			private bool isLocalSpace;

			private Vector3 scale;

			public AddBodyEffectNetMessage(NetworkInstanceId networkInstanceId, int effectId, string effectName, string bone, Vector3 position, bool isLocalSpace, Vector3 scale)
			{
				//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)
				//IL_0026: 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_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				instanceId = networkInstanceId;
				this.effectId = effectId;
				this.effectName = effectName;
				this.bone = bone;
				this.position = position;
				this.isLocalSpace = isLocalSpace;
				this.scale = scale;
			}

			public AddBodyEffectNetMessage()
			{
			}

			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_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				instanceId = reader.ReadNetworkId();
				effectId = reader.ReadInt32();
				effectName = reader.ReadString();
				bone = reader.ReadString();
				position = reader.ReadVector3();
				isLocalSpace = reader.ReadBoolean();
				scale = reader.ReadVector3();
			}

			public void OnReceived()
			{
				//IL_0013: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				GameObject effectToInstantiate = idToObject[effectId];
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!Object.op_Implicit((Object)(object)val))
				{
					return;
				}
				CharacterBody component = val.GetComponent<CharacterBody>();
				if ((Object)(object)component == (Object)null)
				{
					return;
				}
				Transform modelTransform = component.modelLocator.modelTransform;
				ChildLocator val2 = (Object.op_Implicit((Object)(object)modelTransform) ? ((Component)modelTransform).GetComponent<ChildLocator>() : null);
				if (!((Object)(object)val2 == (Object)null))
				{
					if (bone != null && bone != "" && Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.FindChild(bone)))
					{
						SpawnEffect(effectToInstantiate, position, isLocalSpace, Quaternion.identity, scale, val2.FindChild(bone), effectName);
					}
					else
					{
						SpawnEffect(effectToInstantiate, position, isLocalSpace, Quaternion.identity, scale, modelTransform, effectName);
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: 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_0051: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(instanceId);
				writer.Write(effectId);
				writer.Write(effectName);
				writer.Write(bone);
				writer.Write(position);
				writer.Write(isLocalSpace);
				writer.Write(scale);
			}
		}

		public class SimpleTracerNetMessage : INetMessage, ISerializableObject
		{
			private Vector3 startPosition;

			private Vector3 endPosition;

			private float width;

			private float time;

			public SimpleTracerNetMessage(Vector3 startPosition, Vector3 endPosition, float width = 1f, float time = 0.3f)
			{
				//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)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				this.startPosition = startPosition;
				this.endPosition = endPosition;
				this.width = width;
				this.time = time;
			}

			public SimpleTracerNetMessage()
			{
			}

			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)
				startPosition = reader.ReadVector3();
				endPosition = reader.ReadVector3();
				width = reader.ReadSingle();
				time = reader.ReadSingle();
			}

			public void OnReceived()
			{
				//IL_0002: 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)
				SimpleTracer(startPosition, endPosition, width, time);
			}

			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(startPosition);
				writer.Write(endPosition);
				writer.Write(width);
				writer.Write(time);
			}
		}

		public class LeapNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId networkInstanceId;

			private Vector3 finalPosition;

			public LeapNetMessage(NetworkInstanceId networkInstanceId, Vector3 finalPosition)
			{
				//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)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				this.networkInstanceId = networkInstanceId;
				this.finalPosition = finalPosition;
			}

			public LeapNetMessage()
			{
			}

			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)
				networkInstanceId = reader.ReadNetworkId();
				finalPosition = reader.ReadVector3();
			}

			public void OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(networkInstanceId);
				if (!Object.op_Implicit((Object)(object)val))
				{
					return;
				}
				CharacterBody component = val.GetComponent<CharacterBody>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return;
				}
				SkillLocator skillLocator = component.skillLocator;
				if ((Object)(object)skillLocator == (Object)null)
				{
					return;
				}
				GenericSkill[] allSkills = skillLocator.allSkills;
				foreach (GenericSkill val2 in allSkills)
				{
					if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.stateMachine) && val2.stateMachine.state != null && val2.stateMachine.state is Skills.UltraInstinctFinal)
					{
						(val2.stateMachine.state as Skills.UltraInstinctFinal).LeapGlobal(finalPosition);
						break;
					}
				}
			}

			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(networkInstanceId);
				writer.Write(finalPosition);
			}
		}

		public class TimeScaleChangeNetMessage : INetMessage, ISerializableObject
		{
			public float timeScaleChangeAmount;

			public TimeScaleChangeNetMessage(float value)
			{
				timeScaleChangeAmount = value;
			}

			public TimeScaleChangeNetMessage()
			{
			}

			public void Deserialize(NetworkReader reader)
			{
				timeScaleChangeAmount = reader.ReadSingle();
			}

			public void OnReceived()
			{
				if (timeScaleChangeAmount < 0f)
				{
					timeScaleChangeAmount = -1f / timeScaleChangeAmount;
				}
				Time.timeScale *= timeScaleChangeAmount;
			}

			public void Serialize(NetworkWriter writer)
			{
				writer.Write(timeScaleChangeAmount);
			}
		}

		public class OverhealNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private float amount;

			public OverhealNetMessage(NetworkInstanceId networkInstanceId, float ammount)
			{
				//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)
				instanceId = networkInstanceId;
				amount = ammount;
			}

			public OverhealNetMessage()
			{
			}

			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)
				instanceId = reader.ReadNetworkId();
				amount = reader.ReadSingle();
			}

			public void OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(instanceId);
				if (!((Object)(object)val == (Object)null))
				{
					HealthComponent component = val.GetComponent<HealthComponent>();
					if (!((Object)(object)component == (Object)null))
					{
						Overheal(component, amount);
					}
				}
			}

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

		public class AddBuffNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId instanceId;

			private int buffIndex;

			private int amount;

			private float buffTime;

			public AddBuffNetMessage(NetworkInstanceId networkInstanceId, int buffIndex, int amount, float buffTime)
			{
				//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)
				instanceId = networkInstanceId;
				this.buffIndex = buffIndex;
				this.amount = amount;
				this.buffTime = buffTime;
			}

			public AddBuffNetMessage(NetworkInstanceId networkInstanceId, BuffIndex buffIndex, int amount, float buffTime)
			{
				//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)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected I4, but got Unknown
				instanceId = networkInstanceId;
				this.buffIndex = (int)buffIndex;
				this.amount = amount;
				this.buffTime = buffTime;
			}

			public AddBuffNetMessage(NetworkInstanceId networkInstanceId, BuffDef buffDef, int amount, float buffTime)
			{
				//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)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Expected I4, but got Unknown
				instanceId = networkInstanceId;
				buffIndex = (int)buffDef.buffIndex;
				this.amount = amount;
				this.buffTime = buffTime;
			}

			public AddBuffNetMessage()
			{
			}

			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)
				instanceId = reader.ReadNetworkId();
				buffIndex = reader.ReadInt32();
				amount = reader.ReadInt32();
				buffTime = reader.ReadSingle();
			}

			public void OnReceived()
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				if (!NetworkServer.active)
				{
					return;
				}
				GameObject val = Util.FindNetworkObject(instanceId);
				if ((Object)(object)val == (Object)null)
				{
					return;
				}
				CharacterBody component = val.GetComponent<CharacterBody>();
				if ((Object)(object)component == (Object)null)
				{
					return;
				}
				bool flag = amount <= 0;
				if (flag)
				{
					amount *= -1;
				}
				for (int i = 0; i < amount; i++)
				{
					if (flag)
					{
						component.RemoveBuff((BuffIndex)buffIndex);
					}
					else if (buffTime > 0f)
					{
						component.AddTimedBuff((BuffIndex)buffIndex, buffTime);
					}
					else
					{
						component.AddBuff((BuffIndex)buffIndex);
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(instanceId);
				writer.Write(buffIndex);
				writer.Write(amount);
				writer.Write(buffTime);
			}
		}

		public class AboveMapZoneTracker : MonoBehaviour
		{
			public CharacterBody characterBody;

			public MapZone zone;

			public float timer = 1f;

			public Collider collider;

			public float radius = 1f;

			public void Start()
			{
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				if (!Object.op_Implicit((Object)(object)characterBody))
				{
					characterBody = ((Component)this).GetComponent<CharacterBody>();
				}
				if (!Object.op_Implicit((Object)(object)collider))
				{
					collider = ((Component)this).GetComponent<Collider>();
				}
				Bounds bounds = collider.bounds;
				Vector3 size = ((Bounds)(ref bounds)).size;
				radius = ((Vector3)(ref size)).magnitude / 3f;
			}

			public void FixedUpdate()
			{
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: 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_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
				if (!characterBody.HasBuff(AfterSlam))
				{
					Object.Destroy((Object)(object)this);
					return;
				}
				if (timer >= 0f)
				{
					timer -= Time.fixedDeltaTime;
				}
				bool flag = false;
				Vector3 position = ((Component)this).transform.position;
				Vector3 val = new Vector3(0f, Physics.gravity.y, 0f);
				RaycastHit[] array = Physics.RaycastAll(position, ((Vector3)(ref val)).normalized, 9999f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.collideWithCharacterHullOnly)).mask), (QueryTriggerInteraction)2);
				if (array != null && array.Length != 0)
				{
					RaycastHit[] array2 = array;
					for (int i = 0; i < array2.Length; i++)
					{
						RaycastHit val2 = array2[i];
						MapZone component = ((Component)((RaycastHit)(ref val2)).collider).GetComponent<MapZone>();
						if (Object.op_Implicit((Object)(object)zone) && (Object)(object)zone == (Object)(object)component)
						{
							flag = true;
							break;
						}
					}
				}
				if (!flag)
				{
					Collider[] array3 = Physics.OverlapSphere(((Component)collider).transform.position, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.collideWithCharacterHullOnly)).mask), (QueryTriggerInteraction)2);
					if (array3 != null && array3.Length != 0)
					{
						Collider[] array4 = array3;
						foreach (Collider val3 in array4)
						{
							MapZone component2 = ((Component)val3).GetComponent<MapZone>();
							if (Object.op_Implicit((Object)(object)zone) && (Object)(object)zone == (Object)(object)component2)
							{
								flag = true;
								break;
							}
						}
					}
				}
				if (!flag && timer < 0f)
				{
					characterBody.SetBuffCount(AfterSlam.buffIndex, 0);
					if (Object.op_Implicit((Object)(object)zone))
					{
						zone.TryZoneStart(((Component)characterBody).GetComponent<Collider>());
					}
					Object.Destroy((Object)(object)this);
				}
			}
		}

		public delegate void CodeAfterInstantiating(GameObject gameObject, ChildLocator childLocator, SkillLocator skillLocator, DemoComponent demoComponent);

		public class DemoRunComponent : MonoBehaviour
		{
			public Dictionary<BuffDef, List<CharacterBody>> charactersWithBuffs = new Dictionary<BuffDef, List<CharacterBody>>();

			public void AddBuffBody(BuffDef buffDef, CharacterBody characterBody)
			{
				if (charactersWithBuffs.ContainsKey(buffDef))
				{
					charactersWithBuffs[buffDef].Add(characterBody);
					return;
				}
				charactersWithBuffs.Add(buffDef, new List<CharacterBody>());
				charactersWithBuffs[buffDef].Add(characterBody);
			}

			public void RemoveBuffBody(BuffDef buffDef, CharacterBody characterBody)
			{
				if (charactersWithBuffs.ContainsKey(buffDef))
				{
					charactersWithBuffs[buffDef].Remove(characterBody);
				}
				if (charactersWithBuffs[buffDef].Count <= 0)
				{
					charactersWithBuffs.Remove(buffDef);
				}
			}

			public List<CharacterBody> GetBuffBodies(BuffDef buffDef)
			{
				if (charactersWithBuffs.ContainsKey(buffDef))
				{
					return charactersWithBuffs[buffDef];
				}
				return null;
			}
		}

		public class NuclearSizeIncreaseComponent : MonoBehaviour
		{
			public void OnDestroy()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				Transform transform = ((Component)this).transform;
				transform.localScale /= 1.2f;
				if (emotesEnabled)
				{
					EmoteCompatAbility.EmoteCompatabilityModelPartSizeSet(((Component)this).gameObject, 5f / 6f);
				}
			}
		}

		public class DemoSoundClass
		{
			public string name;

			public string playSoundString;

			public string stopSoundString;

			private NetworkSoundEventDef playSound;

			private NetworkSoundEventDef stopSound;

			public DemoSoundClass(string soundName)
			{
				name = soundName;
				playSoundString = "Play_" + soundName;
				stopSoundString = "Stop_" + soundName;
				playSound = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
				playSound.eventName = playSoundString;
				ContentPacks.sounds.Add(playSound);
				stopSound = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
				stopSound.eventName = stopSoundString;
				ContentPacks.sounds.Add(stopSound);
			}
		}

		public class DemoVoiceline
		{
			public string playString;

			public string stopString;

			public DemoVoiceline(DemoSoundClass demoSoundClass, DemoVoicelineType[] demoVoicelineTypes, int weight)
			{
				playString = demoSoundClass.playSoundString;
				stopString = demoSoundClass.stopSoundString;
				foreach (DemoVoicelineType key in demoVoicelineTypes)
				{
					for (int j = 0; j < weight; j++)
					{
						if (demoVoiceLines.ContainsKey(key))
						{
							demoVoiceLines[key].Add(this);
							continue;
						}
						List<DemoVoiceline> value = new List<DemoVoiceline> { this };
						demoVoiceLines.Add(key, value);
					}
				}
			}
		}

		public enum DemoVoicelineType
		{
			Kill,
			Laugh,
			Taunt,
			TrapKill,
			Landing,
			Intro,
			Death,
			Gameover
		}

		public class DemoTracer : MonoBehaviour
		{
			public float time;

			private float stopwatch;

			private float initialWidth;

			public LineRenderer lineRenderer;

			public void Start()
			{
				if (!Object.op_Implicit((Object)(object)lineRenderer))
				{
					Object.DestroyImmediate((Object)(object)((Component)this).gameObject);
				}
				initialWidth = lineRenderer.endWidth;
			}

			public void Update()
			{
				stopwatch += Time.deltaTime;
				if ((Object)(object)lineRenderer != (Object)null)
				{
					if (stopwatch > time)
					{
						Object.DestroyImmediate((Object)(object)((Component)this).gameObject);
						return;
					}
					float num = stopwatch / time;
					float num2 = initialWidth * (1f - num);
					lineRenderer.SetWidth(num2, num2);
				}
			}
		}

		public enum LanguagePrefixEnum
		{
			Health,
			Damage,
			Healing,
			Utility,
			Void,
			HumanObjective,
			LunarObjective,
			Stack,
			WorldEvent,
			Artifact,
			UserSetting,
			Death,
			Sub,
			Mono,
			Shrine,
			Event,
			Keyword,
			CustomColor
		}

		public class SwordEffectNetMessage : INetMessage, ISerializableObject
		{
			private Vector3 position;

			public SwordEffectNetMessage(Vector3 position)
			{
				//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)
				this.position = position;
			}

			public SwordEffectNetMessage()
			{
			}

			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)
				position = reader.ReadVector3();
			}

			public void OnReceived()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				SpawnEffect(HitEffect, position, localPosition: false, Quaternion.identity, OneVector(0.6f));
			}

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

		public class HudExplosionComponent : MonoBehaviour
		{
			public Transform explosion;

			public Transform pulse;

			public Transform caveIn;

			public float stopwatch = 0f;

			public void Awake()
			{
				ChildLocator component = ((Component)this).GetComponent<ChildLocator>();
				explosion = component.FindChild("Explosion");
				pulse = component.FindChild("Pulse");
				caveIn = component.FindChild("CaveIn");
			}

			public void Update()
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: 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_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				stopwatch += Time.deltaTime;
				if (Object.op_Implicit((Object)(object)explosion))
				{
					explosion.localScale = Vector3.Lerp(Vector3.one, Vector3.zero, stopwatch / 5f);
					if (stopwatch > 5f)
					{
						Object.Destroy((Object)(object)((Component)explosion).gameObject);
					}
				}
				if (Object.op_Implicit((Object)(object)pulse))
				{
					pulse.localScale = Vector3.Lerp(Vector3.zero, OneVector(32f), stopwatch);
					if (stopwatch > 1f)
					{
						Object.Destroy((Object)(object)((Component)pulse).gameObject);
					}
				}
				if (Object.op_Implicit((Object)(object)caveIn))
				{
					caveIn.localScale = Vector3.Lerp(Vector3.one, Vector3.zero, stopwatch / 0.2f);
					if (stopwatch > 0.2f)
					{
						Object.Destroy((Object)(object)((Component)caveIn).gameObject);
					}
				}
			}
		}

		public class SuckSphereComponent : MonoBehaviour
		{
			public float suckPower = 6f;

			public CharacterBody ownerBody;

			public Dictionary<Collider, CharacterBody> keyValuePairs = new Dictionary<Collider, CharacterBody>();

			public void OnTriggerStay(Collider collider)
			{
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_011f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: 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)
				if (!Object.op_Implicit((Object)(object)ownerBody))
				{
					return;
				}
				CharacterBody value = null;
				if (!keyValuePairs.TryGetValue(collider, out value))
				{
					value = ((Component)collider).GetComponent<CharacterBody>();
					keyValuePairs.Add(collider, value);
				}
				if (Object.op_Implicit((Object)(object)value) && Object.op_Implicit((Object)(object)ownerBody.teamComponent) && Object.op_Implicit((Object)(object)value.teamComponent) && ownerBody.teamComponent.teamIndex != value.teamComponent.teamIndex)
				{
					Vector3 val = ((Component)this).transform.position - value.corePosition;
					Vector3 normalized = ((Vector3)(ref val)).normalized;
					if (Object.op_Implicit((Object)(object)value.characterMotor))
					{
						CharacterMotor characterMotor = value.characterMotor;
						characterMotor.rootMotion += normalized * suckPower * Time.fixedDeltaTime;
					}
					else if (Object.op_Implicit((Object)(object)value.rigidbody))
					{
						value.rigidbody.AddForce(normalized * suckPower * Time.fixedDeltaTime, (ForceMode)2);
					}
				}
			}
		}

		public class HitHelper : MonoBehaviour
		{
			private TeamFilter filter;

			private ProjectileExplosion projectileExplosion;

			private StickyComponent stickyComponent;

			private void Start()
			{
				filter = ((Component)this).GetComponent<TeamFilter>();
				stickyComponent = ((Component)this).GetComponent<StickyComponent>();
			}

			private void OnTriggerEnter(Collider other)
			{
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				HurtBox component = ((Component)other).GetComponent<HurtBox>();
				bool num;
				if ((other is MeshCollider && !((MeshCollider)((other is MeshCollider) ? other : null)).convex) || !Object.op_Implicit((Object)(object)stickyComponent))
				{
					if (!Object.op_Implicit((Object)(object)filter) || !Object.op_Implicit((Object)(object)component))
					{
						return;
					}
					num = filter.teamIndex != component.healthComponent.body.teamComponent.teamIndex;
				}
				else
				{
					num = !stickyComponent.sticked;
				}
				if (num)
				{
					((Component)this).transform.position = other.ClosestPoint(((Component)this).transform.position);
				}
			}
		}

		public class WorldToScreenPosition : MonoBehaviour
		{
			public void Awake()
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				Camera main = Camera.main;
				((Component)this).transform.position = main.WorldToScreenPoint(((Component)this).transform.position);
			}
		}

		public class DemoProjectileContradictGravity : MonoBehaviour
		{
			public Rigidbody rigidbody;

			public static float contradictValue = 0.2f;

			public void Awake()
			{
				rigidbody = ((Component)this).GetComponent<Rigidbody>();
			}

			public void Start()
			{
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)rigidbody) && rigidbody.useGravity)
				{
					Rigidbody obj = rigidbody;
					obj.velocity += Physics.gravity * contradictValue * -1f;
				}
			}
		}

		public class DemoConfigProjectile : MonoBehaviour
		{
			public Rigidbody rigidbody;

			public ProjectileSimple projectileSimple;

			public int speedConfigId;

			public int grabityConfigId;

			public void Start()
			{
				rigidbody = ((Component)this).GetComponent<Rigidbody>();
				projectileSimple = ((Component)this).GetComponent<ProjectileSimple>();
				if (Object.op_Implicit((Object)(object)rigidbody))
				{
					rigidbody.useGravity = (Main.networkConfigs[grabityConfigId] as NetworkConfig<bool>).Value;
				}
				if (Object.op_Implicit((Object)(object)projectileSimple))
				{
					projectileSimple.SetForwardSpeed((Main.networkConfigs[speedConfigId] as NetworkConfig<float>).Value);
				}
			}
		}

		public class ClusterRocketComponent : MonoBehaviour
		{
			public ProjectileDamage projectileDamage;

			public void Awake()
			{
				projectileDamage = ((Component)this).GetComponent<ProjectileDamage>();
			}

			public void OnDestroy()
			{
			}
		}

		public class DemoExplosionComponent : MonoBehaviour
		{
			private ProjectileExplosion explosion;

			private float radius;

			private Vector3 explosionPosition;

			public float selfPower = 4f;

			public float enemyPower = 1f;

			private List<CharacterBody> bodyList = new List<CharacterBody>();

			private List<GameObject> nearbyExplosions = new List<GameObject>();

			private TeamFilter teamFilter;

			private TeamIndex teamIndex;

			private GameObject explosionCentre;

			private GameObject owner;

			private Rigidbody rigidbody;

			private ProjectileController projectileController;

			private CharacterBody ownerBody;

			public void Start()
			{
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: 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)
				projectileController = ((Component)this).GetComponent<ProjectileController>();
				owner = (Object.op_Implicit((Object)(object)projectileController) ? projectileController.owner : null);
				explosion = ((Component)this).GetComponent<ProjectileExplosion>();
				if (!Object.op_Implicit((Object)(object)explosion))
				{
					Object.Destroy((Object)(object)this);
				}
				teamFilter = ((Component)this).GetComponent<TeamFilter>();
				rigidbody = ((Component)this).GetComponent<Rigidbody>();
				ownerBody = (Object.op_Implicit((Object)(object)owner) ? owner.GetComponent<CharacterBody>() : null);
				if (Object.op_Implicit((Object)(object)ownerBody) && ownerBody.HasBuff(AfterSlam))
				{
					Rigidbody obj = rigidbody;
					obj.velocity += (Object.op_Implicit((Object)(object)ownerBody.characterMotor) ? ownerBody.characterMotor.velocity : ownerBody.rigidbody.velocity);
				}
				explosion.OnProjectileExplosion = OnProjectileExplosion;
			}

			public void OnProjectileExplosion(BlastAttack blastAttack, Result result)
			{
			}

			public void OnDisable()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Expected O, but got I4
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045->IL0045: Incompatible stack types: O vs I4
				//IL_003a->IL0045: Incompatible stack types: I4 vs O
				//IL_003a->IL0045: Incompatible stack types: O vs I4
				explosionPosition = ((Component)this).transform.position;
				radius = explosion.blastRadius * 1.35f;
				object obj = this;
				int num;
				if (Object.op_Implicit((Object)(object)teamFilter))
				{
					obj = teamFilter.teamIndex;
					num = (int)obj;
				}
				else
				{
					num = -1;
					obj = num;
					num = (int)obj;
				}
				((DemoExplosionComponent)num).teamIndex = (TeamIndex)obj;
			}

			public void OnDestroy()
			{
				//IL_0002: 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_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Unknown result type (might be due to invalid IL or missing references)
				//IL_0145: Unknown result type (might be due to invalid IL or missing references)
				//IL_0150: 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_015f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0163: Unknown result type (might be due to invalid IL or missing references)
				//IL_017c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0182: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_020a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0210: Unknown result type (might be due to invalid IL or missing references)
				//IL_0238: Unknown result type (might be due to invalid IL or missing references)
				//IL_0240: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Unknown result type (might be due to invalid IL or missing references)
				//IL_021f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0224: Unknown result type (might be due to invalid IL or missing references)
				//IL_0227: Unknown result type (might be due to invalid IL or missing references)
				//IL_0231: Unknown result type (might be due to invalid IL or missing references)
				//IL_0245: Unknown result type (might be due to invalid IL or missing references)
				//IL_024a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0256: Unknown result type (might be due to invalid IL or missing references)
				//IL_025c: Unknown result type (might be due to invalid IL or missing references)
				Collider[] array = Physics.OverlapSphere(explosionPosition, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)0);
				Collider[] array2 = array;
				foreach (Collider val in array2)
				{
					CharacterBody item = (Object.op_Implicit((Object)(object)((Component)val).GetComponent<HurtBox>()) ? ((Component)val).GetComponent<HurtBox>().healthComponent.body : null);
					if (!bodyList.Contains(item))
					{
						bodyList.Add(item);
					}
				}
				foreach (CharacterBody body in bodyList)
				{
					CharacterMotor characterMotor = body.characterMotor;
					if (Object.op_Implicit((Object)(object)body.characterMotor))
					{
						if (body.characterMotor.velocity.y < 0f)
						{
							body.characterMotor.velocity.y = 0f;
						}
						Vector3 val2 = ((Object.op_Implicit((Object)(object)body.hurtBoxGroup) && Object.op_Implicit((Object)(object)body.hurtBoxGroup.mainHurtBox)) ? ((Component)body.hurtBoxGroup.mainHurtBox).transform.position : body.corePosition);
						Vector3 val3 = val2 - explosionPosition;
						Vector3 val4 = ((Vector3)(ref val3)).normalized * radius * 1.35f;
						val4.y /= 2f;
						if (body.teamComponent.teamIndex == teamIndex && Object.op_Implicit((Object)(object)body.inputBank) && body.inputBank.jump.down)
						{
							val4 = Vector3.RotateTowards(val4, body.inputBank.aimDirection, 360f, 0f);
						}
						if (Object.op_Implicit((Object)(object)((BaseCharacterController)characterMotor).Motor))
						{
							((BaseCharacterController)characterMotor).Motor.ForceUnground(0f);
						}
						CharacterMotor characterMotor2 = body.characterMotor;
						characterMotor2.velocity += ((body.teamComponent.teamIndex == teamIndex) ? (val4 * selfPower) : (val4 * enemyPower / Vector3.Distance(val2, explosionPosition)));
						if (body.teamComponent.teamIndex == teamIndex && NetworkServer.active)
						{
							body.AddBuff(VelocityPreserve);
						}
						body.characterMotor.disableAirControlUntilCollision = true;
					}
				}
			}
		}

		public class NukeComponent : MonoBehaviour
		{
			private GameObject owner;

			public void Start()
			{
				owner = ((Component)this).GetComponent<ProjectileController>()?.owner;
			}

			public void OnDestroy()
			{
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				bool flag = Util.CheckRoll(10f, 0f, (CharacterMaster)null);
				while (flag)
				{
					Chat.AddMessage("");
				}
				foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList)
				{
					if (readOnlyInstances.healthComponent.alive)
					{
						readOnlyInstances.healthComponent.Suicide(owner, owner, default(DamageTypeCombo));
					}
					else
					{
						Object.Destroy((Object)(object)((Component)readOnlyInstances).gameObject);
					}
				}
			}
		}

		public class HookNetMessage : INetMessage, ISerializableObject
		{
			private NetworkInstanceId hookObject;

			private bool sticked;

			private bool stickedToBody;

			private float speed;

			private float dist;

			private NetworkInstanceId stickedBody;

			public HookNetMessage()
			{
			}

			public HookNetMessage(NetworkInstanceId networkInstanceId, bool sticked, bool stickedToBody, float speed, float dist, NetworkInstanceId networkInstanceId1)
			{
				//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)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				hookObject = networkInstanceId;
				this.sticked = sticked;
				this.stickedToBody = stickedToBody;
				this.speed = speed;
				this.dist = dist;
				stickedBody = networkInstanceId1;
			}

			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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				hookObject = reader.ReadNetworkId();
				sticked = reader.ReadBoolean();
				stickedToBody = reader.ReadBoolean();
				speed = reader.ReadSingle();
				dist = reader.ReadSingle();
				stickedBody = reader.ReadNetworkId();
			}

			public void OnReceived()
			{
				//IL_0013: 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)
				if (NetworkServer.active)
				{
					return;
				}
				GameObject val = Util.FindNetworkObject(hookObject);
				if (!Object.op_Implicit((Object)(object)val))
				{
					return;
				}
				HookComponent component = val.GetComponent<HookComponent>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return;
				}
				component.sticked = sticked;
				component.isStickedAnEnemy = stickedToBody;
				component.speed = speed;
				component.dist = dist;
				GameObject val2 = Util.FindNetworkObject(stickedBody);
				if (Object.op_Implicit((Object)(object)val2))
				{
					CharacterBody component2 = val2.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component2))
					{
						component.stickedBody = component2;
					}
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0003: 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)
				writer.Write(hookObject);
				writer.Write(sticked);
				writer.Write(stickedToBody);
				writer.Write(speed);
				writer.Write(dist);
				writer.Write(stickedBody);
			}
		}

		public class PlaySound : MonoBehaviour
		{
			public string soundAtAwake;

			public string soundAtDestroy;

			public void Awake()
			{
				if (soundAtAwake != "")
				{
					Util.PlaySound(soundAtAwake, ((Component)this).gameObject);
				}
			}

			public void OnDestroy()
			{
				if (soundAtDestroy != "")
				{
					Util.PlaySound(soundAtDestroy, ((Component)this).gameObject);
				}
			}
		}

		public class HookComponent : NetworkBehaviour
		{
			private EntityStateMachine currentStateMachine;

			public SerializableEntityStateType seekerState;

			private Type stateType;

			private Rigidbody rigidbody;

			public Transform ropeStart;

			public Transform ropeEnd;

			private GameObject owner;

			private CharacterMotor characterMotor;

			private InputBankTest inputBankTest;

			public bool sticked = false;

			private Vector3 previousAimDirection = Vector3.zero;

			public bool isStickedAnEnemy = false;

			public CharacterBody stickedBody;

			private GameObject hookedRotator;

			private GameObject hookedObject;

			private SkillLocator skillLocator;

			public float dist = 0f;

			public float speed = 24f;

			public void Start()
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Expected O, but got Unknown
				foreach (Transform item in ((Component)this).transform)
				{
					Transform val = item;
					if (((Object)((Component)val).gameObject).name.ToLower().Contains("start"))
					{
						ropeStart = val;
					}
					if (((Object)((Component)val).gameObject).name.ToLower().Contains("end"))
					{
						ropeEnd = val;
					}
				}
				rigidbody = ((Component)this).GetComponent<Rigidbody>();
				owner = ((Component)this).GetComponent<ProjectileController>().owner;
				skillLocator = (Object.op_Implicit((Object)(object)owner) ? owner.GetComponent<SkillLocator>() : null);
				if (Object.op_Implicit((Object)(object)ropeEnd))
				{
					ropeEnd.SetParent(owner.transform);
				}
				characterMotor = (Object.op_Implicit((Object)(object)owner) ? owner.GetComponent<CharacterMotor>() : null);
				inputBankTest = (Object.op_Implicit((Object)(object)owner) ? owner.GetComponent<InputBankTest>() : null);
				if (!Object.op_Implicit((Object)(object)skillLocator))
				{
					return;
				}
				GenericSkill[] allSkills = skillLocator.allSkills;
				foreach (GenericSkill val2 in allSkills)
				{
					if (Object.op_Implicit((Object)(object)val2.stateMachine) && val2.stateMachine.state != null && ((object)val2.stateMachine.state).GetType() == ((SerializableEntityStateType)(ref seekerState)).stateType)
					{
						currentStateMachine = val2.stateMachine;
						break;
					}
				}
				if (!Object.op_Implicit((Object)(object)currentStateMachine))
				{
					Object.Destroy((Object)(object)this);
				}
			}

			public void FixedUpdate()
			{
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: 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_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_0080: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_00fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0124: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: 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_0222: Unknown result type (might be due to invalid IL or missing references)
				//IL_0232: Unknown result type (might be due to invalid IL or missing references)
				//IL_0237: Unknown result type (might be due to invalid IL or missing references)
				//IL_023c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0244: Unknown result type (might be due to invalid IL or missing references)
				//IL_024b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0252: Unknown result type (might be due to invalid IL or missing references)
				//IL_025c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0261: Unknown result type (might be due to invalid IL or missing references)
				//IL_0268: Unknown result type (might be due to invalid IL or missing references)
				//IL_026d: 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_0277: Unknown result type (might be due to invalid IL or missing references)
				//IL_017e: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)currentStateMachine) && ((object)currentStateMachine.state).GetType() == ((SerializableEntityStateType)(ref seekerState)).stateType)
				{
					if (!sticked)
					{
						return;
					}
					Vector3 val = (Object.op_Implicit((Object)(object)inputBankTest) ? inputBankTest.aimDirection : Vector3.zero);
					Vector3 val2 = inputBankTest.aimDirection - previousAimDirection;
					previousAimDirection = val;
					if (isStickedAnEnemy && Object.op_Implicit((Object)(object)inputBankTest) && Object.op_Implicit((Object)(object)stickedBody) && !stickedBody.isChampion)
					{
						Vector3 val3 = inputBankTest.aimOrigin + inputBankTest.aimDirection * dist - stickedBody.transform.position;
						if (Object.op_Implicit((Object)(object)stickedBody.characterMotor))
						{
							stickedBody.characterMotor.velocity = val3 * 4f;
							if (stickedBody.characterMotor.isGrounded && Object.op_Implicit((Object)(object)((BaseCharacterController)stickedBody.characterMotor).Motor))
							{
								if (stickedBody.isPlayerControlled)
								{
									NetMessageExtensions.Send((INetMessage)(object)new UngroundNetMessage(((NetworkBehaviour)stickedBody).netId), (NetworkDestination)1);
								}
								else
								{
									((BaseCharacterController)stickedBody.characterMotor).Motor.ForceUnground(0.1f);
								}
							}
						}
						else if (Object.op_Implicit((Object)(object)stickedBody.rigidbody))
						{
							stickedBody.rigidbody.velocity = val3 * 4f;
						}
					}
					else if ((!isStickedAnEnemy || stickedBody.isChampion) && Object.op_Implicit((Object)(object)characterMotor))
					{
						Vector3 val4 = ((Component)this).transform.position - owner.transform.position;
						characterMotor.velocity = val4 / 2f + (((Vector3)(ref val4)).normalized * 6f + val * speed);
					}
				}
				else
				{
					Object.Destroy((Object)(object)this);
				}
			}

			public void OnDestroy()
			{
				if (Object.op_Implicit((Object)(object)hookedRotator))
				{
					Object.Destroy((Object)(object)hookedRotator);
				}
				if (Object.op_Implicit((Object)(object)ropeEnd))
				{
					Object.Destroy((Object)(object)((Component)ropeEnd).gameObject);
				}
				if (Object.op_Implicit((Object)(object)((Component)this).gameObject))
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}

			public void LateUpdate()
			{
				//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)
				if (Object.op_Implicit((Object)(object)hookedRotator) && Object.op_Implicit((Object)(object)inputBankTest))
				{
					hookedRotator.transform.rotation = Quaternion.LookRotation(inputBankTest.aimDirection);
				}
			}

			public void OnCollisionEnter(Collision collision)
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: 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_0056: 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 reference

plugins/NetworkConfigsAPI.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using HG.Reflection;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.UI;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.UI;
using UnityEngine.Events;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NetworkConfigsAPI")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+466516093e029d639115628584608bac9b34ffa1")]
[assembly: AssemblyProduct("NetworkConfigsAPI")]
[assembly: AssemblyTitle("NetworkConfigsAPI")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NetworkConfigs
{
	[Serializable]
	[BepInPlugin("com.brynzananas.networkconfigsapi", "Network Configs API", "1.0.0")]
	[BepInDependency("com.bepis.r2api", "5.0.10")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public struct ModMetaData
		{
			public string Guid;

			public string Name;
		}

		public delegate void OnConfigApplied(int configId, INetworkConfig networkConfig);

		public interface INetworkConfig
		{
			int id { get; set; }

			OnConfigApplied OnConfigApplied { get; set; }

			Type parameterType { get; }
		}

		public class NetworkConfig<T> : INetworkConfig
		{
			public NetworkConfig<bool> enableConfig;

			public ConfigEntry<T> configEntry;

			private T configValue;

			private OnConfigApplied onConfigApplied;

			public int configId;

			public T Value
			{
				get
				{
					if (enableConfig != null && !enableConfig.Value)
					{
						return DefaultValue;
					}
					return configValue;
				}
				set
				{
					configValue = value;
				}
			}

			public T DefaultValue => (T)((ConfigEntryBase)configEntry).DefaultValue;

			public Type parameterType => typeof(T);

			public OnConfigApplied OnConfigApplied
			{
				get
				{
					return onConfigApplied;
				}
				set
				{
					onConfigApplied = value;
				}
			}

			public int id
			{
				get
				{
					return configId;
				}
				set
				{
					configId = value;
				}
			}
		}

		public class RequestSyncConfigsNetMessage : INetMessage, ISerializableObject
		{
			public void Deserialize(NetworkReader reader)
			{
			}

			public void OnReceived()
			{
				SetConfigValues();
			}

			public void Serialize(NetworkWriter writer)
			{
			}
		}

		public class SyncConfigsNetMessage : INetMessage, ISerializableObject
		{
			private int configId;

			private string input;

			public SyncConfigsNetMessage(int id, string input)
			{
				configId = id;
				this.input = input;
			}

			public SyncConfigsNetMessage()
			{
			}

			public void Deserialize(NetworkReader reader)
			{
				configId = reader.ReadInt32();
				input = reader.ReadString();
			}

			public void OnReceived()
			{
				INetworkConfig networkConfig = networkConfigs[configId];
				if (networkConfig.parameterType == typeof(float))
				{
					NetworkConfig<float> networkConfig2 = networkConfig as NetworkConfig<float>;
					networkConfig2.Value = float.Parse(input);
					if (!NetworkServer.active)
					{
						ConfigEntry<float> configEntry = networkConfig2.configEntry;
						configEntry.Value += 1f;
						ConfigEntry<float> configEntry2 = networkConfig2.configEntry;
						configEntry2.Value -= 1f;
					}
				}
				if (networkConfig.parameterType == typeof(int))
				{
					NetworkConfig<int> networkConfig3 = networkConfig as NetworkConfig<int>;
					networkConfig3.Value = int.Parse(input);
					if (!NetworkServer.active)
					{
						ConfigEntry<int> configEntry3 = networkConfig3.configEntry;
						configEntry3.Value += 1;
						ConfigEntry<int> configEntry4 = networkConfig3.configEntry;
						configEntry4.Value -= 1;
					}
				}
				if (networkConfig.parameterType == typeof(bool))
				{
					NetworkConfig<bool> networkConfig4 = networkConfig as NetworkConfig<bool>;
					networkConfig4.Value = bool.Parse(input);
					if (!NetworkServer.active)
					{
						networkConfig4.configEntry.Value = !networkConfig4.configEntry.Value;
						networkConfig4.configEntry.Value = !networkConfig4.configEntry.Value;
					}
				}
				if (networkConfig.OnConfigApplied != null)
				{
					networkConfig.OnConfigApplied(configId, networkConfig);
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				writer.Write(configId);
				writer.Write(input);
			}
		}

		public const string ModGuid = "com.brynzananas.networkconfigsapi";

		public const string ModName = "Network Configs API";

		public const string ModVer = "1.0.0";

		public static bool riskOfOptionsLoaded = false;

		public static ConfigFile ConfigMain;

		public static Dictionary<string, List<INetworkConfig>> modConfigs = new Dictionary<string, List<INetworkConfig>>();

		public static List<INetworkConfig> networkConfigs = new List<INetworkConfig>();

		public void Awake()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			ConfigMain = ((BaseUnityPlugin)this).Config;
			NetworkingAPI.RegisterMessageType<SyncConfigsNetMessage>();
			NetworkingAPI.RegisterMessageType<RequestSyncConfigsNetMessage>();
			riskOfOptionsLoaded = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
			Run.Start += new hook_Start(Run_Start);
			RoR2Application.OnLoad += new hook_OnLoad(RoR2Application_OnLoad);
			CharacterSelectController.OnEnable += new hook_OnEnable(CharacterSelectController_OnEnable);
		}

		private void CharacterSelectController_OnEnable(orig_OnEnable orig, CharacterSelectController self)
		{
			SetConfigValues();
			orig.Invoke(self);
		}

		private IEnumerator RoR2Application_OnLoad(orig_OnLoad orig, RoR2Application self)
		{
			SetConfigValues();
			return orig.Invoke(self);
		}

		public static void CreateResetToDefaultButtonInRiskOfOptionsConfigMenu(string name, string category, string description, string buttonText)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			ModMetaData modMetaData = Assembly.GetCallingAssembly().GetModMetaData();
			ModSettingsManager.AddOption((BaseOption)new GenericButtonOption(name, category, description, buttonText, new UnityAction(OnButtonPressed)), modMetaData.Guid, modMetaData.Name);
			void OnButtonPressed()
			{
				if (modConfigs.ContainsKey(modMetaData.Guid))
				{
					foreach (INetworkConfig item in modConfigs[modMetaData.Guid])
					{
						if (item.parameterType == typeof(float))
						{
							NetworkConfig<float> networkConfig = (NetworkConfig<float>)item;
							networkConfig.configEntry.Value = networkConfig.DefaultValue;
							networkConfig.Value = networkConfig.DefaultValue;
						}
						if (item.parameterType == typeof(int))
						{
							NetworkConfig<int> networkConfig2 = (NetworkConfig<int>)item;
							networkConfig2.configEntry.Value = networkConfig2.DefaultValue;
							networkConfig2.Value = networkConfig2.DefaultValue;
						}
						if (item.parameterType == typeof(bool))
						{
							NetworkConfig<bool> networkConfig3 = (NetworkConfig<bool>)item;
							networkConfig3.configEntry.Value = networkConfig3.DefaultValue;
							networkConfig3.Value = networkConfig3.DefaultValue;
						}
					}
				}
			}
		}

		public static NetworkConfig<T> CreateConfig<T>(ConfigFile configFile, string section, string key, T defaultValue, string description, OnConfigApplied onConfigApplied = null, NetworkConfig<bool> enableConfig = null, bool generateRiskOfOptionsOption = true)
		{
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Expected O, but got Unknown
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Expected O, but got Unknown
			NetworkConfig<T> networkConfig = new NetworkConfig<T>();
			networkConfig.id = networkConfigs.Count;
			networkConfig.enableConfig = enableConfig;
			networkConfig.OnConfigApplied = onConfigApplied;
			networkConfig.configEntry = configFile.Bind<T>(section, key, defaultValue, description);
			networkConfig.configEntry.SettingChanged += ConfigEntry_SettingChanged;
			networkConfigs.Add(networkConfig);
			ModMetaData modMetaData = Assembly.GetCallingAssembly().GetModMetaData();
			if (modConfigs.ContainsKey(modMetaData.Guid))
			{
				modConfigs[modMetaData.Guid].Add(networkConfig);
			}
			else
			{
				List<INetworkConfig> list = new List<INetworkConfig>();
				list.Add(networkConfig);
				modConfigs.Add(modMetaData.Guid, list);
			}
			if (riskOfOptionsLoaded && generateRiskOfOptionsOption)
			{
				if (defaultValue is float)
				{
					ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(networkConfig.configEntry as ConfigEntry<float>), modMetaData.Guid, modMetaData.Name);
				}
				if (defaultValue is int)
				{
					ModSettingsManager.AddOption((BaseOption)new IntFieldOption(networkConfig.configEntry as ConfigEntry<int>), modMetaData.Guid, modMetaData.Name);
				}
				if (defaultValue is bool)
				{
					ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(networkConfig.configEntry as ConfigEntry<bool>), modMetaData.Guid, modMetaData.Name);
				}
			}
			return networkConfig;
		}

		private static void ConfigEntry_SettingChanged(object sender, EventArgs e)
		{
			SetConfigValues();
		}

		private void Run_Start(orig_Start orig, Run self)
		{
			orig.Invoke(self);
			if (NetworkServer.active)
			{
				SetConfigValues();
			}
			else
			{
				NetMessageExtensions.Send((INetMessage)(object)new RequestSyncConfigsNetMessage(), (NetworkDestination)2);
			}
		}

		public static void SetConfigValues()
		{
			if (!NetworkServer.active)
			{
				return;
			}
			foreach (INetworkConfig networkConfig in networkConfigs)
			{
				if (networkConfig.parameterType == typeof(float))
				{
					NetMessageExtensions.Send((INetMessage)(object)new SyncConfigsNetMessage(networkConfigs.IndexOf(networkConfig), (networkConfig as NetworkConfig<float>).configEntry.Value.ToString()), (NetworkDestination)1);
				}
				if (networkConfig.parameterType == typeof(int))
				{
					NetMessageExtensions.Send((INetMessage)(object)new SyncConfigsNetMessage(networkConfigs.IndexOf(networkConfig), (networkConfig as NetworkConfig<int>).configEntry.Value.ToString()), (NetworkDestination)1);
				}
				if (networkConfig.parameterType == typeof(bool))
				{
					NetMessageExtensions.Send((INetMessage)(object)new SyncConfigsNetMessage(networkConfigs.IndexOf(networkConfig), (networkConfig as NetworkConfig<bool>).configEntry.Value.ToString()), (NetworkDestination)1);
				}
			}
		}
	}
	public static class Extension
	{
		internal static Main.ModMetaData GetModMetaData(this Assembly assembly)
		{
			Main.ModMetaData result = default(Main.ModMetaData);
			Type[] exportedTypes = assembly.GetExportedTypes();
			Type[] array = exportedTypes;
			foreach (Type element in array)
			{
				BepInPlugin customAttribute = ((MemberInfo)element).GetCustomAttribute<BepInPlugin>();
				if (customAttribute != null)
				{
					result.Guid = customAttribute.GUID;
					result.Name = customAttribute.Name;
				}
			}
			return result;
		}
	}
}