Decompiled source of MyOrbs v0.3.1

plugins/MyOrbs/MyOrbs.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using ExitGames.Client.Photon;
using HarmonyLib;
using MenuLib;
using MenuLib.MonoBehaviors;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Photon.Pun;
using Photon.Realtime;
using REPOLib.Modules;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("feedmore")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MyOrbs")]
[assembly: AssemblyTitle("MyOrbs")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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;
		}
	}
}
[HarmonyPatch(typeof(ItemBattery), "ChargeBattery")]
public static class ChargingStationPatch
{
	public static void Prefix(ItemBattery __instance, ref float __1)
	{
		if ((Object)(object)((Component)__instance).GetComponent<PinkHandgun>() != (Object)null || (Object)(object)((Component)__instance).GetComponent<PinkFryingPan>() != (Object)null || (Object)(object)((Component)__instance).GetComponent<PinkCartCannon>() != (Object)null || (Object)(object)((Component)__instance).GetComponent<PinkCartLaser>() != (Object)null)
		{
			__1 *= 1.2f;
		}
		else if ((Object)(object)((Component)__instance).GetComponent<BlueHandgun>() != (Object)null || (Object)(object)((Component)__instance).GetComponent<BlueFryingPan>() != (Object)null || (Object)(object)((Component)__instance).GetComponent<BlueCartCannon>() != (Object)null || (Object)(object)((Component)__instance).GetComponent<BlueCartLaser>() != (Object)null)
		{
			__1 *= 1.1f;
		}
	}
}
[HarmonyPatch(typeof(ItemGrenadeDuctTaped), "Explosion")]
public static class DuctTapedGrenadeExplosionPatch
{
	[HarmonyPostfix]
	public static void Postfix(ItemGrenadeDuctTaped __instance)
	{
		if ((Object)(object)((Component)__instance).GetComponent<PinkDuctTape>() != (Object)null)
		{
			Object.Destroy((Object)(object)((Component)__instance).GetComponent<PinkDuctTape>());
			ParticlePrefabExplosion val = Object.FindObjectOfType<ParticlePrefabExplosion>();
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogWarning((object)">>> [PinkDuctTapePatch] No explosion instance found.");
				return;
			}
			val.explosionDamageEnemy = 300;
			val.explosionSize = 1.2f;
			val.forceMultiplier = 6f;
			Debug.Log((object)">>> [PinkDuctTapePatch] First explosion overridden for PinkDuctTape");
		}
		else if ((Object)(object)((Component)__instance).GetComponent<BlueDuctTape>() != (Object)null)
		{
			Object.Destroy((Object)(object)((Component)__instance).GetComponent<BlueDuctTape>());
			ParticlePrefabExplosion val2 = Object.FindObjectOfType<ParticlePrefabExplosion>();
			if ((Object)(object)val2 == (Object)null)
			{
				Debug.LogWarning((object)">>> [BlueDuctTapePatch] No explosion instance found.");
				return;
			}
			val2.explosionDamageEnemy = 200;
			val2.explosionSize = 1f;
			val2.forceMultiplier = 5f;
			Debug.Log((object)">>> [BlueDuctTapePatch] First explosion overridden for BlueDuctTape");
		}
	}
}
public class EnemyDeathHandler : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <ReplaceOrbCoroutine>d__4 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public EnemyDeathHandler <>4__this;

		private string <visualBoneName>5__1;

		private Transform <visualRoot>5__2;

		private string <orbToSpawn>5__3;

		private Vector3 <spawnPos>5__4;

		private GameObject <orb>5__5;

		private EnemyWatcher.EnemyType <>s__6;

		private EnemyWatcher.EnemyType <>s__7;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ReplaceOrbCoroutine>d__4(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<visualBoneName>5__1 = null;
			<visualRoot>5__2 = null;
			<orbToSpawn>5__3 = null;
			<orb>5__5 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(0.2f);
				<>1__state = 1;
				return true;
			case 1:
			{
				<>1__state = -1;
				<>s__6 = <>4__this.enemyType;
				if (1 == 0)
				{
				}
				string text = <>s__6 switch
				{
					EnemyWatcher.EnemyType.DuckBlue => "ANIM ROT BOT", 
					EnemyWatcher.EnemyType.DuckPink => "ANIM ROT BOT", 
					EnemyWatcher.EnemyType.BabyBlue => "ANIM BOT", 
					EnemyWatcher.EnemyType.BabyPink => "ANIM BOT", 
					EnemyWatcher.EnemyType.RobeBlue => "Main Animation", 
					EnemyWatcher.EnemyType.RobePink => "Main Animation", 
					EnemyWatcher.EnemyType.UpScreamBlue => "ROOT", 
					EnemyWatcher.EnemyType.UpScreamPink => "ROOT", 
					EnemyWatcher.EnemyType.AnimalBlue => "Main Animation", 
					EnemyWatcher.EnemyType.AnimalPink => "Main Animation", 
					EnemyWatcher.EnemyType.TumblerBlue => "Mesh", 
					EnemyWatcher.EnemyType.TumblerPink => "Mesh", 
					EnemyWatcher.EnemyType.ThinManBlue => "Mesh Parent", 
					EnemyWatcher.EnemyType.ThinManPink => "Mesh Parent", 
					EnemyWatcher.EnemyType.SlowWalkerBlue => "[ANIM S&S BOT]", 
					EnemyWatcher.EnemyType.SlowWalkerPink => "[ANIM S&S BOT]", 
					EnemyWatcher.EnemyType.SlowMouthBlue => "Size Adjustment", 
					EnemyWatcher.EnemyType.SlowMouthPink => "Size Adjustment", 
					EnemyWatcher.EnemyType.RunnerBlue => "Mesh", 
					EnemyWatcher.EnemyType.RunnerPink => "Mesh", 
					EnemyWatcher.EnemyType.HunterBlue => "ANIM BOTTOM", 
					EnemyWatcher.EnemyType.HunterPink => "ANIM BOTTOM", 
					EnemyWatcher.EnemyType.HeadBlue => "Main Animation", 
					EnemyWatcher.EnemyType.HeadPink => "Main Animation", 
					_ => "ANIM ROT BOT", 
				};
				if (1 == 0)
				{
				}
				<visualBoneName>5__1 = text;
				<visualRoot>5__2 = ((Component)<>4__this).transform.FindDeepChild(<visualBoneName>5__1);
				<>s__7 = <>4__this.enemyType;
				if (1 == 0)
				{
				}
				text = <>s__7 switch
				{
					EnemyWatcher.EnemyType.DuckBlue => "BlueOrbSmall", 
					EnemyWatcher.EnemyType.DuckPink => "PinkOrbSmall", 
					EnemyWatcher.EnemyType.BabyBlue => "BlueOrbMedium", 
					EnemyWatcher.EnemyType.BabyPink => "PinkOrbMedium", 
					EnemyWatcher.EnemyType.RobeBlue => "BlueOrbBig", 
					EnemyWatcher.EnemyType.RobePink => "PinkOrbBig", 
					EnemyWatcher.EnemyType.UpScreamBlue => "BlueOrbMedium", 
					EnemyWatcher.EnemyType.UpScreamPink => "PinkOrbMedium", 
					EnemyWatcher.EnemyType.AnimalBlue => "BlueOrbMedium", 
					EnemyWatcher.EnemyType.AnimalPink => "PinkOrbMedium", 
					EnemyWatcher.EnemyType.TumblerBlue => "BlueOrbMedium", 
					EnemyWatcher.EnemyType.TumblerPink => "PinkOrbMedium", 
					EnemyWatcher.EnemyType.ThinManBlue => "BlueOrbSmall", 
					EnemyWatcher.EnemyType.ThinManPink => "PinkOrbSmall", 
					EnemyWatcher.EnemyType.SlowWalkerBlue => "BlueOrbBig", 
					EnemyWatcher.EnemyType.SlowWalkerPink => "PinkOrbBig", 
					EnemyWatcher.EnemyType.SlowMouthBlue => "BlueOrbSmall", 
					EnemyWatcher.EnemyType.SlowMouthPink => "PinkOrbSmall", 
					EnemyWatcher.EnemyType.RunnerBlue => "BlueOrbBig", 
					EnemyWatcher.EnemyType.RunnerPink => "PinkOrbBig", 
					EnemyWatcher.EnemyType.HunterBlue => "BlueOrbBig", 
					EnemyWatcher.EnemyType.HunterPink => "PinkOrbBig", 
					EnemyWatcher.EnemyType.HeadBlue => "BlueOrbBig", 
					EnemyWatcher.EnemyType.HeadPink => "PinkOrbBig", 
					_ => null, 
				};
				if (1 == 0)
				{
				}
				<orbToSpawn>5__3 = text;
				if (<orbToSpawn>5__3 == null)
				{
					Debug.LogWarning((object)(">>> No orb configured for duck type: " + <>4__this.enemyType));
					return false;
				}
				Transform obj = <visualRoot>5__2;
				<spawnPos>5__4 = ((obj != null) ? obj.position : ((Component)<>4__this).transform.position) + Vector3.up * 0.4f;
				Vector3 val = <spawnPos>5__4;
				Debug.Log((object)(">>> Using spawn position: " + ((object)(Vector3)(ref val)).ToString()));
				Debug.Log((object)(">>> Orb prefab to spawn: " + <orbToSpawn>5__3));
				<orb>5__5 = NetworkPrefabs.SpawnNetworkPrefab(<orbToSpawn>5__3, <spawnPos>5__4, Quaternion.identity, (byte)0, (object[])null);
				if ((Object)(object)<orb>5__5 != (Object)null)
				{
					Debug.Log((object)$">>> Spawned {<orbToSpawn>5__3} at {<spawnPos>5__4}");
				}
				else
				{
					Debug.LogError((object)(">>> Failed to spawn orb: " + <orbToSpawn>5__3));
				}
				return false;
			}
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <WaitForEnemyHealth>d__3 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public EnemyDeathHandler <>4__this;

		private float <timeout>5__1;

		private float <elapsed>5__2;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <WaitForEnemyHealth>d__3(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<timeout>5__1 = 5f;
				<elapsed>5__2 = 0f;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (<elapsed>5__2 < <timeout>5__1)
			{
				<>4__this.health = ((Component)<>4__this).GetComponentInChildren<EnemyHealth>();
				if ((Object)(object)<>4__this.health != (Object)null)
				{
					<>4__this.health.onDeath.AddListener(new UnityAction(<>4__this.OnEnemyDeath));
					Debug.Log((object)(">>> DeathHandler: Subscribed to onDeath for type: " + <>4__this.enemyType));
					return false;
				}
				<elapsed>5__2 += Time.deltaTime;
				<>2__current = null;
				<>1__state = 1;
				return true;
			}
			Debug.LogWarning((object)">>> DeathHandler: No EnemyHealth found after waiting.");
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public EnemyWatcher.EnemyType enemyType;

	private EnemyHealth? health;

	private void Start()
	{
		((MonoBehaviour)this).StartCoroutine(WaitForEnemyHealth());
	}

	[IteratorStateMachine(typeof(<WaitForEnemyHealth>d__3))]
	private IEnumerator WaitForEnemyHealth()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <WaitForEnemyHealth>d__3(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<ReplaceOrbCoroutine>d__4))]
	private IEnumerator ReplaceOrbCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ReplaceOrbCoroutine>d__4(0)
		{
			<>4__this = this
		};
	}

	private void OnEnemyDeath()
	{
		if (PhotonNetwork.IsMasterClient)
		{
			((MonoBehaviour)this).StartCoroutine(ReplaceOrbCoroutine());
		}
	}
}
[HarmonyPatch(typeof(EnemyDirector), "AmountSetup")]
public static class EnemySpawnPatch
{
	[HarmonyPrefix]
	public static bool Prefix(EnemyDirector __instance)
	{
		if (!PhotonNetwork.IsMasterClient)
		{
			return true;
		}
		int num = 7;
		int num2 = 7;
		int num3 = 7;
		int additionalEnemies = SavedUpgradesManager.state.additionalEnemies;
		for (int i = 0; i < additionalEnemies; i++)
		{
			float value = Random.value;
			if (value <= 0.35f)
			{
				num++;
			}
			else if (value <= 0.7f)
			{
				num2++;
			}
			else
			{
				num3++;
			}
		}
		List<EnemySetup> enemiesDifficulty = __instance.enemiesDifficulty1;
		List<EnemySetup> enemiesDifficulty2 = __instance.enemiesDifficulty2;
		List<EnemySetup> enemiesDifficulty3 = __instance.enemiesDifficulty3;
		FieldInfo field = typeof(EnemyDirector).GetField("enemyList", BindingFlags.Instance | BindingFlags.NonPublic);
		List<EnemySetup> list = (List<EnemySetup>)field.GetValue(__instance);
		list.Clear();
		for (int j = 0; j < num; j++)
		{
			list.Add(enemiesDifficulty[Random.Range(0, enemiesDifficulty.Count)]);
		}
		for (int k = 0; k < num2; k++)
		{
			list.Add(enemiesDifficulty2[Random.Range(0, enemiesDifficulty2.Count)]);
		}
		for (int l = 0; l < num3; l++)
		{
			float value2 = Random.value;
			EnemySetup item;
			if (value2 <= 0.15f)
			{
				List<EnemySetup> list2 = enemiesDifficulty3.Where((EnemySetup e) => ((Object)e).name.Contains("Group")).ToList();
				item = ((list2.Count > 0) ? list2[Random.Range(0, list2.Count)] : enemiesDifficulty3[Random.Range(0, enemiesDifficulty3.Count)]);
			}
			else
			{
				List<EnemySetup> list3 = enemiesDifficulty3.Where((EnemySetup e) => !((Object)e).name.Contains("Group")).ToList();
				item = ((list3.Count > 0) ? list3[Random.Range(0, list3.Count)] : enemiesDifficulty3[Random.Range(0, enemiesDifficulty3.Count)]);
			}
			list.Add(item);
		}
		__instance.totalAmount = num + num2 + num3;
		Debug.Log((object)$">>> EnemySpawnPatch: Final counts - T1: {num}, T2: {num2}, T3: {num3} (Total: {__instance.totalAmount})");
		return false;
	}
}
public class EnemyWatcher : MonoBehaviour
{
	public enum EnemyType
	{
		DuckBlue,
		DuckPink,
		BabyBlue,
		BabyPink,
		RobeBlue,
		RobePink,
		GnomeBlue,
		GnomePink,
		BangBlue,
		BangPink,
		UpScreamBlue,
		UpScreamPink,
		AnimalBlue,
		AnimalPink,
		TumblerBlue,
		TumblerPink,
		ThinManBlue,
		ThinManPink,
		SlowWalkerBlue,
		SlowWalkerPink,
		SlowMouthBlue,
		SlowMouthPink,
		RunnerBlue,
		RunnerPink,
		HunterBlue,
		HunterPink,
		HeadBlue,
		HeadPink
	}

	[CompilerGenerated]
	private sealed class <DelayedAttachDeathHandler>d__80 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public GameObject enemy;

		public EnemyType type;

		public EnemyWatcher <>4__this;

		private EnemyDeathHandler <handler>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <DelayedAttachDeathHandler>d__80(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<handler>5__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(1f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				if ((Object)(object)enemy != (Object)null && (Object)(object)enemy.GetComponent<EnemyDeathHandler>() == (Object)null)
				{
					<handler>5__1 = enemy.AddComponent<EnemyDeathHandler>();
					<handler>5__1.enemyType = type;
					<handler>5__1 = null;
				}
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private readonly HashSet<GameObject> knownDucks = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownBabies = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownRobes = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownGnomes = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownBangs = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownUpScreams = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownAnimals = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownTumblers = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownThinMans = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownSlowWalkers = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownSlowMouths = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownRunners = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownHunters = new HashSet<GameObject>();

	private readonly HashSet<GameObject> knownHeads = new HashSet<GameObject>();

	private Transform? EnemyParent;

	private const byte ShopPriceUpdateEventCode = 43;

	public const byte OrbValueUpdateEventCode = 44;

	private const byte DuckUpgradeEventCode = 42;

	private const byte BabyUpgradeEventCode = 45;

	private const byte RobeUpgradeEventCode = 46;

	private const byte GnomeUpgradeEventCode = 47;

	private const byte BangUpgradeEventCode = 48;

	private const byte UpScreamUpgradeEventCode = 49;

	private const byte AnimalUpgradeEventCode = 50;

	private const byte TumblerUpgradeEventCode = 51;

	private const byte ThinManUpgradeEventCode = 52;

	private const byte SlowWalkerUpgradeEventCode = 53;

	private const byte SlowMouthUpgradeEventCode = 54;

	private const byte RunnerUpgradeEventCode = 55;

	private const byte HunterUpgradeEventCode = 56;

	private const byte HeadUpgradeEventCode = 57;

	private static readonly string[] meshDuckNamesToReplace = new string[10] { "mesh Wing R", "mesh Wing L", "mesh Head", "mesh Body", "mesh Mon Body", "mesh Mon Wing L", "mesh Mon Wing R", "mesh Mon Head", "mesh Mon Beak top", "mesh Mon Beak Bot" };

	private static readonly string[] meshBabyNamesToReplace = new string[13]
	{
		"mesh body", "mesh arm r straight", "mesh arm r bent", "mesh arm l straight", "mesh arm l bent", "mesh head", "mesh eye", "mesh_eyes_top", "mesh eyes_bot", "mesh leg r straight",
		"mesh leg r bent", "mesh leg l bent", "mesh leg l straight"
	};

	private void OnEnable()
	{
		PhotonNetwork.NetworkingClient.EventReceived += OnPhotonEvent;
	}

	private void OnDisable()
	{
		PhotonNetwork.NetworkingClient.EventReceived -= OnPhotonEvent;
	}

	private void Update()
	{
		if ((Object)(object)EnemyParent == (Object)null)
		{
			GameObject val = GameObject.Find("Level Generator");
			if ((Object)(object)val != (Object)null)
			{
				Transform val2 = val.transform.Find("Enemies");
				if ((Object)(object)val2 != (Object)null)
				{
					EnemyParent = val2;
					Debug.Log((object)">>> EnemyWatcher found Enemies under Level Generator");
				}
			}
			return;
		}
		for (int i = 0; i < EnemyParent.childCount; i++)
		{
			Transform child = EnemyParent.GetChild(i);
			string name = ((Object)child).name;
			if (name.StartsWith("Enemy - Duck") && !knownDucks.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - DuckVerified";
				knownDucks.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num = Random.Range(0f, 1f);
					if (num <= 0.2f)
					{
						RaiseDuckUpgradeEvent(i, EnemyType.DuckPink);
					}
					else if (num <= 0.5f)
					{
						RaiseDuckUpgradeEvent(i, EnemyType.DuckBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Valuable Thrower") && !knownBabies.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - BabyVerified";
				knownBabies.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num2 = Random.Range(0f, 1f);
					if (num2 <= 0.2f)
					{
						RaiseBabyUpgradeEvent(i, EnemyType.BabyPink);
					}
					else if (num2 <= 0.5f)
					{
						RaiseBabyUpgradeEvent(i, EnemyType.BabyBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Robe") && !knownRobes.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - RobeVerified";
				knownRobes.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num3 = Random.Range(0f, 1f);
					if (num3 <= 0.2f)
					{
						RaiseRobeUpgradeEvent(i, EnemyType.RobePink);
					}
					else if (num3 <= 0.5f)
					{
						RaiseRobeUpgradeEvent(i, EnemyType.RobeBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Gnome") && !knownGnomes.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - GnomeVerified";
				knownGnomes.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num4 = Random.Range(0f, 1f);
					if (num4 <= 0.2f)
					{
						RaiseGnomeUpgradeEvent(i, EnemyType.GnomePink);
					}
					else if (num4 <= 0.5f)
					{
						RaiseGnomeUpgradeEvent(i, EnemyType.GnomeBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Bang") && !knownBangs.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - BangVerified";
				knownBangs.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num5 = Random.Range(0f, 1f);
					if (num5 <= 0.2f)
					{
						RaiseBangUpgradeEvent(i, EnemyType.BangPink);
					}
					else if (num5 <= 0.5f)
					{
						RaiseBangUpgradeEvent(i, EnemyType.BangBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Upscream") && !knownUpScreams.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - UpscreamVerified";
				knownUpScreams.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num6 = Random.Range(0f, 1f);
					if (num6 <= 0.2f)
					{
						RaiseUpScreamUpgradeEvent(i, EnemyType.UpScreamPink);
					}
					else if (num6 <= 0.5f)
					{
						RaiseUpScreamUpgradeEvent(i, EnemyType.UpScreamBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Animal") && !knownAnimals.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - AnimalVerified";
				knownAnimals.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num7 = Random.Range(0f, 1f);
					if (num7 <= 0.2f)
					{
						RaiseAnimalUpgradeEvent(i, EnemyType.AnimalPink);
					}
					else if (num7 <= 0.5f)
					{
						RaiseAnimalUpgradeEvent(i, EnemyType.AnimalBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Tumbler") && !knownTumblers.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - TumblerVerified";
				knownTumblers.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num8 = Random.Range(0f, 1f);
					if (num8 <= 0.2f)
					{
						RaiseTumblerUpgradeEvent(i, EnemyType.TumblerPink);
					}
					else if (num8 <= 0.5f)
					{
						RaiseTumblerUpgradeEvent(i, EnemyType.TumblerBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Thin Man") && !knownThinMans.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - ThinManVerified";
				knownThinMans.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num9 = Random.Range(0f, 1f);
					if (num9 <= 0.2f)
					{
						RaiseThinManUpgradeEvent(i, EnemyType.ThinManPink);
					}
					else if (num9 <= 0.5f)
					{
						RaiseThinManUpgradeEvent(i, EnemyType.ThinManBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Slow Walker") && !knownSlowWalkers.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - SlowWalkerVerified";
				knownSlowWalkers.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num10 = Random.Range(0f, 1f);
					if (num10 <= 0.2f)
					{
						RaiseSlowWalkerUpgradeEvent(i, EnemyType.SlowWalkerPink);
					}
					else if (num10 <= 0.5f)
					{
						RaiseSlowWalkerUpgradeEvent(i, EnemyType.SlowWalkerBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Slow Mouth") && !knownSlowMouths.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - SlowMouthVerified";
				knownSlowMouths.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num11 = Random.Range(0f, 1f);
					if (num11 <= 0.2f)
					{
						RaiseSlowMouthUpgradeEvent(i, EnemyType.SlowMouthPink);
					}
					else if (num11 <= 0.5f)
					{
						RaiseSlowMouthUpgradeEvent(i, EnemyType.SlowMouthBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Runner") && !knownRunners.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - RunnerVerified";
				knownRunners.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num12 = Random.Range(0f, 1f);
					if (num12 <= 0.2f)
					{
						RaiseRunnerUpgradeEvent(i, EnemyType.RunnerPink);
					}
					else if (num12 <= 0.5f)
					{
						RaiseRunnerUpgradeEvent(i, EnemyType.RunnerBlue);
					}
				}
			}
			else if (name.StartsWith("Enemy - Hunter") && !knownHunters.Contains(((Component)child).gameObject))
			{
				((Object)child).name = "Enemy - HunterVerified";
				knownHunters.Add(((Component)child).gameObject);
				if (PhotonNetwork.IsMasterClient)
				{
					float num13 = Random.Range(0f, 1f);
					if (num13 <= 0.2f)
					{
						RaiseHunterUpgradeEvent(i, EnemyType.HunterPink);
					}
					else if (num13 <= 0.5f)
					{
						RaiseHunterUpgradeEvent(i, EnemyType.HunterBlue);
					}
				}
			}
			else
			{
				if (!name.StartsWith("Enemy - Head") || knownHeads.Contains(((Component)child).gameObject))
				{
					continue;
				}
				((Object)child).name = "Enemy - HeadVerified";
				knownHeads.Add(((Component)child).gameObject);
				Debug.Log((object)">>> A Head enemy is on this level!");
				if (PhotonNetwork.IsMasterClient)
				{
					float num14 = Random.Range(0f, 1f);
					if (num14 <= 0.2f)
					{
						RaiseHeadUpgradeEvent(i, EnemyType.HeadPink);
						Debug.Log((object)$">>> Sent PinkHead upgrade for index {i}");
					}
					else if (num14 <= 0.5f)
					{
						RaiseHeadUpgradeEvent(i, EnemyType.HeadBlue);
						Debug.Log((object)$">>> Sent BlueHead upgrade for index {i}");
					}
				}
			}
		}
	}

	private void RaiseDuckUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)42, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseBabyUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)45, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseRobeUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)46, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseGnomeUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)47, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseBangUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)48, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseUpScreamUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)49, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseAnimalUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)50, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseTumblerUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)51, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseThinManUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)52, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseSlowWalkerUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)53, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseSlowMouthUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)54, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseRunnerUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)55, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseHunterUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)56, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void RaiseHeadUpgradeEvent(int index, EnemyType type)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		object[] array = new object[2]
		{
			index,
			(int)type
		};
		PhotonNetwork.RaiseEvent((byte)57, (object)array, new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		}, SendOptions.SendReliable);
	}

	private void OnPhotonEvent(EventData photonEvent)
	{
		if (photonEvent.Code == 42)
		{
			object[] array = (object[])photonEvent.CustomData;
			int index = (int)array[0];
			EnemyType type = (EnemyType)array[1];
			UpgradeDuckByIndex(index, type);
		}
		else if (photonEvent.Code == 43)
		{
			object[] array2 = (object[])photonEvent.CustomData;
			int num = (int)array2[0];
			int num2 = (int)array2[1];
			GameObject val = GameObject.Find("Level Generator");
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			Transform val2 = val.transform.Find("Items");
			if (!((Object)(object)val2 == (Object)null) && num < val2.childCount)
			{
				GameObject gameObject = ((Component)val2.GetChild(num)).gameObject;
				ItemAttributes component = gameObject.GetComponent<ItemAttributes>();
				if ((Object)(object)component != (Object)null)
				{
					component.value = num2;
					Debug.Log((object)$">>> Client applied synced price: '{((Object)gameObject).name}' = {num2}");
				}
			}
		}
		else if (photonEvent.Code == 44)
		{
			object[] array3 = (object[])photonEvent.CustomData;
			int num3 = (int)array3[0];
			float num4 = (float)array3[1];
			PhotonView val3 = PhotonView.Find(num3);
			if ((Object)(object)val3 != (Object)null)
			{
				ValuableObject component2 = ((Component)val3).GetComponent<ValuableObject>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.dollarValueOriginal = num4;
					component2.dollarValueCurrent = num4;
					Debug.Log((object)$">>> Synced orb value for '{((Object)((Component)val3).gameObject).name}': {num4}");
				}
			}
			else
			{
				Debug.LogWarning((object)(">>> OrbValue sync failed: PhotonView not found for ViewID " + num3));
			}
		}
		else if (photonEvent.Code == 45)
		{
			object[] array4 = (object[])photonEvent.CustomData;
			int index2 = (int)array4[0];
			EnemyType type2 = (EnemyType)array4[1];
			UpgradeBabyByIndex(index2, type2);
		}
		else if (photonEvent.Code == 46)
		{
			object[] array5 = (object[])photonEvent.CustomData;
			int index3 = (int)array5[0];
			EnemyType type3 = (EnemyType)array5[1];
			UpgradeRobeByIndex(index3, type3);
		}
		else if (photonEvent.Code == 47)
		{
			object[] array6 = (object[])photonEvent.CustomData;
			int index4 = (int)array6[0];
			EnemyType type4 = (EnemyType)array6[1];
			UpgradeGnomeByIndex(index4, type4);
		}
		else if (photonEvent.Code == 48)
		{
			object[] array7 = (object[])photonEvent.CustomData;
			int index5 = (int)array7[0];
			EnemyType type5 = (EnemyType)array7[1];
			UpgradeBangByIndex(index5, type5);
		}
		else if (photonEvent.Code == 49)
		{
			object[] array8 = (object[])photonEvent.CustomData;
			int index6 = (int)array8[0];
			EnemyType type6 = (EnemyType)array8[1];
			UpgradeUpScreamByIndex(index6, type6);
		}
		else if (photonEvent.Code == 50)
		{
			object[] array9 = (object[])photonEvent.CustomData;
			int index7 = (int)array9[0];
			EnemyType type7 = (EnemyType)array9[1];
			UpgradeAnimalByIndex(index7, type7);
		}
		else if (photonEvent.Code == 51)
		{
			object[] array10 = (object[])photonEvent.CustomData;
			int index8 = (int)array10[0];
			EnemyType type8 = (EnemyType)array10[1];
			UpgradeTumblerByIndex(index8, type8);
		}
		else if (photonEvent.Code == 52)
		{
			object[] array11 = (object[])photonEvent.CustomData;
			int index9 = (int)array11[0];
			EnemyType type9 = (EnemyType)array11[1];
			UpgradeThinManByIndex(index9, type9);
		}
		else if (photonEvent.Code == 53)
		{
			object[] array12 = (object[])photonEvent.CustomData;
			int index10 = (int)array12[0];
			EnemyType type10 = (EnemyType)array12[1];
			UpgradeSlowWalkerByIndex(index10, type10);
		}
		else if (photonEvent.Code == 54)
		{
			object[] array13 = (object[])photonEvent.CustomData;
			int index11 = (int)array13[0];
			EnemyType type11 = (EnemyType)array13[1];
			UpgradeSlowMouthByIndex(index11, type11);
		}
		else if (photonEvent.Code == 55)
		{
			object[] array14 = (object[])photonEvent.CustomData;
			int index12 = (int)array14[0];
			EnemyType type12 = (EnemyType)array14[1];
			UpgradeRunnerByIndex(index12, type12);
		}
		else if (photonEvent.Code == 56)
		{
			object[] array15 = (object[])photonEvent.CustomData;
			int index13 = (int)array15[0];
			EnemyType type13 = (EnemyType)array15[1];
			UpgradeHunterByIndex(index13, type13);
		}
		else if (photonEvent.Code == 57)
		{
			object[] array16 = (object[])photonEvent.CustomData;
			int index14 = (int)array16[0];
			EnemyType type14 = (EnemyType)array16[1];
			UpgradeHeadByIndex(index14, type14);
		}
	}

	private void UpgradeDuckByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyDuckVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeBabyByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyBabyVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeRobeByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyRobeVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeGnomeByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyGnomeVisuals(((Component)child).gameObject, type);
		}
	}

	private void UpgradeBangByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyBangVisuals(((Component)child).gameObject, type);
		}
	}

	private void UpgradeUpScreamByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyUpScreamVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeAnimalByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyAnimalVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeTumblerByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyTumblerVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeThinManByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyThinManVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeSlowWalkerByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplySlowWalkerVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeSlowMouthByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplySlowMouthVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeRunnerByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyRunnerVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeHunterByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyHunterVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
		}
	}

	private void UpgradeHeadByIndex(int index, EnemyType type)
	{
		if (!((Object)(object)EnemyParent == (Object)null) && index < EnemyParent.childCount)
		{
			Transform child = EnemyParent.GetChild(index);
			((Object)child).name = $"Enemy - {type}(Clone)";
			ApplyHeadVisuals(((Component)child).gameObject, type);
			if ((Object)(object)((Component)child).GetComponent<EnemyDeathHandler>() == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedAttachDeathHandler(((Component)child).gameObject, type));
			}
			Debug.Log((object)$">>> {type} upgraded via RaiseEvent (by index)");
		}
	}

	private void ApplyDuckVisuals(GameObject duck, EnemyType type)
	{
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_038f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0404: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		Material material = null;
		Material material2 = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.DuckBlue:
			material = MyOrbs.Instance?.blueDuckMaterial;
			material2 = MyOrbs.Instance?.blueDuckFeathers;
			val = MyOrbs.Instance?.blueDuckAuraPrefab;
			break;
		case EnemyType.DuckPink:
			material = MyOrbs.Instance?.pinkDuckMaterial;
			material2 = MyOrbs.Instance?.pinkDuckFeathers;
			val = MyOrbs.Instance?.pinkDuckAuraPrefab;
			val2 = MyOrbs.Instance?.pinkDuckAuraPrefab2;
			break;
		}
		string[] array = meshDuckNamesToReplace;
		foreach (string text in array)
		{
			Transform val3 = duck.transform.Find("Visuals/" + text) ?? duck.transform.FindDeepChild(text);
			if ((Object)(object)val3 != (Object)null)
			{
				Renderer component = ((Component)val3).GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material = material;
				}
			}
		}
		Transform val4 = duck.transform.Find("Particles/Feathers");
		if ((Object)(object)val4 != (Object)null)
		{
			ParticleSystemRenderer component2 = ((Component)val4).GetComponent<ParticleSystemRenderer>();
			if ((Object)(object)component2 != (Object)null)
			{
				((Renderer)component2).material = material2;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find Particles/Feathers for Duck");
		}
		Transform val5 = duck.transform.FindDeepChild("ANIM ROT BOT");
		Transform val6 = duck.transform.FindDeepChild("ANIM MON ROT BOT");
		Transform val7 = duck.transform.FindDeepChild("Controller");
		Transform val8 = duck.transform.FindDeepChild("Hurt Collider");
		EnemyHealth component3 = ((Component)val7).GetComponent<EnemyHealth>();
		HurtCollider component4 = ((Component)val8).GetComponent<HurtCollider>();
		component3.spawnValuable = false;
		if ((Object)(object)val5 != (Object)null && (Object)(object)val6 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.DuckBlue:
				if ((Object)(object)val5.Find("BlueDuckAuraEffect") == (Object)null)
				{
					component3.health = 225;
					component4.playerHitForce = 22.5f;
					component4.playerTumbleForce = 7.5f;
					component4.playerTumbleTorque = 7.5f;
					component4.enemyHitForce = 22.5f;
					component4.enemyHitTorque = 7.5f;
					GameObject val13 = Object.Instantiate<GameObject>(val, val5);
					GameObject val14 = Object.Instantiate<GameObject>(val, val6);
					val14.transform.localPosition = new Vector3(0f, -0.1417573f, 0f);
					val14.transform.localRotation = Quaternion.identity;
					val14.transform.localScale = new Vector3(0.4383981f, 0.3794659f, 0.3747339f);
				}
				break;
			case EnemyType.DuckPink:
				if ((Object)(object)val5.Find("PinkDuckAuraEffect") == (Object)null && (Object)(object)val5.Find("PinkDuckAuraEffect2") == (Object)null)
				{
					component3.health = 300;
					component4.playerTumbleForce = 10f;
					component4.playerTumbleTorque = 10f;
					component4.enemyHitForce = 30f;
					component4.enemyHitTorque = 10f;
					GameObject val9 = Object.Instantiate<GameObject>(val, val5);
					GameObject val10 = Object.Instantiate<GameObject>(val2, val5);
					GameObject val11 = Object.Instantiate<GameObject>(val, val6);
					GameObject val12 = Object.Instantiate<GameObject>(val2, val6);
					val11.transform.localPosition = new Vector3(0f, -0.1417573f, 0f);
					val11.transform.localRotation = Quaternion.identity;
					val11.transform.localScale = new Vector3(0.4383981f, 0.3794659f, 0.3747339f);
					val12.transform.localPosition = new Vector3(0f, 0f, 0f);
					val12.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f);
					val12.transform.localScale = new Vector3(1f, 1f, 1f);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find ANIM ROT BOT or ANIM MON ROT BOT to parent aura");
		}
	}

	private void ApplyBabyVisuals(GameObject baby, EnemyType type)
	{
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Expected O, but got Unknown
		//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0270: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_0283: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_031c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0320: Unknown result type (might be due to invalid IL or missing references)
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		Material material = null;
		Material material2 = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.BabyBlue:
			material = MyOrbs.Instance?.blueBabyMaterial;
			material2 = MyOrbs.Instance?.blueBabyEyesMaterial;
			val = MyOrbs.Instance?.blueBabyAuraPrefab;
			break;
		case EnemyType.BabyPink:
			material = MyOrbs.Instance?.pinkBabyMaterial;
			material2 = MyOrbs.Instance?.pinkBabyEyesMaterial;
			val = MyOrbs.Instance?.pinkBabyAuraPrefab;
			val2 = MyOrbs.Instance?.pinkBabyAuraPrefab2;
			break;
		}
		string[] array = meshBabyNamesToReplace;
		foreach (string text in array)
		{
			Transform val3 = baby.transform.Find("Visuals/" + text) ?? baby.transform.FindDeepChild(text);
			if (!((Object)(object)val3 != (Object)null))
			{
				continue;
			}
			Renderer component = ((Component)val3).GetComponent<Renderer>();
			if ((Object)(object)component != (Object)null)
			{
				if (((Object)val3).name == "mesh eye")
				{
					component.material = material2;
				}
				else
				{
					component.material = material;
				}
			}
		}
		Transform val4 = baby.transform.Find("Particles");
		if ((Object)(object)val4 != (Object)null)
		{
			Color white = default(Color);
			switch (type)
			{
			case EnemyType.BabyBlue:
				((Color)(ref white))..ctor(0f, 0.1f, 1f);
				break;
			case EnemyType.BabyPink:
				((Color)(ref white))..ctor(1f, 0f, 1f);
				break;
			default:
				white = Color.white;
				break;
			}
			Gradient val5 = new Gradient();
			val5.mode = (GradientMode)1;
			val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[1]
			{
				new GradientColorKey(white, 0f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[1]
			{
				new GradientAlphaKey(1f, 0f)
			});
			string[] array2 = new string[2] { "Bits", "Directional Bits" };
			string[] array3 = array2;
			foreach (string text2 in array3)
			{
				Transform val6 = val4.Find(text2);
				if ((Object)(object)val6 != (Object)null)
				{
					ParticleSystem component2 = ((Component)val6).GetComponent<ParticleSystem>();
					if ((Object)(object)component2 != (Object)null)
					{
						MainModule main = component2.main;
						((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(white);
						TrailModule trails = component2.trails;
						((TrailModule)(ref trails)).enabled = true;
						ColorOverLifetimeModule colorOverLifetime = component2.colorOverLifetime;
						((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
						((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val5);
						((TrailModule)(ref trails)).enabled = true;
						((TrailModule)(ref trails)).colorOverTrail = new MinMaxGradient(val5);
					}
				}
			}
			Transform val7 = val4.Find("Impact");
			if ((Object)(object)val7 != (Object)null)
			{
				ParticleSystem component3 = ((Component)val7).GetComponent<ParticleSystem>();
				if ((Object)(object)component3 != (Object)null)
				{
					MainModule main2 = component3.main;
					((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(white);
				}
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find Particles/Bits for Baby");
		}
		Transform val8 = baby.transform.FindDeepChild("ANIM BOT");
		Transform val9 = baby.transform.FindDeepChild("Controller");
		Transform val10 = baby.transform.Find("Enable/Visuals/Hurt Collider");
		EnemyHealth component4 = ((Component)val9).GetComponent<EnemyHealth>();
		component4.spawnValuable = false;
		if ((Object)(object)val8 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.BabyBlue:
				if ((Object)(object)val8.Find("BlueBabyAuraEffect") == (Object)null)
				{
					component4.health = 225;
					GameObject val13 = Object.Instantiate<GameObject>(val, val8);
				}
				break;
			case EnemyType.BabyPink:
				if ((Object)(object)val8.Find("PinkBabyAuraEffect") == (Object)null && (Object)(object)val8.Find("PinkBabyAuraEffect2") == (Object)null)
				{
					component4.health = 300;
					GameObject val11 = Object.Instantiate<GameObject>(val, val8);
					GameObject val12 = Object.Instantiate<GameObject>(val2, val8);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find ANIM ROT BOT or ANIM MON ROT BOT to parent aura");
		}
	}

	private void ApplyRobeVisuals(GameObject robe, EnemyType type)
	{
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: 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_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Expected O, but got Unknown
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0240: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0331: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_0340: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_034b: 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)
		Material material = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.RobeBlue:
			material = MyOrbs.Instance?.blueRobe;
			val = MyOrbs.Instance?.blueRobeAuraEffect;
			break;
		case EnemyType.RobePink:
			material = MyOrbs.Instance?.pinkRobe;
			val = MyOrbs.Instance?.pinkRobeAuraEffect;
			val2 = MyOrbs.Instance?.pinkRobeAuraEffect2;
			break;
		}
		string[] array = new string[7] { "Robe Hand Base", "Robe Hand Finger S", "Robe Hand Finger E", "Body Closed", "Body Open", "Body Attack", "Mesh" };
		string[] array2 = array;
		foreach (string name in array2)
		{
			foreach (Transform item in robe.transform.FindDeepChildren(name))
			{
				Renderer component = ((Component)item).GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material = material;
				}
			}
		}
		if (1 == 0)
		{
		}
		Color val3 = (Color)(type switch
		{
			EnemyType.RobeBlue => new Color(0f, 0.1f, 1f), 
			EnemyType.RobePink => new Color(1f, 0f, 1f), 
			_ => Color.white, 
		});
		if (1 == 0)
		{
		}
		Color val4 = val3;
		Gradient val5 = new Gradient();
		val5.mode = (GradientMode)1;
		val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[1]
		{
			new GradientColorKey(val4, 0f)
		}, (GradientAlphaKey[])(object)new GradientAlphaKey[1]
		{
			new GradientAlphaKey(1f, 0f)
		});
		string[] array3 = new string[2] { "Death Bits Far", "Death Bits Short" };
		string[] array4 = array3;
		foreach (string text in array4)
		{
			Transform val6 = robe.transform.Find("Particles/Death Particles/" + text);
			if ((Object)(object)val6 != (Object)null)
			{
				ParticleSystem component2 = ((Component)val6).GetComponent<ParticleSystem>();
				if ((Object)(object)component2 != (Object)null)
				{
					MainModule main = component2.main;
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val4);
					TrailModule trails = component2.trails;
					ColorOverLifetimeModule colorOverLifetime = component2.colorOverLifetime;
					((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val5);
					((TrailModule)(ref trails)).colorOverTrail = new MinMaxGradient(val5);
				}
			}
		}
		Transform val7 = robe.transform.Find("Particles/Death Particles/Death Impact");
		if ((Object)(object)val7 != (Object)null)
		{
			ParticleSystem component3 = ((Component)val7).GetComponent<ParticleSystem>();
			if ((Object)(object)component3 != (Object)null)
			{
				MainModule main2 = component3.main;
				((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(val4);
			}
		}
		Transform val8 = robe.transform.Find("Particles/Death Particles/Death Smoke");
		if ((Object)(object)val8 != (Object)null)
		{
			ParticleSystem component4 = ((Component)val8).GetComponent<ParticleSystem>();
			if ((Object)(object)component4 != (Object)null)
			{
				MainModule main3 = component4.main;
				((MainModule)(ref main3)).startColor = MinMaxGradient.op_Implicit(val4);
				ColorOverLifetimeModule colorOverLifetime2 = component4.colorOverLifetime;
				((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = new MinMaxGradient(val5);
			}
		}
		Transform val9 = robe.transform.Find("Enable/Visual/Spot Light");
		if ((Object)(object)val9 != (Object)null)
		{
			Light component5 = ((Component)val9).GetComponent<Light>();
			if ((Object)(object)component5 != (Object)null)
			{
				component5.color = val4;
			}
		}
		Transform val10 = robe.transform.Find("Enable/Controller");
		Transform val11 = robe.transform.Find("Enable/Visual/Main Animation/Hurt Collider");
		if ((Object)(object)val10 != (Object)null)
		{
			EnemyHealth component6 = ((Component)val10).GetComponent<EnemyHealth>();
			component6.spawnValuable = false;
			HurtCollider component7 = ((Component)val11).GetComponent<HurtCollider>();
			if ((Object)(object)component6 != (Object)null && (Object)(object)component7 != (Object)null)
			{
				switch (type)
				{
				case EnemyType.RobeBlue:
					component6.health = 375;
					component7.playerHitForce = 15f;
					break;
				case EnemyType.RobePink:
					component6.health = 500;
					component7.playerHitForce = 20f;
					break;
				}
			}
		}
		Transform val12 = robe.transform.Find("Enable/Visual/Main Animation");
		if ((Object)(object)val12 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.RobeBlue:
				if ((Object)(object)val12.Find("BlueRobeAuraEffect") == (Object)null)
				{
					GameObject val15 = Object.Instantiate<GameObject>(val, val12);
				}
				break;
			case EnemyType.RobePink:
				if ((Object)(object)val12.Find("PinkRobeAuraEffect") == (Object)null && (Object)(object)val12.Find("PinkRobeAuraEffect2") == (Object)null)
				{
					GameObject val13 = Object.Instantiate<GameObject>(val, val12);
					GameObject val14 = Object.Instantiate<GameObject>(val2, val12);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find Main Animation to parent aura");
		}
	}

	private void ApplyGnomeVisuals(GameObject gnome, EnemyType type)
	{
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Expected O, but got Unknown
		//IL_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0294: Unknown result type (might be due to invalid IL or missing references)
		//IL_0298: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: 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_02b2: Unknown result type (might be due to invalid IL or missing references)
		Material material = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.GnomeBlue:
			material = MyOrbs.Instance?.blueGnome;
			val = MyOrbs.Instance?.blueGnomeAuraEffect;
			break;
		case EnemyType.GnomePink:
			material = MyOrbs.Instance?.pinkGnome;
			val = MyOrbs.Instance?.pinkGnomeAuraEffect;
			val2 = MyOrbs.Instance?.pinkGnomeAuraEffect2;
			break;
		}
		string[] array = new string[5] { "mesh_body", "mesh_arm", "mesh_pickaxe", "mesh_arm", "mesh_head" };
		string[] array2 = array;
		foreach (string name in array2)
		{
			foreach (Transform item in gnome.transform.FindDeepChildren(name))
			{
				Renderer component = ((Component)item).GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material = material;
				}
			}
		}
		if (1 == 0)
		{
		}
		Color val3 = (Color)(type switch
		{
			EnemyType.GnomeBlue => new Color(0f, 0.1f, 1f), 
			EnemyType.GnomePink => new Color(1f, 0f, 1f), 
			_ => Color.white, 
		});
		if (1 == 0)
		{
		}
		Color val4 = val3;
		Gradient val5 = new Gradient();
		val5.mode = (GradientMode)1;
		val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[1]
		{
			new GradientColorKey(val4, 0f)
		}, (GradientAlphaKey[])(object)new GradientAlphaKey[1]
		{
			new GradientAlphaKey(1f, 0f)
		});
		string[] array3 = new string[2] { "Particle Bits Far", "Particle Bits Short" };
		string[] array4 = array3;
		foreach (string text in array4)
		{
			Transform val6 = gnome.transform.Find("Other/Death Effect/" + text);
			if ((Object)(object)val6 != (Object)null)
			{
				ParticleSystem component2 = ((Component)val6).GetComponent<ParticleSystem>();
				if ((Object)(object)component2 != (Object)null)
				{
					MainModule main = component2.main;
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val4);
				}
			}
		}
		Transform val7 = gnome.transform.Find("Other/Death Effect/Particle Smoke");
		if ((Object)(object)val7 != (Object)null)
		{
			ParticleSystem component3 = ((Component)val7).GetComponent<ParticleSystem>();
			if ((Object)(object)component3 != (Object)null)
			{
				MainModule main2 = component3.main;
				((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(val4);
				ColorOverLifetimeModule colorOverLifetime = component3.colorOverLifetime;
				((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val5);
			}
		}
		Transform val8 = gnome.transform.Find("Enable/Controller");
		Transform val9 = gnome.transform.Find("Enable/[VISUALS]/Hurt Collider");
		if ((Object)(object)val8 != (Object)null)
		{
			EnemyHealth component4 = ((Component)val8).GetComponent<EnemyHealth>();
			HurtCollider component5 = ((Component)val9).GetComponent<HurtCollider>();
			if ((Object)(object)component4 != (Object)null && (Object)(object)component5 != (Object)null)
			{
				switch (type)
				{
				case EnemyType.GnomeBlue:
					component4.health = 30;
					component5.playerHitForce = 15f;
					component5.playerTumbleForce = 7.5f;
					component5.playerTumbleTorque = 7.5f;
					break;
				case EnemyType.GnomePink:
					component4.health = 40;
					component5.playerHitForce = 20f;
					component5.playerTumbleForce = 10f;
					component5.playerTumbleTorque = 10f;
					break;
				}
			}
		}
		Transform val10 = gnome.transform.FindDeepChild("ANIM BOT");
		if ((Object)(object)val10 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.GnomeBlue:
				if ((Object)(object)val10.Find("BlueGnomeAuraEffect") == (Object)null)
				{
					GameObject val13 = Object.Instantiate<GameObject>(val, val10);
				}
				break;
			case EnemyType.GnomePink:
				if ((Object)(object)val10.Find("PinkGnomeAuraEffect") == (Object)null && (Object)(object)val10.Find("PinkGnomeAuraEffect2") == (Object)null)
				{
					GameObject val11 = Object.Instantiate<GameObject>(val, val10);
					GameObject val12 = Object.Instantiate<GameObject>(val2, val10);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find Main Animation to parent aura");
		}
	}

	private void ApplyBangVisuals(GameObject bang, EnemyType type)
	{
		//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_018a: 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_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Expected O, but got Unknown
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: 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_017d: 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_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_024c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		Material material = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.BangBlue:
			material = MyOrbs.Instance?.blueBang;
			val = MyOrbs.Instance?.blueBangAuraEffect;
			break;
		case EnemyType.BangPink:
			material = MyOrbs.Instance?.pinkBang;
			val = MyOrbs.Instance?.pinkBangAuraEffect;
			val2 = MyOrbs.Instance?.pinkBangAuraEffect2;
			break;
		}
		string[] array = new string[8] { "foot_mesh", "leg01_mesh", "leg02_mesh", "foot_mesh", "leg01_mesh", "leg02_mesh", "skull_mesh", "jaw_mesh" };
		string[] array2 = array;
		foreach (string name in array2)
		{
			foreach (Transform item in bang.transform.FindDeepChildren(name))
			{
				Renderer component = ((Component)item).GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material = material;
				}
			}
		}
		if (1 == 0)
		{
		}
		Color val3 = (Color)(type switch
		{
			EnemyType.BangBlue => new Color(0f, 0.1f, 1f), 
			EnemyType.BangPink => new Color(1f, 0f, 1f), 
			_ => Color.white, 
		});
		if (1 == 0)
		{
		}
		Color val4 = val3;
		Gradient val5 = new Gradient();
		val5.mode = (GradientMode)1;
		val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[1]
		{
			new GradientColorKey(val4, 0f)
		}, (GradientAlphaKey[])(object)new GradientAlphaKey[1]
		{
			new GradientAlphaKey(1f, 0f)
		});
		string[] array3 = new string[2] { "Particle Bits Far", "Particle Bits Short" };
		string[] array4 = array3;
		foreach (string text in array4)
		{
			Transform val6 = bang.transform.Find("Particles/Death Effect/" + text);
			if ((Object)(object)val6 != (Object)null)
			{
				ParticleSystem component2 = ((Component)val6).GetComponent<ParticleSystem>();
				if ((Object)(object)component2 != (Object)null)
				{
					MainModule main = component2.main;
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val4);
				}
			}
		}
		Transform val7 = bang.transform.Find("Particles/Death Effect/Particle Smoke");
		if ((Object)(object)val7 != (Object)null)
		{
			ParticleSystem component3 = ((Component)val7).GetComponent<ParticleSystem>();
			if ((Object)(object)component3 != (Object)null)
			{
				MainModule main2 = component3.main;
				((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(val4);
				ColorOverLifetimeModule colorOverLifetime = component3.colorOverLifetime;
				((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val5);
			}
		}
		Transform val8 = bang.transform.Find("Enable/Controller");
		if ((Object)(object)val8 != (Object)null)
		{
			EnemyHealth component4 = ((Component)val8).GetComponent<EnemyHealth>();
			ParticleScriptExplosion component5 = ((Component)val8).GetComponent<ParticleScriptExplosion>();
			if ((Object)(object)component4 != (Object)null)
			{
				switch (type)
				{
				case EnemyType.BangBlue:
					component4.health = 75;
					component5.explosionPreset = MyOrbs.Instance?.blueBangExplosion;
					break;
				case EnemyType.BangPink:
					component4.health = 100;
					component5.explosionPreset = MyOrbs.Instance?.pinkBangExplosion;
					break;
				}
			}
		}
		Transform val9 = bang.transform.FindDeepChild("[ANIM BOT]");
		if ((Object)(object)val9 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.BangBlue:
				if ((Object)(object)val9.Find("BlueBangAuraEffect") == (Object)null)
				{
					GameObject val12 = Object.Instantiate<GameObject>(val, val9);
				}
				break;
			case EnemyType.BangPink:
				if ((Object)(object)val9.Find("PinkBangAuraEffect") == (Object)null && (Object)(object)val9.Find("PinkBangAuraEffect2") == (Object)null)
				{
					GameObject val10 = Object.Instantiate<GameObject>(val, val9);
					GameObject val11 = Object.Instantiate<GameObject>(val2, val9);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find [ANIM BOT] to parent aura");
		}
	}

	private void ApplyUpScreamVisuals(GameObject upscream, EnemyType type)
	{
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: 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_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_0282: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Expected O, but got Unknown
		//IL_029c: 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_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_0343: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_034c: Unknown result type (might be due to invalid IL or missing references)
		//IL_034e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
		Material material = null;
		Material material2 = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.UpScreamBlue:
			material = MyOrbs.Instance?.blueUpScreamHead;
			material2 = MyOrbs.Instance?.blueUpScreamLegs;
			val = MyOrbs.Instance?.blueUpScreamAuraEffect;
			break;
		case EnemyType.UpScreamPink:
			material = MyOrbs.Instance?.pinkUpScreamHead;
			material2 = MyOrbs.Instance?.pinkUpScreamLegs;
			val = MyOrbs.Instance?.pinkUpScreamAuraEffect;
			val2 = MyOrbs.Instance?.pinkUpScreamAuraEffect2;
			break;
		}
		string[] array = new string[4] { "Upscream_Head - Mouth Closed", "Upscream_Head - Mouth Open", "eye_L", "eye_R" };
		string[] array2 = new string[12]
		{
			"leg back L1", "leg back L2", "leg back R1", "leg back R2", "leg front L1", "leg front L2", "leg front R1", "leg front R2", "leg back L3", "leg back R3",
			"leg front L3", "leg front R3"
		};
		string[] array3 = array;
		foreach (string name in array3)
		{
			foreach (Transform item in upscream.transform.FindDeepChildren(name))
			{
				Renderer component = ((Component)item).GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material = material;
				}
			}
		}
		string[] array4 = array2;
		foreach (string name2 in array4)
		{
			foreach (Transform item2 in upscream.transform.FindDeepChildren(name2))
			{
				Renderer component2 = ((Component)item2).GetComponent<Renderer>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.material = material2;
				}
			}
		}
		if (1 == 0)
		{
		}
		Color val3 = (Color)(type switch
		{
			EnemyType.UpScreamBlue => new Color(0f, 0.1f, 1f), 
			EnemyType.UpScreamPink => new Color(1f, 0f, 1f), 
			_ => Color.white, 
		});
		if (1 == 0)
		{
		}
		Color val4 = val3;
		Gradient val5 = new Gradient();
		val5.mode = (GradientMode)1;
		val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[1]
		{
			new GradientColorKey(val4, 0f)
		}, (GradientAlphaKey[])(object)new GradientAlphaKey[1]
		{
			new GradientAlphaKey(1f, 0f)
		});
		string[] array5 = new string[3] { "Particle Bits Far", "Particle Bits Short", "Death Impact" };
		string[] array6 = array5;
		foreach (string text in array6)
		{
			Transform val6 = upscream.transform.Find("Particles/" + text);
			if ((Object)(object)val6 != (Object)null)
			{
				ParticleSystem component3 = ((Component)val6).GetComponent<ParticleSystem>();
				if ((Object)(object)component3 != (Object)null)
				{
					MainModule main = component3.main;
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val4);
				}
			}
		}
		Transform val7 = upscream.transform.Find("Particles/Death Smoke");
		if ((Object)(object)val7 != (Object)null)
		{
			ParticleSystem component4 = ((Component)val7).GetComponent<ParticleSystem>();
			if ((Object)(object)component4 != (Object)null)
			{
				MainModule main2 = component4.main;
				((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(val4);
				ColorOverLifetimeModule colorOverLifetime = component4.colorOverLifetime;
				((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val5);
			}
		}
		Transform val8 = upscream.transform.Find("Enable/Controller");
		Transform val9 = upscream.transform.Find("Enable/Rigidbody/Mesh/Hurt Collider");
		if ((Object)(object)val8 != (Object)null)
		{
			EnemyHealth component5 = ((Component)val8).GetComponent<EnemyHealth>();
			component5.spawnValuable = false;
			HurtCollider component6 = ((Component)val9).GetComponent<HurtCollider>();
			if ((Object)(object)component5 != (Object)null)
			{
				switch (type)
				{
				case EnemyType.UpScreamBlue:
					component5.health = 75;
					component6.playerHitForce = 15f;
					component6.enemyHitForce = 15f;
					component6.enemyHitTorque = 12f;
					break;
				case EnemyType.UpScreamPink:
					component5.health = 100;
					component6.playerHitForce = 20f;
					component6.enemyHitForce = 20f;
					component6.enemyHitTorque = 16f;
					break;
				}
			}
		}
		Transform val10 = upscream.transform.FindDeepChild("ROOT");
		if ((Object)(object)val10 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.UpScreamBlue:
				if ((Object)(object)val10.Find("BlueUpScreamAuraEffect") == (Object)null)
				{
					GameObject val13 = Object.Instantiate<GameObject>(val, val10);
				}
				break;
			case EnemyType.UpScreamPink:
				if ((Object)(object)val10.Find("PinkUpScreamAuraEffect") == (Object)null && (Object)(object)val10.Find("PinkUpScreamAuraEffect2") == (Object)null)
				{
					GameObject val11 = Object.Instantiate<GameObject>(val, val10);
					GameObject val12 = Object.Instantiate<GameObject>(val2, val10);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find ROOT to parent aura");
		}
	}

	private void ApplyAnimalVisuals(GameObject animal, EnemyType type)
	{
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fa: Expected O, but got Unknown
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0235: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		Material material = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.AnimalBlue:
			material = MyOrbs.Instance?.blueAnimal;
			val = MyOrbs.Instance?.blueAnimalAuraEffect;
			break;
		case EnemyType.AnimalPink:
			material = MyOrbs.Instance?.pinkAnimal;
			val = MyOrbs.Instance?.pinkAnimalAuraEffect;
			val2 = MyOrbs.Instance?.pinkAnimalAuraEffect2;
			break;
		}
		string[] array = new string[19]
		{
			"Main Animation", "leg mid L1", "leg mid L2", "leg mid L3", "leg back L1", "leg back L2", "leg back L3", "leg back R1", "leg back R2", "leg back R3",
			"leg front L1", "leg front L2", "leg front L3", "leg front R1", "leg front R2", "leg front R3", "leg mid R1", "leg mid R2", "leg mid R3"
		};
		string[] array2 = array;
		foreach (string name in array2)
		{
			foreach (Transform item in animal.transform.FindDeepChildren(name))
			{
				Renderer component = ((Component)item).GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material = material;
				}
			}
		}
		if (1 == 0)
		{
		}
		Color val3 = (Color)(type switch
		{
			EnemyType.AnimalBlue => new Color(0f, 0.1f, 1f), 
			EnemyType.AnimalPink => new Color(1f, 0f, 1f), 
			_ => Color.white, 
		});
		if (1 == 0)
		{
		}
		Color val4 = val3;
		Gradient val5 = new Gradient();
		val5.mode = (GradientMode)1;
		val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[1]
		{
			new GradientColorKey(val4, 0f)
		}, (GradientAlphaKey[])(object)new GradientAlphaKey[1]
		{
			new GradientAlphaKey(1f, 0f)
		});
		string[] array3 = new string[4] { "Bits", "Directional Bits", "Dig", "Impact" };
		string[] array4 = array3;
		foreach (string text in array4)
		{
			Transform val6 = animal.transform.Find("Particles/" + text);
			if ((Object)(object)val6 != (Object)null)
			{
				ParticleSystem component2 = ((Component)val6).GetComponent<ParticleSystem>();
				if ((Object)(object)component2 != (Object)null)
				{
					MainModule main = component2.main;
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val4);
				}
			}
		}
		Transform val7 = animal.transform.Find("Enable/Controller");
		Transform val8 = animal.transform.Find("Enable/Rigidbody/Mesh/Main Animation/Hurt Collider");
		if ((Object)(object)val7 != (Object)null)
		{
			EnemyHealth component3 = ((Component)val7).GetComponent<EnemyHealth>();
			component3.spawnValuable = false;
			HurtCollider component4 = ((Component)val8).GetComponent<HurtCollider>();
			if ((Object)(object)component3 != (Object)null)
			{
				switch (type)
				{
				case EnemyType.AnimalBlue:
					component3.health = 225;
					component4.enemyHitForce = 15f;
					component4.enemyHitTorque = 12f;
					component4.playerHitForce = 15f;
					component4.playerTumbleForce = 12f;
					component4.playerTumbleTorque = 12f;
					break;
				case EnemyType.AnimalPink:
					component3.health = 300;
					component4.enemyHitForce = 20f;
					component4.enemyHitTorque = 16f;
					component4.playerHitForce = 20f;
					component4.playerTumbleForce = 16f;
					component4.playerTumbleTorque = 16f;
					break;
				}
			}
		}
		Transform val9 = animal.transform.FindDeepChild("Main Animation");
		if ((Object)(object)val9 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.AnimalBlue:
				if ((Object)(object)val9.Find("BlueAnimalAuraEffect") == (Object)null)
				{
					GameObject val12 = Object.Instantiate<GameObject>(val, val9);
				}
				break;
			case EnemyType.AnimalPink:
				if ((Object)(object)val9.Find("PinkAnimalAuraEffect") == (Object)null && (Object)(object)val9.Find("PinkAnimalAuraEffect2") == (Object)null)
				{
					GameObject val10 = Object.Instantiate<GameObject>(val, val9);
					GameObject val11 = Object.Instantiate<GameObject>(val2, val9);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find Main Animation to parent aura");
		}
	}

	private void ApplyTumblerVisuals(GameObject tumbler, EnemyType type)
	{
		//IL_01da: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Expected O, but got Unknown
		//IL_0226: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_036c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0371: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: Unknown result type (might be due to invalid IL or missing references)
		//IL_0377: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
		Material material = null;
		Material material2 = null;
		GameObject val = null;
		GameObject val2 = null;
		switch (type)
		{
		case EnemyType.TumblerBlue:
			material = MyOrbs.Instance?.blueTumbler;
			material2 = MyOrbs.Instance?.blueTumblerSlashTrail;
			val = MyOrbs.Instance?.blueTumblerAuraEffect;
			break;
		case EnemyType.TumblerPink:
			material = MyOrbs.Instance?.pinkTumbler;
			material2 = MyOrbs.Instance?.pinkTumblerSlashTrail;
			val = MyOrbs.Instance?.pinkTumblerAuraEffect;
			val2 = MyOrbs.Instance?.pinkTumblerAuraEffect2;
			break;
		}
		string[] array = new string[17]
		{
			"mesh arm_L_ROAM", "mesh arm_R_ROAM", "mesh arm_L_TELL", "mesh cleaver_L", "mesh arm_R_TELL", "mesh cleaver_R", "hat", "head_ROAM", "head_TELL", "mustasche",
			"mesh body", "mesh leg01_L", "mesh leg02_L", "mesh foot_L", "mesh leg01_R", "mesh leg02_R", "mesh foot_R"
		};
		string[] array2 = array;
		foreach (string name in array2)
		{
			foreach (Transform item in tumbler.transform.FindDeepChildren(name))
			{
				Renderer component = ((Component)item).GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material = material;
				}
			}
		}
		if (1 == 0)
		{
		}
		Color val3 = (Color)(type switch
		{
			EnemyType.TumblerBlue => new Color(0f, 0.1f, 1f), 
			EnemyType.TumblerPink => new Color(1f, 0f, 1f), 
			_ => Color.white, 
		});
		if (1 == 0)
		{
		}
		Color val4 = val3;
		Gradient val5 = new Gradient();
		val5.mode = (GradientMode)1;
		val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[1]
		{
			new GradientColorKey(val4, 0f)
		}, (GradientAlphaKey[])(object)new GradientAlphaKey[1]
		{
			new GradientAlphaKey(1f, 0f)
		});
		string[] array3 = new string[2] { "Swing Point_L", "Swing Point_R" };
		string[] array4 = array3;
		foreach (string name2 in array4)
		{
			foreach (Transform item2 in tumbler.transform.FindDeepChildren(name2))
			{
				TrailRenderer component2 = ((Component)item2).GetComponent<TrailRenderer>();
				if ((Object)(object)component2 != (Object)null)
				{
					((Renderer)component2).material = material2;
					component2.colorGradient = val5;
				}
			}
		}
		string[] array5 = new string[3] { "Death Bits Far", "Death Bits Short", "Death Impact" };
		string[] array6 = array5;
		foreach (string text in array6)
		{
			Transform val6 = tumbler.transform.Find("Particles/Death Particles/" + text);
			if ((Object)(object)val6 != (Object)null)
			{
				ParticleSystem component3 = ((Component)val6).GetComponent<ParticleSystem>();
				if ((Object)(object)component3 != (Object)null)
				{
					MainModule main = component3.main;
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val4);
				}
			}
		}
		Transform val7 = tumbler.transform.Find("Particles/Death Particles/Death Smoke");
		if ((Object)(object)val7 != (Object)null)
		{
			ParticleSystem component4 = ((Component)val7).GetComponent<ParticleSystem>();
			if ((Object)(object)component4 != (Object)null)
			{
				MainModule main2 = component4.main;
				((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(val4);
				ColorOverLifetimeModule colorOverLifetime = component4.colorOverLifetime;
				((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val5);
			}
		}
		Transform val8 = tumbler.transform.Find("Enable/Controller");
		Transform val9 = tumbler.transform.Find("Enable/[VISUALS]/Hurt Collider");
		if ((Object)(object)val8 != (Object)null)
		{
			EnemyHealth component5 = ((Component)val8).GetComponent<EnemyHealth>();
			component5.spawnValuable = false;
			HurtCollider component6 = ((Component)val9).GetComponent<HurtCollider>();
			if ((Object)(object)component5 != (Object)null)
			{
				switch (type)
				{
				case EnemyType.TumblerBlue:
					component5.health = 225;
					component6.playerHitForce = 3f;
					component6.playerTumbleForce = 22.5f;
					component6.playerTumbleTorque = 7.5f;
					component6.enemyHitForce = 15f;
					component6.enemyHitTorque = 30f;
					break;
				case EnemyType.TumblerPink:
					component5.health = 300;
					component6.playerHitForce = 4f;
					component6.playerTumbleForce = 30f;
					component6.playerTumbleTorque = 10f;
					component6.enemyHitForce = 20f;
					component6.enemyHitTorque = 40f;
					break;
				}
			}
		}
		Transform val10 = tumbler.transform.FindDeepChild("Mesh");
		if ((Object)(object)val10 != (Object)null)
		{
			switch (type)
			{
			case EnemyType.TumblerBlue:
				if ((Object)(object)val10.Find("BlueTumblerAuraEffect") == (Object)null)
				{
					GameObject val13 = Object.Instantiate<GameObject>(val, val10);
				}
				break;
			case EnemyType.TumblerPink:
				if ((Object)(object)val10.Find("PinkTumblerAuraEffect") == (Object)null && (Object)(object)val10.Find("PinkTumblerAuraEffect2") == (Object)null)
				{
					GameObject val11 = Object.Instantiate<GameObject>(val, val10);
					GameObject val12 = Object.Instantiate<GameObject>(val2, val10);
				}
				break;
			}
		}
		else
		{
			Debug.LogWarning((object)">>> Could not find [VISUALS] to parent aura");
		}
	}

	private void ApplyThinManVisuals(GameObject thinman, EnemyType type)
	{
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: 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_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_0229: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Expected O, but got Unknown
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_024a: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or