Decompiled source of KatsurosStuff v1.0.1

KatsurosStuff.dll

Decompiled 9 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
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.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.MinorConstruct;
using HG.Reflection;
using IL.RoR2.Orbs;
using KatsurosStuff.Equipment;
using KatsurosStuff.Items;
using KatsurosStuff.VFX;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.MinorConstruct;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("KatsurosStuff")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("KatsurosStuff")]
[assembly: AssemblyTitle("KatsurosStuff")]
[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 KatsurosStuff
{
	[BepInPlugin("HIFU.KatsurosStuff", "KatsurosStuff", "1.0.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "HIFU.KatsurosStuff";

		public const string PluginAuthor = "HIFU";

		public const string PluginName = "KatsurosStuff";

		public const string PluginVersion = "1.0.0";

		public static ConfigFile config;

		public List<ItemBase> Items = new List<ItemBase>();

		public List<EquipmentBase> Equipments = new List<EquipmentBase>();

		public static ManualLogSource ModLogger;

		public Shader hgStandard;

		public static ModdedDamageType soulstealerDamageType = DamageAPI.ReserveDamageType();

		public static ModdedDamageType axeDamageType = DamageAPI.ReserveDamageType();

		public static AssetBundle assetBundle;

		public static GameObject questionMarkModel = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion();

		public static Material questionMarkMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Mystery/matQuestionMark.mat").WaitForCompletion();

		public static GameObject whiteModel;

		public static GameObject greenModel;

		public static GameObject redModel;

		public static GameObject voidModel;

		private void OwO()
		{
		}

		private void Awake()
		{
			//IL_0021: 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_005d: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			ModLogger = ((BaseUnityPlugin)this).Logger;
			whiteModel = CreateRecolor(new Color32((byte)217, (byte)234, (byte)234, byte.MaxValue));
			greenModel = CreateRecolor(new Color32((byte)26, (byte)175, (byte)66, byte.MaxValue));
			redModel = CreateRecolor(new Color32((byte)181, (byte)52, (byte)52, byte.MaxValue));
			voidModel = CreateRecolor(new Color32((byte)209, (byte)73, byte.MaxValue, byte.MaxValue));
			assetBundle = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("KatsurosStuff.dll", "katsurosstuff"));
			config = new ConfigFile(Paths.ConfigPath + "\\HIFU.KatsurosStuff.cfg", true);
			hgStandard = Addressables.LoadAssetAsync<Shader>((object)"RoR2/Base/Shaders/HGStandard.shader").WaitForCompletion();
			Start.Init();
			GlobalEventManager.OnInteractionsGlobal += GlobalEventManager_OnInteractionsGlobal;
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type;
			foreach (Type item in enumerable)
			{
				ItemBase itemBase = (ItemBase)Activator.CreateInstance(item);
				if (ValidateItem(itemBase, Items))
				{
					itemBase.Init(config);
				}
			}
			IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase))
				select type;
			foreach (Type item2 in enumerable2)
			{
				EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item2);
				if (ValidateEquipment(equipmentBase, Equipments))
				{
					equipmentBase.Init(config);
				}
			}
		}

		private GameObject CreateRecolor(Color32 color)
		{
			//IL_003b: 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)
			GameObject val = PrefabAPI.InstantiateClone(questionMarkModel, "Katsuro Question Mark", false);
			Transform val2 = val.transform.Find("mdlQuestionMark");
			MeshRenderer component = ((Component)val2).GetComponent<MeshRenderer>();
			Material val3 = Object.Instantiate<Material>(questionMarkMaterial);
			val3.SetColor("_Color", Color32.op_Implicit(color));
			((Renderer)component).material = val3;
			return val;
		}

		private void GlobalEventManager_OnInteractionsGlobal(Interactor interactor, IInteractable interactable, GameObject interactableObject)
		{
			if (Object.op_Implicit((Object)(object)interactor) && Object.op_Implicit((Object)(object)interactableObject) && IsBarrel(interactableObject))
			{
				((MonoBehaviour)interactor).StartCoroutine(Kill(interactableObject));
			}
		}

		private IEnumerator Kill(GameObject gameObject)
		{
			yield return (object)new WaitForSeconds(2f);
			NetworkServer.Destroy(gameObject);
		}

		private bool IsBarrel(GameObject gameObject)
		{
			return Object.op_Implicit((Object)(object)gameObject.GetComponent<BarrelInteraction>());
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			bool value = config.Bind<bool>("Item: " + item.ConfigName, "Enable Item?", true, "Should this item appear in runs?").Value;
			bool value2 = config.Bind<bool>("Item: " + item.ConfigName, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value;
			if (value)
			{
				itemList.Add(item);
				if (value2)
				{
					item.AIBlacklisted = true;
				}
			}
			return value;
		}

		public bool ValidateEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList)
		{
			if (config.Bind<bool>("Equipment: " + equipment.EquipmentName, "Enable Equipment?", true, "Should this equipment appear in runs?").Value)
			{
				equipmentList.Add(equipment);
				return true;
			}
			return false;
		}
	}
}
namespace KatsurosStuff.VFX
{
	public static class Axe
	{
		public static GameObject ghostPrefab;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			ghostPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Saw/SawmerangGhost.prefab").WaitForCompletion(), "Axe Ghost", false);
			Transform transform = ghostPrefab.transform;
			Transform val = transform.Find("Mesh");
			((Component)val).transform.localScale = Vector3.one * 0.15f;
			MeshFilter component = ((Component)val).GetComponent<MeshFilter>();
			component.mesh = Addressables.LoadAssetAsync<Mesh>((object)"RoR2/Base/LaserTurbine/mdlLaserDisk.fbx").WaitForCompletion();
			MeshRenderer component2 = ((Component)val).GetComponent<MeshRenderer>();
			((Renderer)component2).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/TrimSheets/matTrimSheetMetalGolden.mat").WaitForCompletion();
			Transform val2 = val.Find("mdlVFXDonut2");
			MeshRenderer component3 = ((Component)val2).GetComponent<MeshRenderer>();
			Material val3 = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/EliteVoid/matVoidInfestorTrail.mat").WaitForCompletion();
			((Renderer)component3).materials[0] = val3;
			Transform val4 = val.Find("Trail");
			TrailRenderer component4 = ((Component)val4).GetComponent<TrailRenderer>();
			((Renderer)component4).material = val3;
			Transform val5 = val.Find("Trail (1)");
			TrailRenderer component5 = ((Component)val5).GetComponent<TrailRenderer>();
			((Renderer)component5).material = val3;
		}
	}
	public static class BottleOpener
	{
		public static GameObject prefab;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			prefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab").WaitForCompletion(), "Bottle Opener Impact", false);
			EffectComponent component = prefab.GetComponent<EffectComponent>();
			component.applyScale = true;
			component.soundName = "Play_UI_menuHover";
			ContentAddition.AddEffect(prefab);
		}
	}
	public static class BoxOfLight
	{
		public static GameObject laserTracer;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			laserTracer = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBeamTracer.prefab").WaitForCompletion(), "Cybernetic Eye Tracer", false);
			((Component)laserTracer.transform.GetChild(0)).gameObject.SetActive(false);
			((Component)laserTracer.transform.GetChild(1)).gameObject.SetActive(false);
			LineRenderer component = laserTracer.GetComponent<LineRenderer>();
			component.widthMultiplier = 0.15f;
			component.numCapVertices = 10;
			Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorBeamTrail.mat").WaitForCompletion());
			val.SetTexture("_RemapTex", (Texture)(object)Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/ColorRamps/texRampWhiteAlphaOnly.png").WaitForCompletion());
			((Renderer)component).material = val;
			AnimateShaderAlpha component2 = laserTracer.GetComponent<AnimateShaderAlpha>();
			component2.timeMax = 0.4f;
			ContentAddition.AddEffect(laserTracer);
		}
	}
	public static class CyberneticEye
	{
		public static Material tryProcMat;

		public static GameObject laserTracer;

		public static GameObject explosion;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			tryProcMat = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressFlashExpanded.mat").WaitForCompletion());
			tryProcMat.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)61, (byte)135, byte.MaxValue, (byte)110)));
			laserTracer = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBeamTracer.prefab").WaitForCompletion(), "Cybernetic Eye Tracer", false);
			((Component)laserTracer.transform.GetChild(0)).gameObject.SetActive(false);
			((Component)laserTracer.transform.GetChild(1)).gameObject.SetActive(false);
			LineRenderer component = laserTracer.GetComponent<LineRenderer>();
			component.widthMultiplier = 0.66f;
			component.numCapVertices = 10;
			Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorBeamTrail.mat").WaitForCompletion());
			val.SetTexture("_RemapTex", (Texture)(object)Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/ColorRamps/texRampLunarWardDecal.png").WaitForCompletion());
			val.SetFloat("_AlphaBias", 0.6321731f);
			val.SetTextureScale("_Cloud1Tex", new Vector2(10f, 1f));
			((Renderer)component).material = val;
			AnimateShaderAlpha component2 = laserTracer.GetComponent<AnimateShaderAlpha>();
			component2.timeMax = 1f;
			ContentAddition.AddEffect(laserTracer);
			explosion = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispTrackingBombExplosion.prefab").WaitForCompletion(), "Cybernetic Eye Explosion VFX", false);
			ContentAddition.AddEffect(explosion);
		}
	}
	public static class DropOfSun
	{
		public static Material explosionMat;

		public static GameObject gravSphere;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			explosionMat = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressFlashExpanded.mat").WaitForCompletion());
			explosionMat.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)232, (byte)132, (byte)110)));
			gravSphere = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Grandparent/GrandparentGravSphere.prefab").WaitForCompletion(), "Drop of Sun VFX");
			ProjectileSimple component = gravSphere.GetComponent<ProjectileSimple>();
			component.desiredForwardSpeed = 0f;
			component.lifetime = 2f;
			Object.Destroy((Object)(object)gravSphere.GetComponent<RadialForce>());
			PrefabAPI.RegisterNetworkPrefab(gravSphere);
		}
	}
	public static class PartyInvitation
	{
		public static GameObject prefab;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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)
			prefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/NearbyDamageBonus/NearbyDamageBonusIndicator.prefab").WaitForCompletion(), "Party Invitation Visual", true);
			Transform val = prefab.transform.Find("Radius, Spherical");
			val.localScale = new Vector3(26f, 26f, 26f);
			Material val2 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/NearbyDamageBonus/matNearbyDamageBonusRangeIndicator.mat").WaitForCompletion());
			Texture2D val3 = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/texCloudWaterRipples.png").WaitForCompletion();
			val2.SetTexture("_MainTex", (Texture)(object)val3);
			val2.SetTexture("_Cloud1Tex", (Texture)(object)val3);
			val2.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)216, (byte)95, (byte)38, (byte)200)));
			((Renderer)((Component)val).GetComponent<MeshRenderer>()).material = val2;
			PrefabAPI.RegisterNetworkPrefab(prefab);
		}
	}
	public static class Preparations
	{
		public static GameObject prefab;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			prefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab").WaitForCompletion(), "Preparations Chest Impact", false);
			EffectComponent component = prefab.GetComponent<EffectComponent>();
			component.applyScale = true;
			component.soundName = "Play_UI_podImpact";
			ContentAddition.AddEffect(prefab);
		}
	}
	public static class Sapling
	{
		public static GameObject impact;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			impact = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scav/ScavSackExplosion.prefab").WaitForCompletion(), "Sapling Thqwib Explosion VFX", false);
			Transform transform = impact.transform;
			for (int i = 0; i < transform.childCount; i++)
			{
				Transform child = transform.GetChild(i);
				((Component)child).transform.localScale = Vector3.one * 0.3f;
			}
			ContentAddition.AddEffect(impact);
		}
	}
	public static class SelfDestructionDevice
	{
		public static GameObject explosionVFX = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BleedOnHitAndExplode/BleedOnHitAndExplode_Explosion.prefab").WaitForCompletion();

		public static GameObject explosionVFX2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/QuestVolatileBattery/VolatileBatteryExplosion.prefab").WaitForCompletion();

		public static Material deathMat;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			deathMat = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressFlashExpanded.mat").WaitForCompletion());
			deathMat.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)186, (byte)0, (byte)0, (byte)150)));
		}
	}
	public static class Soulstealer
	{
		public static GameObject prefab;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: 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_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: 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_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Expected O, but got Unknown
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			prefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorMegaBlasterBigGhost.prefab").WaitForCompletion(), "Soulstealer Ghost", false);
			Texture2D val = Main.assetBundle.LoadAsset<Texture2D>("texRampSoulstealer.png");
			Transform transform = prefab.transform;
			Light component = ((Component)transform.Find("Point Light")).GetComponent<Light>();
			component.color = Color32.op_Implicit(new Color32((byte)18, byte.MaxValue, (byte)213, byte.MaxValue));
			Transform val2 = transform.Find("Rotator");
			Transform val3 = val2.Find("Trail");
			TrailRenderer component2 = ((Component)val3).GetComponent<TrailRenderer>();
			Material val4 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorMegaBlasterTrail.mat").WaitForCompletion());
			val4.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)165, (byte)236, (byte)206, byte.MaxValue)));
			((Renderer)component2).material = val4;
			Transform val5 = val2.Find("Scaler");
			Transform val6 = val5.Find("Sphere");
			MeshRenderer component3 = ((Component)val6).GetComponent<MeshRenderer>();
			Material val7 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterSphere.mat").WaitForCompletion());
			val7.SetColor("_Color", new Color(0.5761207f, 8.142507f, 0.5761207f, 1f));
			Material val8 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterSphereOverlay1.mat").WaitForCompletion());
			val8.SetTexture("_RemapTex", (Texture)(object)val);
			Material[] materials = ((Renderer)component3).materials;
			materials[0] = val7;
			materials[1] = val8;
			((Renderer)component3).materials = materials;
			Transform val9 = val5.Find("Particles");
			Transform val10 = val9.Find("BrightFlash");
			MainModule main = ((Component)val10).GetComponent<ParticleSystem>().main;
			MinMaxGradient startColor = ((MainModule)(ref main)).startColor;
			((MinMaxGradient)(ref startColor)).color = Color.white;
			ParticleSystemRenderer component4 = ((Component)val10).GetComponent<ParticleSystemRenderer>();
			Material val11 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterCore.mat").WaitForCompletion());
			val11.SetTexture("_RemapTex", (Texture)(object)val);
			((Renderer)component4).material = val11;
			ParticleSystem component5 = ((Component)val9.Find("SoftGlow")).GetComponent<ParticleSystem>();
			ColorOverLifetimeModule colorOverLifetime = component5.colorOverLifetime;
			Gradient val12 = new Gradient();
			GradientAlphaKey[] alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[2]
			{
				new GradientAlphaKey(0.85f, 1f),
				new GradientAlphaKey(1f, 0f)
			};
			GradientColorKey[] colorKeys = (GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(Color32.op_Implicit(new Color32((byte)57, byte.MaxValue, (byte)157, byte.MaxValue)), 0f),
				new GradientColorKey(Color32.op_Implicit(new Color32((byte)0, (byte)142, (byte)119, byte.MaxValue)), 0f)
			};
			val12.alphaKeys = alphaKeys;
			val12.colorKeys = colorKeys;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val12);
			ParticleSystemRenderer component6 = ((Component)val9.Find("Fire")).GetComponent<ParticleSystemRenderer>();
			((Renderer)component6).material = val11;
			ParticleSystemRenderer component7 = ((Component)val9.Find("Base")).GetComponent<ParticleSystemRenderer>();
			Material val13 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorLightning.mat").WaitForCompletion());
			val13.SetTexture("_RemapTex", (Texture)(object)val);
			((Renderer)component7).material = val13;
			ParticleSystemRenderer component8 = ((Component)val9.Find("Base (1)")).GetComponent<ParticleSystemRenderer>();
			Material val14 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorMuzzleflash1.mat").WaitForCompletion());
			val14.SetTexture("_RemapTex", (Texture)(object)val);
			((Renderer)component8).material = val14;
			ParticleSystemRenderer component9 = ((Component)val9.Find("Sparks, Misc")).GetComponent<ParticleSystemRenderer>();
			((Renderer)component9).material = val11;
		}
	}
	public static class Start
	{
		public static void Init()
		{
			Axe.Init();
			BottleOpener.Init();
			BoxOfLight.Init();
			CyberneticEye.Init();
			DropOfSun.Init();
			PartyInvitation.Init();
			Preparations.Init();
			Sapling.Init();
			SelfDestructionDevice.Init();
			Soulstealer.Init();
		}
	}
}
namespace KatsurosStuff.Items
{
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

		public ItemBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class ItemBase
	{
		public ItemDef ItemDef;

		public static Sprite questionMarkIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion();

		public static Sprite whiteIcon = Main.assetBundle.LoadAsset<Sprite>("texWhiteIcon.png");

		public static Sprite greenIcon = Main.assetBundle.LoadAsset<Sprite>("texGreenIcon.png");

		public static Sprite redIcon = Main.assetBundle.LoadAsset<Sprite>("texRedIcon.png");

		public static Sprite voidIcon = Main.assetBundle.LoadAsset<Sprite>("texVoidIcon.png");

		public abstract string ItemName { get; }

		public abstract string ConfigName { get; }

		public abstract string ItemLangTokenName { get; }

		public abstract string ItemPickupDesc { get; }

		public abstract string ItemFullDescription { get; }

		public abstract string ItemLore { get; }

		public abstract ItemTier Tier { get; }

		public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0];


		public abstract GameObject ItemModel { get; }

		public abstract Sprite ItemIcon { get; }

		public virtual bool CanRemove { get; } = true;


		public virtual bool AIBlacklisted { get; set; } = false;


		public abstract void Init(ConfigFile config);

		public virtual void CreateConfig(ConfigFile config)
		{
		}

		protected virtual void CreateLang()
		{
			LanguageAPI.Add("ITEM_KATSURO_" + ItemLangTokenName + "_NAME", ItemName);
			LanguageAPI.Add("ITEM_KATSURO_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc);
			LanguageAPI.Add("ITEM_KATSURO_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription);
			LanguageAPI.Add("ITEM_KATSURO_" + ItemLangTokenName + "_LORE", ItemLore);
		}

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateItem()
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Expected I4, but got Unknown
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Expected I4, but got Unknown
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Expected O, but got Unknown
			if (AIBlacklisted)
			{
				ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray();
			}
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = "ITEM_KATSURO_" + ItemLangTokenName;
			ItemDef.nameToken = "ITEM_KATSURO_" + ItemLangTokenName + "_NAME";
			ItemDef.pickupToken = "ITEM_KATSURO_" + ItemLangTokenName + "_PICKUP";
			ItemDef.descriptionToken = "ITEM_KATSURO_" + ItemLangTokenName + "_DESCRIPTION";
			ItemDef.loreToken = "ITEM_KATSURO_" + ItemLangTokenName + "_LORE";
			ItemDef.deprecatedTier = Tier;
			ItemTier deprecatedTier = ItemDef.deprecatedTier;
			if (1 == 0)
			{
			}
			GameObject val = (GameObject)((int)deprecatedTier switch
			{
				0 => Main.whiteModel, 
				1 => Main.greenModel, 
				2 => Main.redModel, 
				6 => Main.voidModel, 
				7 => Main.voidModel, 
				8 => Main.voidModel, 
				9 => Main.voidModel, 
				_ => Main.questionMarkModel, 
			});
			if (1 == 0)
			{
			}
			GameObject val2 = val;
			ItemDef.pickupModelPrefab = ItemModel ?? val2;
			ItemTier deprecatedTier2 = ItemDef.deprecatedTier;
			if (1 == 0)
			{
			}
			Sprite val3 = (Sprite)((int)deprecatedTier2 switch
			{
				0 => whiteIcon, 
				1 => greenIcon, 
				2 => redIcon, 
				6 => voidIcon, 
				7 => voidIcon, 
				8 => voidIcon, 
				9 => voidIcon, 
				_ => questionMarkIcon, 
			});
			if (1 == 0)
			{
			}
			Sprite val4 = val3;
			ItemDef.pickupIconSprite = ItemIcon ?? val4;
			ItemDef.hidden = false;
			ItemDef.canRemove = CanRemove;
			if (ItemTags.Length != 0)
			{
				ItemDef.tags = ItemTags;
			}
			ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules()));
		}

		public virtual void Hooks()
		{
		}

		public int GetCount(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(ItemDef);
		}

		public int GetCount(CharacterMaster master)
		{
			if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
			{
				return 0;
			}
			return master.inventory.GetItemCount(ItemDef);
		}

		public int GetCountSpecific(CharacterBody body, ItemDef itemDef)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(itemDef);
		}
	}
	public static class Utils
	{
		public static bool IsActualInteractable(GameObject interactable)
		{
			if (!Object.op_Implicit((Object)(object)interactable))
			{
				return false;
			}
			InteractionProcFilter component = interactable.GetComponent<InteractionProcFilter>();
			if (Object.op_Implicit((Object)(object)component))
			{
				return component.shouldAllowOnInteractionBeginProc;
			}
			if (Object.op_Implicit((Object)(object)interactable.GetComponent<GenericPickupController>()))
			{
				return false;
			}
			if (Object.op_Implicit((Object)(object)interactable.GetComponent<VehicleSeat>()))
			{
				return false;
			}
			if (Object.op_Implicit((Object)(object)interactable.GetComponent<NetworkUIPromptController>()))
			{
				return false;
			}
			return true;
		}
	}
}
namespace KatsurosStuff.Items.White
{
	public class BottleOpener : ItemBase<BottleOpener>
	{
		public static SpawnCard barrelSpawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/Barrel1/iscBarrel1.asset").WaitForCompletion();

		public override string ItemName => "Bottle Opener";

		public override string ConfigName => "Bottle Opener";

		public override string ItemLangTokenName => "BOTTLE_OPENER";

		public override string ItemPickupDesc => "Activating your equipment also summons barrels.";

		public override string ItemFullDescription => "Activating your Equipment also summons <style=cIsUtility>1</style> <style=cStack>(+1 per stack)</style> <style=cIsUtility>barrel</style> per <style=cIsUtility>20s</style> of your <style=cIsUtility>base equipment cooldown</style>.";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => null;

		public override Sprite ItemIcon => null;

		public override bool AIBlacklisted => true;

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			EquipmentSlot.onServerEquipmentActivated += EquipmentSlot_onServerEquipmentActivated;
		}

		private void EquipmentSlot_onServerEquipmentActivated(EquipmentSlot slot, EquipmentIndex index)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody characterBody = slot.characterBody;
			if (!Object.op_Implicit((Object)(object)characterBody))
			{
				return;
			}
			Inventory inventory = characterBody.inventory;
			if (!Object.op_Implicit((Object)(object)inventory))
			{
				return;
			}
			int itemCountForTeam = Util.GetItemCountForTeam((TeamIndex)1, ItemBase<BottleOpener>.instance.ItemDef.itemIndex, true, true);
			if (itemCountForTeam <= 0)
			{
				return;
			}
			DirectorCore val = DirectorCore.instance;
			if (Object.op_Implicit((Object)(object)val))
			{
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(index);
				if (Object.op_Implicit((Object)(object)equipmentDef))
				{
					float cooldown = equipmentDef.cooldown;
					((MonoBehaviour)slot).StartCoroutine(SpawnBarrels(val, itemCountForTeam, cooldown, slot));
				}
			}
		}

		public IEnumerator SpawnBarrels(DirectorCore directorCore, int stack, float cooldown, EquipmentSlot slot)
		{
			float barrels = cooldown / 20f * (float)stack;
			for (int i = 0; (float)i < barrels; i++)
			{
				yield return (object)new WaitForSeconds(0.125f);
				DirectorPlacementRule directorPlacementRule = new DirectorPlacementRule
				{
					maxDistance = 25f + 2f * (float)stack,
					minDistance = 7f,
					placementMode = (PlacementMode)1,
					position = ((Component)slot).transform.position,
					preventOverhead = false
				};
				GameObject gameObject = directorCore.TrySpawnObject(new DirectorSpawnRequest(barrelSpawnCard, directorPlacementRule, Run.instance.treasureRng));
				if (Object.op_Implicit((Object)(object)gameObject))
				{
					EffectManager.SpawnEffect(KatsurosStuff.VFX.BottleOpener.prefab, new EffectData
					{
						origin = gameObject.transform.position,
						scale = 1.5f
					}, true);
				}
			}
			yield return null;
		}
	}
	public class BoxOfLight : ItemBase<BoxOfLight>
	{
		public override string ItemName => "Box of Light";

		public override string ConfigName => "Box of Light";

		public override string ItemLangTokenName => "BOX_OF_LIGHT";

		public override string ItemPickupDesc => "Activating an interactable flashes light at exposed enemies.";

		public override string ItemFullDescription => "Activating an interactable <style=cIsDamage>flashes light</style> at every exposed enemy for <style=cIsDamage>300%</style> base damage, <style=cIsUtility>stuns</style> them for <style=cIsUtility>1s</style> and gives <style=cIsUtility>$1</style> <style=cStack>(+$1 per stack)</style>. <style=cIsUtility>Scales over time</style>.";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => null;

		public override Sprite ItemIcon => null;

		public override bool AIBlacklisted => true;

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			GlobalEventManager.OnInteractionsGlobal += GlobalEventManager_OnInteractionsGlobal;
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
		{
			Inventory inventory = body.inventory;
			if (Object.op_Implicit((Object)(object)inventory))
			{
				int itemCount = inventory.GetItemCount(ItemBase<BoxOfLight>.instance.ItemDef);
				if (itemCount > 0 && (Object)(object)((Component)body).GetComponent<BoxOfLightController>() == (Object)null)
				{
					((Component)body).gameObject.AddComponent<BoxOfLightController>();
				}
			}
		}

		private void GlobalEventManager_OnInteractionsGlobal(Interactor interactor, IInteractable interactable, GameObject interactableObject)
		{
			if (!Object.op_Implicit((Object)(object)interactableObject) || !Utils.IsActualInteractable(interactableObject) || !Object.op_Implicit((Object)(object)interactor))
			{
				return;
			}
			CharacterBody component = ((Component)interactor).GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Inventory inventory = component.inventory;
			if (Object.op_Implicit((Object)(object)inventory))
			{
				int itemCount = inventory.GetItemCount(ItemBase<BoxOfLight>.instance.ItemDef);
				if (itemCount > 0)
				{
					((MonoBehaviour)interactor).StartCoroutine(FlashLight(component, itemCount));
				}
			}
		}

		private IEnumerator FlashLight(CharacterBody body, int stack)
		{
			yield return (object)new WaitForSeconds(0.2f);
			BoxOfLightController boxOfLightController = ((Component)body).GetComponent<BoxOfLightController>();
			boxOfLightController.Proc(stack);
			yield return null;
		}
	}
	public class BoxOfLightController : MonoBehaviour
	{
		public CharacterBody body;

		public CharacterMaster master;

		public CharacterLosTracker losTracker;

		public void Start()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			body = ((Component)this).GetComponent<CharacterBody>();
			master = body.master;
			losTracker = new CharacterLosTracker
			{
				enabled = true
			};
		}

		public void FixedUpdate()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			losTracker.origin = ((Component)this).transform.position;
			losTracker.Step();
		}

		public void Proc(int stack)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Invalid comparison between Unknown and I4
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//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_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			ReadOnlyCollection<CharacterBody> readOnlyInstancesList = CharacterBody.readOnlyInstancesList;
			bool flag = false;
			uint difficultyScaledCost = (uint)Run.instance.GetDifficultyScaledCost(stack);
			for (int i = 0; i < readOnlyInstancesList.Count; i++)
			{
				CharacterBody val = readOnlyInstancesList[i];
				if (!Object.op_Implicit((Object)(object)val.teamComponent) || (int)val.teamComponent.teamIndex == 1)
				{
					continue;
				}
				if (losTracker.CheckBodyHasLos(val))
				{
					flag = true;
					EffectManager.SpawnEffect(KatsurosStuff.VFX.BoxOfLight.laserTracer, new EffectData
					{
						start = body.corePosition,
						origin = val.corePosition
					}, true);
					if (NetworkServer.active)
					{
						DamageInfo val2 = new DamageInfo
						{
							attacker = ((Component)body).gameObject,
							inflictor = ((Component)body).gameObject,
							crit = body.RollCrit(),
							damage = body.damage * 3f,
							damageColorIndex = (DamageColorIndex)3,
							damageType = (DamageType)32,
							force = Vector3.zero,
							position = val.corePosition,
							procCoefficient = 0.2f
						};
						HealthComponent healthComponent = val.healthComponent;
						if (healthComponent != null)
						{
							healthComponent.TakeDamage(val2);
						}
					}
					master.GiveMoney(difficultyScaledCost);
				}
				if (flag)
				{
					Util.PlaySound("Play_commando_M2_grenade_explo", ((Component)body).gameObject);
				}
			}
		}

		public void OnDestroy()
		{
			losTracker.enabled = false;
			losTracker.Dispose();
			losTracker = null;
		}
	}
	public class LeafBlade : ItemBase<LeafBlade>
	{
		public static BuffDef cooldownBuff;

		public static GameObject effect;

		public override string ItemName => "Leaf Blade";

		public override string ConfigName => "Leaf Blade";

		public override string ItemLangTokenName => "LEAF_BLADE";

		public override string ItemPickupDesc => "Nearby enemies get slashed with a sword that heals you.";

		public override string ItemFullDescription => "Nearby enemies get <style=cIsDamage>slashed</style> with a <style=cIsDamage>sword</style> that <style=cIsHealing>heals</style> you for <style=cIsHealing>2%</style> <style=cStack>(+2% per stack)</style> of <style=cIsHealing>maximum health</style> and deals <style=cIsDamage>200%</style> <style=cStack>(+200% per stack)</style> base damage. The <style=cIsDamage>sword</style> cannot hit the same enemy twice for <style=cIsUtility>5</style> seconds.";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => null;

		public override Sprite ItemIcon => null;

		public override bool AIBlacklisted => true;

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			effect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Assassin2/AssassinSlash.prefab").WaitForCompletion(), "Leaf Blade Effect", false);
			Object.Destroy((Object)(object)effect.GetComponent<ScaleParticleSystemDuration>());
			EffectComponent component = effect.GetComponent<EffectComponent>();
			component.applyScale = true;
			Transform child = effect.transform.GetChild(0);
			ParticleSystem component2 = ((Component)child).GetComponent<ParticleSystem>();
			MainModule main = component2.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.2f);
			RotationOverLifetimeModule rotationOverLifetime = component2.rotationOverLifetime;
			((RotationOverLifetimeModule)(ref rotationOverLifetime)).zMultiplier = 1.1f;
			ParticleSystemRenderer component3 = ((Component)child).GetComponent<ParticleSystemRenderer>();
			Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Merc/matMercSwipe2.mat").WaitForCompletion());
			val.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)26, (byte)58, (byte)26, byte.MaxValue)));
			((Renderer)component3).material = val;
			ParticleSystem component4 = ((Component)effect.transform.GetChild(1)).GetComponent<ParticleSystem>();
			MainModule main2 = component4.main;
			((MainModule)(ref main2)).startLifetime = MinMaxCurve.op_Implicit(0.2f);
			RotationOverLifetimeModule rotationOverLifetime2 = component4.rotationOverLifetime;
			((RotationOverLifetimeModule)(ref rotationOverLifetime2)).zMultiplier = 1.13f;
			ContentAddition.AddEffect(effect);
			cooldownBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)cooldownBuff).name = "Leaf Blade Cooldown";
			cooldownBuff.isHidden = false;
			cooldownBuff.isDebuff = false;
			cooldownBuff.isCooldown = true;
			cooldownBuff.buffColor = new Color(0.4014f, 0.4014f, 0.4014f, 1f);
			cooldownBuff.iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/LunarSkillReplacements/bdLunarDetonationCharge.asset").WaitForCompletion().iconSprite;
			ContentAddition.AddBuffDef(cooldownBuff);
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody characterBody)
		{
			if (NetworkServer.active)
			{
				characterBody.AddItemBehavior<LeafBladeController>(characterBody.inventory.GetItemCount(ItemBase<LeafBlade>.instance.ItemDef));
			}
		}
	}
	public class LeafBladeController : ItemBehavior
	{
		public float healing = 0.025f;

		public float damage = 2f;

		public OverlapAttack overlapAttack;

		public ModelLocator modelLocator;

		public Transform modelTransform;

		public GameObject leafBladeObject;

		public HitBoxGroup hitBoxGroup;

		public HitBox hitBox;

		public float timer;

		public float interval = 0.2f;

		public List<HurtBox> hitList = new List<HurtBox>();

		public bool hasFired = false;

		public void Start()
		{
			//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_00d0: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			healing = 0.025f * (float)base.stack;
			damage = 2f * (float)base.stack;
			Main.ModLogger.LogError((object)("stack is " + base.stack));
			Main.ModLogger.LogError((object)("damage is " + damage));
			modelLocator = ((Component)this).GetComponent<ModelLocator>();
			ModelLocator obj = modelLocator;
			modelTransform = ((obj != null) ? obj.modelTransform : null);
			if (Object.op_Implicit((Object)(object)modelTransform) && (Object)(object)leafBladeObject == (Object)null)
			{
				leafBladeObject = new GameObject("Leaf Blade Object")
				{
					layer = LayerIndex.defaultLayer.intVal
				};
				leafBladeObject.transform.localScale = new Vector3(9f, 6f, 9f);
				hitBox = leafBladeObject.AddComponent<HitBox>();
				hitBoxGroup = leafBladeObject.AddComponent<HitBoxGroup>();
				hitBoxGroup.groupName = "Leaf Blade HitBox Group";
				hitBoxGroup.hitBoxes = (HitBox[])(object)new HitBox[1] { hitBox };
			}
		}

		public void FixedUpdate()
		{
			timer += Time.fixedDeltaTime;
			if (timer >= interval)
			{
				healing = 0.025f * (float)base.stack;
				damage = 2f * (float)base.stack;
				((MonoBehaviour)this).StartCoroutine(Fire());
				timer = 0f;
			}
		}

		public IEnumerator Fire()
		{
			overlapAttack = new OverlapAttack
			{
				attacker = ((Component)this).gameObject,
				inflictor = ((Component)this).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((Component)this).gameObject),
				damage = 0f,
				forceVector = Vector3.zero,
				pushAwayForce = 0f,
				attackerFiltering = (AttackerFiltering)2,
				procCoefficient = 0f,
				isCrit = base.body.RollCrit(),
				damageType = (DamageType)2048
			};
			if (Object.op_Implicit((Object)(object)leafBladeObject) && Object.op_Implicit((Object)(object)base.body.inputBank))
			{
				leafBladeObject.transform.forward = base.body.inputBank.aimDirection;
				leafBladeObject.transform.position = modelTransform.position;
				overlapAttack.hitBoxGroup = leafBladeObject.GetComponent<HitBoxGroup>();
			}
			overlapAttack.Fire(hitList);
			for (int i = 0; i < hitList.Count; i++)
			{
				HurtBox hit = hitList[i];
				HealthComponent hc = hit.healthComponent;
				CharacterBody victimBody = hc.body;
				if (!victimBody.HasBuff(LeafBlade.cooldownBuff))
				{
					if (NetworkServer.active)
					{
						DamageInfo info = new DamageInfo
						{
							attacker = ((Component)this).gameObject,
							crit = overlapAttack.isCrit,
							procCoefficient = 0f,
							damage = base.body.damage * damage,
							force = Vector3.zero,
							position = victimBody.corePosition,
							inflictor = ((Component)this).gameObject,
							damageType = (DamageType)0
						};
						hc.TakeDamage(info);
						base.body.healthComponent.HealFraction(healing, default(ProcChainMask));
					}
					if (!hasFired)
					{
						EffectData data = new EffectData
						{
							scale = 1.3f,
							origin = base.body.corePosition,
							rotation = Quaternion.identity
						};
						EffectManager.SpawnEffect(LeafBlade.effect, data, true);
						Util.PlaySound("Play_acrid_m1_slash", ((Component)this).gameObject);
						hasFired = true;
					}
					victimBody.AddTimedBuffAuthority(LeafBlade.cooldownBuff.buffIndex, 5f);
				}
			}
			hitList.Clear();
			hasFired = false;
			yield return null;
		}
	}
	public class PartyInvitation : ItemBase<PartyInvitation>
	{
		public static GameObject fireworksPrefab;

		public static BuffDef counter;

		public static BuffDef counted;

		public override string ItemName => "Party Invitation";

		public override string ConfigName => "Party Invitation";

		public override string ItemLangTokenName => "PARTY_INVITATION";

		public override string ItemPickupDesc => "Invite 10 friends for a party. The party starts when everyone is invited.";

		public override string ItemFullDescription => "Each enemy within <style=cIsDamage>20m</style> accepts <style=cIsDamage>1 invitation</style>. Upon reaching <style=cIsDamage>10 invitations</style>, fire <style=cIsDamage>10</style> <style=cStack>(+10 per stack)</style> fireworks for <style=cIsDamage>350%</style> base damage each. Recharges every <style=cIsUtility>10</style> seconds.";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => null;

		public override Sprite ItemIcon => null;

		public override bool AIBlacklisted => true;

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			fireworksPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Firework/FireworkProjectile.prefab").WaitForCompletion(), "Party Invitation Firework");
			MissileController component = fireworksPrefab.GetComponent<MissileController>();
			component.acceleration = 3f;
			component.giveupTimer = 30f;
			component.deathTimer = 30f;
			component.turbulence = 0f;
			component.maxSeekDistance = 10000f;
			PrefabAPI.RegisterNetworkPrefab(fireworksPrefab);
			counter = ScriptableObject.CreateInstance<BuffDef>();
			counter.isDebuff = false;
			counter.isCooldown = false;
			counter.canStack = true;
			counter.buffColor = Color32.op_Implicit(new Color32((byte)216, (byte)95, (byte)38, byte.MaxValue));
			counter.iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/LunarSkillReplacements/bdLunarDetonationCharge.asset").WaitForCompletion().iconSprite;
			((Object)counter).name = "Party Invitation Enemy Counter";
			ContentAddition.AddBuffDef(counter);
			counted = ScriptableObject.CreateInstance<BuffDef>();
			counted.isHidden = true;
			counted.isDebuff = false;
			counted.isCooldown = false;
			counted.canStack = false;
			((Object)counted).name = "Party Invitation Enemy Counted";
			ContentAddition.AddBuffDef(counted);
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody characterBody)
		{
			if (NetworkServer.active)
			{
				characterBody.AddItemBehavior<PartyInvitationController>(characterBody.inventory.GetItemCount(ItemBase<PartyInvitation>.instance.ItemDef));
			}
		}
	}
	public class PartyInvitationController : ItemBehavior
	{
		public float cooldownCountDown = 10f;

		public float refreshTimer;

		public float refreshInterval = 0.05f;

		public float fireInterval = 0.1f;

		public int fireworksCount;

		public float radiusSquared = 400f;

		public float distance = 20f;

		public TeamIndex ownerIndex;

		public GameObject radiusIndicator;

		public int count = 0;

		private bool enableRadiusIndicator
		{
			get
			{
				return Object.op_Implicit((Object)(object)radiusIndicator);
			}
			set
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				if (enableRadiusIndicator != value)
				{
					if (value)
					{
						radiusIndicator = Object.Instantiate<GameObject>(KatsurosStuff.VFX.PartyInvitation.prefab, base.body.corePosition, Quaternion.identity);
						radiusIndicator.GetComponent<NetworkedBodyAttachment>().AttachToGameObjectAndSpawn(((Component)this).gameObject, (string)null);
					}
					else
					{
						Object.Destroy((Object)(object)radiusIndicator);
						radiusIndicator = null;
					}
				}
			}
		}

		private void Start()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			ownerIndex = base.body.teamComponent.teamIndex;
			enableRadiusIndicator = true;
			Transform child = radiusIndicator.transform.GetChild(1);
			child.localScale = Vector3.one * distance * 2f;
			if (base.stack > 0)
			{
				fireworksCount = base.stack;
			}
			else
			{
				fireworksCount = 0;
			}
		}

		private void FixedUpdate()
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Invalid comparison between Unknown and I4
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Invalid comparison between Unknown and I4
			//IL_01b0: 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_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			cooldownCountDown -= Time.fixedDeltaTime;
			if (!(cooldownCountDown <= 0f))
			{
				return;
			}
			enableRadiusIndicator = true;
			refreshTimer += Time.fixedDeltaTime;
			if (!(refreshTimer >= refreshInterval))
			{
				return;
			}
			TeamIndex val = (TeamIndex)0;
			while ((int)val < 5)
			{
				if (val != ownerIndex && (int)val > 0)
				{
					foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val))
					{
						Vector3 position = ((Component)teamMember).transform.position;
						Vector3 corePosition = base.body.corePosition;
						CharacterBody body = teamMember.body;
						Vector3 val2 = position - corePosition;
						if (((Vector3)(ref val2)).sqrMagnitude <= radiusSquared && !body.HasBuff(PartyInvitation.counted))
						{
							count += ((!body.isBoss) ? 1 : 10);
							Util.PlaySound("Play_engi_M1_chargeStock", ((Component)this).gameObject);
							if (NetworkServer.active)
							{
								body.AddBuff(PartyInvitation.counted);
								base.body.AddBuff(PartyInvitation.counter);
							}
						}
					}
				}
				val = (TeamIndex)(sbyte)(val + 1);
			}
			if (count >= 10)
			{
				count = 0;
				if (NetworkServer.active)
				{
					base.body.SetBuffCount(PartyInvitation.counter.buffIndex, 0);
				}
				((MonoBehaviour)this).StartCoroutine(Fire(10));
			}
			refreshTimer = 0f;
		}

		public IEnumerator Fire(int fireworkCount)
		{
			cooldownCountDown = 10f;
			for (int i = 0; i < CharacterBody.readOnlyInstancesList.Count; i++)
			{
				CharacterBody body = CharacterBody.readOnlyInstancesList[i];
				if (body.HasBuff(PartyInvitation.counted))
				{
					body.RemoveBuff(PartyInvitation.counted);
				}
			}
			yield return (object)new WaitForSeconds(0.5f);
			enableRadiusIndicator = false;
			if (Object.op_Implicit((Object)(object)base.body))
			{
				for (int j = 0; j < fireworkCount * base.stack; j++)
				{
					yield return (object)new WaitForSeconds(fireInterval);
					Vector2 randomOffset = Random.insideUnitCircle;
					MissileUtils.FireMissile(((Component)this).transform.position + new Vector3(randomOffset.x, 0f, randomOffset.y), base.body, default(ProcChainMask), (GameObject)null, base.body.damage * 3.5f, base.body.RollCrit(), PartyInvitation.fireworksPrefab, (DamageColorIndex)3, false);
				}
			}
			yield return null;
		}

		private void OnDisable()
		{
			enableRadiusIndicator = false;
		}
	}
}
namespace KatsurosStuff.Items.Red
{
	public class BoxOfChaos : ItemBase<BoxOfChaos>
	{
		public static Dictionary<GameObject, int> projectileWhitelistToCountMap = new Dictionary<GameObject, int>();

		public static ProcType boxOfChaosProcType = (ProcType)215981295;

		public static GameObject fmpPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/DeathProjectile/DeathProjectile.prefab").WaitForCompletion();

		public override string ItemName => "Box of Chaos";

		public override string ConfigName => "Box of Chaos";

		public override string ItemLangTokenName => "BOX_OF_CHAOS";

		public override string ItemPickupDesc => "Activating an interactable also activates all on kill effects. Chance on kill to summon a random projectile.";

		public override string ItemFullDescription => "Activating an interactable also activates all <style=cIsDamage>on kill effects</style>. <style=cIsDamage>30%</style> <style=cStack>(+10% per stack)</style> chance on kill to summon a <style=cIsDamage>random projectile</style> for <style=cIsDamage>1200%</style> base damage.";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => null;

		public override Sprite ItemIcon => null;

		public override bool AIBlacklisted => true;

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			GameObject key = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageIceBombProjectile.prefab").WaitForCompletion());
			GameObject key2 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageLightningBombProjectile.prefab").WaitForCompletion());
			GameObject key3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiHarpoon.prefab").WaitForCompletion();
			GameObject key4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Loader/LoaderPylon.prefab").WaitForCompletion();
			GameObject key5 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Treebot/TreebotMortarRain.prefab").WaitForCompletion();
			GameObject key6 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Treebot/TreebotMortar2.prefab").WaitForCompletion();
			GameObject key7 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorMegaBlasterBigProjectile.prefab").WaitForCompletion());
			GameObject key8 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorMegaBlasterBigProjectileCorrupted.prefab").WaitForCompletion());
			GameObject key9 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Saw/Sawmerang.prefab").WaitForCompletion());
			GameObject key10 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/MissileProjectile.prefab").WaitForCompletion();
			GameObject key11 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bell/BellBall.prefab").WaitForCompletion());
			GameObject key12 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelProjectile.prefab").WaitForCompletion());
			GameObject key13 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LemurianBruiser/LemurianBigFireball.prefab").WaitForCompletion());
			GameObject key14 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarGolem/LunarGolemTwinShotProjectile.prefab").WaitForCompletion());
			GameObject key15 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispTrackingBomb.prefab").WaitForCompletion();
			GameObject key16 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Vagrant/VagrantTrackingBomb.prefab").WaitForCompletion();
			GameObject key17 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ElectricWorm/ElectricOrbProjectile.prefab").WaitForCompletion());
			GameObject key18 = AddHoming(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ImpBoss/ImpBossFireVoidspikes.prefab").WaitForCompletion());
			projectileWhitelistToCountMap.Add(key, 1);
			projectileWhitelistToCountMap.Add(key2, 1);
			projectileWhitelistToCountMap.Add(key3, 4);
			projectileWhitelistToCountMap.Add(key4, 1);
			projectileWhitelistToCountMap.Add(key5, 1);
			projectileWhitelistToCountMap.Add(key6, 3);
			projectileWhitelistToCountMap.Add(key7, 1);
			projectileWhitelistToCountMap.Add(key8, 1);
			projectileWhitelistToCountMap.Add(key9, 1);
			projectileWhitelistToCountMap.Add(key10, 12);
			projectileWhitelistToCountMap.Add(key11, 3);
			projectileWhitelistToCountMap.Add(key12, 4);
			projectileWhitelistToCountMap.Add(key13, 3);
			projectileWhitelistToCountMap.Add(key14, 10);
			projectileWhitelistToCountMap.Add(key15, 1);
			projectileWhitelistToCountMap.Add(key16, 1);
			projectileWhitelistToCountMap.Add(key17, 1);
			projectileWhitelistToCountMap.Add(key18, 6);
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
			GlobalEventManager.OnInteractionsGlobal += GlobalEventManager_OnInteractionsGlobal;
		}

		private GameObject AddHoming(GameObject gameObject)
		{
			GameObject val = PrefabAPI.InstantiateClone(gameObject, "Homing " + ((Object)gameObject).name);
			val.AddComponent<ProjectileTargetComponent>();
			ProjectileSteerTowardTarget val2 = val.AddComponent<ProjectileSteerTowardTarget>();
			val2.rotationSpeed = 1080f;
			ProjectileDirectionalTargetFinder val3 = val.AddComponent<ProjectileDirectionalTargetFinder>();
			val3.lookRange = 1000f;
			val3.lookCone = 180f;
			val3.targetSearchInterval = 0.1f;
			val3.onlySearchIfNoTarget = true;
			val3.allowTargetLoss = false;
			val3.testLoS = false;
			val3.ignoreAir = false;
			val3.flierAltitudeTolerance = float.PositiveInfinity;
			PrefabAPI.RegisterNetworkPrefab(val);
			return val;
		}

		private void GlobalEventManager_OnInteractionsGlobal(Interactor interactor, IInteractable interactable, GameObject interactableObject)
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)interactableObject) || !Utils.IsActualInteractable(interactableObject) || !Object.op_Implicit((Object)(object)interactor))
			{
				return;
			}
			CharacterBody component = ((Component)interactor).GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Inventory inventory = component.inventory;
			if (!Object.op_Implicit((Object)(object)inventory))
			{
				return;
			}
			int itemCount = inventory.GetItemCount(ItemBase<BoxOfChaos>.instance.ItemDef);
			if (itemCount > 0)
			{
				GameObject val = Object.Instantiate<GameObject>(fmpPrefab, component.footPosition, Quaternion.identity);
				val.transform.localScale = new Vector3(0f, 0f, 0f);
				val.GetComponent<DeathProjectile>().baseDuration = 1.1f;
				Object.Destroy((Object)(object)val.GetComponent<DestroyOnTimer>());
				Object.Destroy((Object)(object)val.GetComponent<DeathProjectile>());
				Object.Destroy((Object)(object)val.GetComponent<ApplyTorqueOnStart>());
				Object.Destroy((Object)(object)val.GetComponent<ProjectileDeployToOwner>());
				Object.Destroy((Object)(object)val.GetComponent<Deployable>());
				Object.Destroy((Object)(object)val.GetComponent<ProjectileStickOnImpact>());
				Object.Destroy((Object)(object)val.GetComponent<ProjectileController>());
				val.transform.position = component.footPosition;
				HealthComponent component2 = val.GetComponent<HealthComponent>();
				if (NetworkServer.active)
				{
					DamageInfo val2 = new DamageInfo
					{
						attacker = ((Component)component).gameObject,
						crit = component.RollCrit(),
						damage = component.baseDamage,
						position = component.footPosition,
						procCoefficient = 0f,
						damageType = (DamageType)0,
						damageColorIndex = (DamageColorIndex)3
					};
					DamageReport val3 = new DamageReport(val2, component2, val2.damage, component2.combinedHealth);
					GlobalEventManager.instance.OnCharacterDeath(val3);
				}
			}
		}

		private void GlobalEventManager_onCharacterDeathGlobal(DamageReport report)
		{
			//IL_000e: 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_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: 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_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			DamageInfo damageInfo = report.damageInfo;
			if (((ProcChainMask)(ref damageInfo.procChainMask)).HasProc(boxOfChaosProcType))
			{
				return;
			}
			CharacterBody victimBody = report.victimBody;
			if (!Object.op_Implicit((Object)(object)victimBody))
			{
				return;
			}
			CharacterBody attackerBody = report.attackerBody;
			if (!Object.op_Implicit((Object)(object)attackerBody))
			{
				return;
			}
			Inventory inventory = attackerBody.inventory;
			if (!Object.op_Implicit((Object)(object)inventory))
			{
				return;
			}
			int itemCount = inventory.GetItemCount(ItemBase<BoxOfChaos>.instance.ItemDef);
			if (itemCount > 0)
			{
				CharacterMaster master = attackerBody.master;
				if (Object.op_Implicit((Object)(object)master) && Util.CheckRoll((30f + 10f * (float)(itemCount - 1)) * report.damageInfo.procCoefficient, master))
				{
					int index = Run.instance.treasureRng.RangeInt(0, projectileWhitelistToCountMap.Count);
					KeyValuePair<GameObject, int> keyValuePair = projectileWhitelistToCountMap.ElementAt(index);
					GameObject key = keyValuePair.Key;
					int value = keyValuePair.Value;
					Vector3 initialFiringPosition = victimBody.corePosition + new Vector3(0f, 5f, 0f);
					((MonoBehaviour)attackerBody).StartCoroutine(FireProjectileStandard(attackerBody, initialFiringPosition, key, value));
					((ProcChainMask)(ref damageInfo.procChainMask)).AddProc(boxOfChaosProcType);
				}
			}
		}

		private IEnumerator FireProjectileStandard(CharacterBody attackerBody, Vector3 initialFiringPosition, GameObject projectile, int count)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < count; i++)
			{
				FireProjectileInfo fpi = new FireProjectileInfo
				{
					damage = attackerBody.damage * (12f / (float)count),
					crit = attackerBody.RollCrit(),
					damageColorIndex = (DamageColorIndex)3,
					owner = ((Component)attackerBody).gameObject,
					position = initialFiringPosition + new Vector3(0f, (float)i, 0f),
					projectilePrefab = projectile,
					force = 0f,
					procChainMask = default(ProcChainMask)
				};
				SphereSearch sphereSearch = new SphereSearch
				{
					radius = 1000f,
					origin = initialFiringPosition,
					queryTriggerInteraction = (QueryTriggerInteraction)1,
					mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask
				};
				sphereSearch.RefreshCandidates();
				sphereSearch.FilterCandidatesByDistinctHurtBoxEntities();
				HurtBox[] hurtBoxes = sphereSearch.GetHurtBoxes();
				HurtBox[] filteredHurtBoxes = hurtBoxes.Where((HurtBox x) => (Object)(object)((Component)x).gameObject != (Object)(object)((Component)attackerBody).gameObject).ToArray();
				HurtBox randomTarget = filteredHurtBoxes[Run.instance.treasureRng.RangeInt(0, filteredHurtBoxes.Length)];
				if (Object.op_Implicit((Object)(object)randomTarget))
				{
					fpi.target = ((Component)randomTarget).gameObject;
					fpi.rotation = Util.QuaternionSafeLookRotation(((Component)randomTarget).transform.position - fpi.position);
					ProjectileManager.instance.FireProjectile(fpi);
				}
				yield return (object)new WaitForSeconds(1f / (float)count);
			}
			yield return null;
		}
	}
	public class CyberneticEye : ItemBase<CyberneticEye>
	{
		public override string ItemName => "Cybernetic Eye";

		public override string ConfigName => "Cybernetic Eye";

		public override string ItemLangTokenName => "CYBERNETIC_EYE";

		public override string ItemPickupDesc => "Chance to fire a laser at enemies in your line of sight.";

		public override string ItemFullDescription => "<style=cIsDamage>1%</style> chance every <style=cIsDamage>5</style> <style=cStack>(-50% per stack)</style> seconds to fire a <style=cIsDamage>laser</style> at every enemy in your line of sight for <style=cIsDamage>5000%</style> base damage. <style=cStack>(chance increases with each unsuccessful attempt)";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => null;

		public override Sprite ItemIcon => null;

		public override bool AIBlacklisted => true;

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
		{
			body.AddItemBehavior<CyberneticEyeController>(body.inventory.GetItemCount(ItemBase<CyberneticEye>.instance.ItemDef));
		}

		private void CharacterBody_onBodyStartGlobal(CharacterBody body)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			if (Object.op_Implicit((Object)(object)body.teamComponent) && (int)body.teamComponent.teamIndex != 1 && (Object)(object)((Component)body).GetComponent<CyberneticEyeEnemyController>() == (Object)null)
			{
				((Component)body).gameObject.AddComponent<CyberneticEyeEnemyController>();
			}
		}
	}
	public class CyberneticEyeController : ItemBehavior
	{
		public float timer;

		public float interval;

		public float damage = 50f;

		public CharacterLosTracker losTracker;

		public void Start()
		{
			//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)
			//IL_0014: Expected O, but got Unknown
			losTracker = new CharacterLosTracker
			{
				enabled = true
			};
		}

		public void FixedUpdate()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Invalid comparison between Unknown and I4
			timer += Time.fixedDeltaTime;
			interval = 5f / (float)base.stack;
			losTracker.origin = ((Component)this).transform.position;
			losTracker.Step();
			if (!(timer >= interval))
			{
				return;
			}
			ReadOnlyCollection<CharacterBody> readOnlyInstancesList = CharacterBody.readOnlyInstancesList;
			bool flag = false;
			bool flag2 = false;
			for (int i = 0; i < readOnlyInstancesList.Count; i++)
			{
				CharacterBody val = readOnlyInstancesList[i];
				if (!Object.op_Implicit((Object)(object)val.teamComponent) || (int)val.teamComponent.teamIndex == 1)
				{
					continue;
				}
				CyberneticEyeEnemyController component = ((Component)val).GetComponent<CyberneticEyeEnemyController>();
				if (!Object.op_Implicit((Object)(object)component) || !losTracker.CheckBodyHasLos(val))
				{
					continue;
				}
				ModelLocator modelLocator = val.modelLocator;
				if (Object.op_Implicit((Object)(object)modelLocator))
				{
					Transform modelTransform = modelLocator.modelTransform;
					if (Object.op_Implicit((Object)(object)modelTransform))
					{
						TemporaryOverlay val2 = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
						val2.duration = 1f;
						val2.animateShaderAlpha = true;
						val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
						val2.destroyComponentOnEnd = true;
						val2.originalMaterial = KatsurosStuff.VFX.CyberneticEye.tryProcMat;
						val2.AddToCharacerModel(((Component)modelTransform).GetComponent<CharacterModel>());
					}
				}
				if (Util.CheckRoll(component.chance, 0f, (CharacterMaster)null))
				{
					if (!flag)
					{
						Util.PlaySound("Play_item_lunar_specialReplace_explode", ((Component)val).gameObject);
						Util.PlaySound("Play_item_lunar_specialReplace_explode", ((Component)val).gameObject);
						Util.PlaySound("Play_item_lunar_specialReplace_explode", ((Component)val).gameObject);
						Util.PlaySound("Play_item_lunar_specialReplace_explode", ((Component)val).gameObject);
						flag = true;
						flag2 = true;
					}
					((MonoBehaviour)base.body).StartCoroutine(Damage(val));
				}
				else
				{
					if (!flag2)
					{
						Util.PlaySound("Play_UI_insufficient_funds", ((Component)this).gameObject);
						flag2 = true;
					}
					component.chance += 1f;
				}
			}
			timer = 0f;
		}

		public IEnumerator Damage(CharacterBody enemyBody)
		{
			EffectManager.SpawnEffect(KatsurosStuff.VFX.CyberneticEye.laserTracer, new EffectData
			{
				start = base.body.corePosition,
				origin = enemyBody.corePosition
			}, true);
			yield return (object)new WaitForSeconds(0.15f);
			EffectManager.SpawnEffect(KatsurosStuff.VFX.CyberneticEye.explosion, new EffectData
			{
				origin = enemyBody.corePosition
			}, true);
			if (NetworkServer.active)
			{
				DamageInfo info = new DamageInfo
				{
					attacker = ((Component)this).gameObject,
					inflictor = ((Component)this).gameObject,
					crit = base.body.RollCrit(),
					damage = base.body.damage * damage,
					damageColorIndex = (DamageColorIndex)3,
					damageType = (DamageType)0,
					force = Vector3.zero,
					position = enemyBody.corePosition,
					procCoefficient = 1f
				};
				HealthComponent healthComponent = enemyBody.healthComponent;
				if (healthComponent != null)
				{
					healthComponent.TakeDamage(info);
				}
			}
		}

		public void OnDestroy()
		{
			losTracker.enabled = false;
			losTracker.Dispose();
			losTracker = null;
		}
	}
	public class CyberneticEyeEnemyController : MonoBehaviour
	{
		public float chance = 1f;
	}
	public class Sapling : ItemBase<Sapling>
	{
		public static GameObject uselessConstruct;

		public static CharacterSpawnCard uselessConstructSpawnCard;

		public static BodyIndex uselessConstructBodyIndex;

		public static GameObject thqwib;

		public override string ItemName => "Sapling";

		public override string ConfigName => "Sapling";

		public override string ItemLangTokenName => "SAPLING";

		public override string ItemPickupDesc => "Activating an interactable spawns catalysts that shoot Thqwibs on death.";

		public override string ItemFullDescription => "Activating an interactable spawns <style=cIsDamage>3</style> <style=cStack>(+2 per stack)</style> <style=cIsDamage>catalysts</style> that shoot <style=cIsDamage>24 Thqwibs</style> on death for <style=cIsDamage>200%</style> base damage each.";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => null;

		public override Sprite ItemIcon => null;

		public override bool AIBlacklisted => true;

		[SystemInitializer(new Type[] { typeof(BodyCatalog) })]
		public static void GetBodyIndex()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			uselessConstructBodyIndex = BodyCatalog.FindBodyIndex("Sapling Useless Construct Body");
		}

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: 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_0187: 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_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_035b: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Expected O, but got Unknown
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Expected O, but got Unknown
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Expected O, but got Unknown
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Expected O, but got Unknown
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Expected O, but got Unknown
			thqwib = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/FireballsOnHit/FireMeatBall.prefab").WaitForCompletion(), "Sapling Thqwib");
			ProjectileController component = thqwib.GetComponent<ProjectileController>();
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scav/ScavSackGhost.prefab").WaitForCompletion(), "Sapling Thqwib Ghost", false);
			val.transform.localScale = Vector3.one * 0.5f;
			component.ghostPrefab = val;
			ProjectileImpactExplosion component2 = thqwib.GetComponent<ProjectileImpactExplosion>();
			component2.impactEffect = KatsurosStuff.VFX.Sapling.impact;
			((ProjectileExplosion)component2).childrenProjectilePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Beetle/BeetleQueenAcid.prefab").WaitForCompletion();
			((ProjectileExplosion)component2).blastRadius = 7.5f;
			((ProjectileExplosion)component2).blastProcCoefficient = 0.1f;
			ProjectileDamage component3 = thqwib.GetComponent<ProjectileDamage>();
			component3.damageType = (DamageType)0;
			thqwib.AddComponent<ProjectileTargetComponent>();
			ProjectileSteerTowardTarget val2 = thqwib.AddComponent<ProjectileSteerTowardTarget>();
			val2.rotationSpeed = 400f;
			ProjectileDirectionalTargetFinder val3 = thqwib.AddComponent<ProjectileDirectionalTargetFinder>();
			val3.lookRange = 13f;
			val3.lookCone = 90f;
			val3.targetSearchInterval = 0.1f;
			val3.onlySearchIfNoTarget = true;
			val3.allowTargetLoss = false;
			val3.testLoS = false;
			val3.ignoreAir = false;
			val3.flierAltitudeTolerance = float.PositiveInfinity;
			PrefabAPI.RegisterNetworkPrefab(thqwib);
			ContentAddition.AddProjectile(thqwib);
			uselessConstruct = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Squid/SquidTurretMaster.prefab").WaitForCompletion(), "Sapling Useless Construct Master");
			GameObject val4 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/MinorConstructBody.prefab").WaitForCompletion(), "Sapling Useless Construct Body");
			val4.AddComponent<SaplingFuckOffController>();
			Transform modelTransform = val4.GetComponent<ModelLocator>()._modelTransform;
			ChildLocator component4 = ((Component)modelTransform).GetComponent<ChildLocator>();
			Transform val5 = component4.transformPairs[0].transform.parent.Find("Hurtbox");
			((Component)val5).gameObject.layer = LayerIndex.defaultLayer.intVal;
			Object.Destroy((Object)(object)((Component)val5).GetComponent<HurtBox>());
			Object.Destroy((Object)(object)((Component)val5).GetComponent<SphereCollider>());
			Transform transform = component4.transformPairs[3].transform;
			((Component)transform).gameObject.layer = LayerIndex.entityPrecise.intVal;
			SphereCollider val6 = ((Component)transform).gameObject.AddComponent<SphereCollider>();
			((Collider)val6).material = null;
			((Collider)val6).isTrigger = false;
			val6.center = Vector3.zero;
			val6.radius = 1.61f;
			HurtBox val7 = ((Component)transform).gameObject.AddComponent<HurtBox>();
			val7.healthComponent = val4.GetComponent<HealthComponent>();
			val7.isBullseye = true;
			val7.isSniperTarget = true;
			val7.damageModifier = (DamageModifier)0;
			HurtBoxGroup component5 = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			component5.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val7 };
			component5.mainHurtBox = val7;
			PrefabAPI.RegisterNetworkPrefab(val4);
			ContentAddition.AddBody(val4);
			CharacterMaster component6 = uselessConstruct.GetComponent<CharacterMaster>();
			component6.bodyPrefab = val4;
			Object.Destroy((Object)(object)(from x in uselessConstruct.GetComponents<AISkillDriver>()
				where x.customName == "FireAtEnemy"
				select x).First());
			PrefabAPI.RegisterNetworkPrefab(uselessConstruct);
			ContentAddition.AddMaster(uselessConstruct);
			uselessConstructSpawnCard = ScriptableObject.CreateInstance<CharacterSpawnCard>();
			((SpawnCard)uselessConstructSpawnCard).directorCreditCost = 0;
			((SpawnCard)uselessConstructSpawnCard).eliteRules = (EliteRules)0;
			uselessConstructSpawnCard.noElites = false;
			uselessConstructSpawnCard.forbiddenAsBoss = false;
			((SpawnCard)uselessConstructSpawnCard).forbiddenFlags = (NodeFlags)0;
			((SpawnCard)uselessConstructSpawnCard).requiredFlags = (NodeFlags)0;
			((SpawnCard)uselessConstructSpawnCard).nodeGraphType = (GraphType)0;
			((SpawnCard)uselessConstructSpawnCard).hullSize = (HullClassification)0;
			((SpawnCard)uselessConstructSpawnCard).sendOverNetwork = false;
			((SpawnCard)uselessConstructSpawnCard).prefab = uselessConstruct;
			GlobalEventManager.OnInteractionsGlobal += GlobalEventManager_OnInteractionsGlobal;
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
			Hidden.OnEnter += new hook_OnEnter(Hidden_OnEnter);
			Hidden.FixedUpdate += new hook_FixedUpdate(Hidden_FixedUpdate);
			Hidden.OnExit += new hook_OnExit(Hidden_OnExit);
			BaseHideState.OnExit += new hook_OnExit(BaseHideState_OnExit);
			Revealed.FixedUpdate += new hook_FixedUpdate(Revealed_FixedUpdate);
		}

		private void Revealed_FixedUpdate(orig_FixedUpdate orig, Revealed self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).characterBody.bodyIndex != uselessConstructBodyIndex)
			{
				orig.Invoke(self);
			}
		}

		private void BaseHideState_OnExit(orig_OnExit orig, BaseHideState self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).characterBody.bodyIndex != uselessConstructBodyIndex)
			{
				orig.Invoke(self);
			}
		}

		private void Hidden_OnExit(orig_OnExit orig, Hidden self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).characterBody.bodyIndex != uselessConstructBodyIndex)
			{
				orig.Invoke(self);
			}
		}

		private void Hidden_FixedUpdate(orig_FixedUpdate orig, Hidden self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).characterBody.bodyIndex != uselessConstructBodyIndex)
			{
				orig.Invoke(self);
			}
		}

		private void Hidden_OnEnter(orig_OnEnter orig, Hidden self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid