Decompiled source of Sonics Verse v0.1.3

BepinEx/plugins/ScriptsDLL.dll

Decompiled 9 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using ScriptsDLL.Behaviours;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ScriptsDLL")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ScriptsDLL")]
[assembly: AssemblyTitle("ScriptsDLL")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
public class FloatUpDown : MonoBehaviour
{
	public Transform centerPoint;

	public float minFloatRange = 0.01f;

	public float maxFloatRange = 0.07f;

	public float minFloatSpeed = 0.5f;

	public float maxFloatSpeed = 1.5f;

	private Vector3 initialPosition;

	private float floatRange;

	private float floatSpeed;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		initialPosition = ((Component)this).transform.position;
		Vector3.Distance(centerPoint.position, initialPosition);
		floatRange = Random.Range(minFloatRange, maxFloatRange);
		floatSpeed = Random.Range(minFloatSpeed, maxFloatSpeed);
	}

	private void Update()
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		float num = initialPosition.y + Mathf.Sin(Time.time * floatSpeed) * floatRange;
		Transform transform = ((Component)this).transform;
		Vector3 position = centerPoint.position;
		Vector3 val = ((Component)this).transform.position - centerPoint.position;
		transform.position = position + ((Vector3)(ref val)).normalized * floatRange;
		((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, num, ((Component)this).transform.position.z);
	}
}
public class Orbit : MonoBehaviour
{
	public Transform centerPoint;

	public float minOrbitSpeed = 1f;

	public float maxOrbitSpeed = 5f;

	public float minWiggleRoom = 0.1f;

	public float maxWiggleRoom = 1f;

	public float minWiggleSpeed = 0.5f;

	public float maxWiggleSpeed = 2f;

	public float minYRotationSpeed = 30f;

	public float maxYRotationSpeed = 90f;

	public MeshRenderer moonMeshRenderer;

	private Vector3 initialOffset;

	private float orbitSpeed;

	private float wiggleRoom;

	private float wiggleSpeed;

	private float rotationSpeed;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		initialOffset = ((Component)this).transform.position - centerPoint.position;
		orbitSpeed = Random.Range(minOrbitSpeed, maxOrbitSpeed);
		wiggleRoom = Random.Range(minWiggleRoom, maxWiggleRoom);
		wiggleSpeed = Random.Range(minWiggleSpeed, maxWiggleSpeed);
		rotationSpeed = Random.Range(minYRotationSpeed, maxYRotationSpeed);
		((Renderer)moonMeshRenderer).enabled = false;
	}

	private void Update()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = centerPoint.position + Quaternion.Euler(0f, Time.time * orbitSpeed, 0f) * initialOffset;
		float num = Mathf.Sin(Time.time * wiggleSpeed) * wiggleRoom;
		position.y += num;
		((Component)this).transform.position = position;
		((Component)this).transform.Rotate(Vector3.up, rotationSpeed * Time.deltaTime, (Space)1);
	}

	public void EnableMesh()
	{
		((Renderer)moonMeshRenderer).enabled = true;
	}
}
public class Ring : GrabbableObject
{
	public GameObject raycastOrigin;

	public override void ItemActivate(bool used, bool buttonDown = true)
	{
		PerformRaycastTriggerDetection();
	}

	private void PerformRaycastTriggerDetection()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)raycastOrigin == (Object)null)
		{
			Debug.LogError((object)"Raycast origin is not assigned!");
			return;
		}
		Vector3 position = raycastOrigin.transform.position;
		Vector3 forward = raycastOrigin.transform.forward;
		float num = 10f;
		RaycastHit val = default(RaycastHit);
		if (Physics.Raycast(position, forward, ref val, num) && ((RaycastHit)(ref val)).collider.isTrigger)
		{
			Debug.Log((object)"Raycast hit trigger collider!");
			GrabTheRingFunction(((Component)((RaycastHit)(ref val)).collider).gameObject);
		}
	}

	private void GrabTheRingFunction(GameObject objectHit)
	{
		Ring component = objectHit.GetComponent<Ring>();
		StatueItem component2 = objectHit.GetComponent<StatueItem>();
		if ((Object)(object)component != (Object)null)
		{
			Debug.Log((object)"Custom function called on the hit object!");
			component.BeingHit(component);
			DoingTheHitting();
		}
		if (Object.op_Implicit((Object)(object)component2))
		{
			component.StatueBeingHit(component2);
			DoingTheHitting();
		}
		else
		{
			Debug.Log((object)"No RingCollider script found on the hit object!");
		}
	}

	private void StatueBeingHit(StatueItem objectHit)
	{
		PhysicsProp thisItem = objectHit.thisItem;
		((GrabbableObject)thisItem).scrapValue = ((GrabbableObject)thisItem).scrapValue + base.scrapValue;
	}

	private void BeingHit(Ring objectHit)
	{
		((GrabbableObject)objectHit).scrapValue = ((GrabbableObject)objectHit).scrapValue + base.scrapValue;
		Debug.Log((object)$"{((GrabbableObject)objectHit).scrapValue} is the new value");
	}

	private void DoingTheHitting()
	{
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}
}
namespace ScriptsDLL
{
	[BepInPlugin("Drazuls-Sonic_Verse-0.1.3", "Sonic_Verse", "0.1.3")]
	public class SonicVersePlugin : BaseUnityPlugin
	{
		private const string GUID = "Drazuls-Sonic_Verse-0.1.3";

		private const string NAME = "Sonic_Verse";

		private const string VERSION = "0.1.3";

		public static SonicVersePlugin instance;

		private void Awake()
		{
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Expected O, but got Unknown
			//IL_0155: 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_016b: 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_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Expected O, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Expected O, but got Unknown
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Expected O, but got Unknown
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Expected O, but got Unknown
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Expected O, but got Unknown
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Expected O, but got Unknown
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Expected O, but got Unknown
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Expected O, but got Unknown
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Expected O, but got Unknown
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Expected O, but got Unknown
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Expected O, but got Unknown
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Expected O, but got Unknown
			instance = this;
			AssetBundle obj = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "verse_bundle"));
			Item val = obj.LoadAsset<Item>("Assets/Sonic_Verse/Sonic_statue/SonicsItem.asset");
			Item val2 = obj.LoadAsset<Item>("Assets/Sonic_Verse/Sonic_statue/SuperSonicsItem.asset");
			Item val3 = obj.LoadAsset<Item>("Assets/Sonic_Verse/Tails_Statue/Tails Item.asset");
			Item val4 = obj.LoadAsset<Item>("Assets/Sonic_Verse/Knuckles_Statue/Knuckles Item.asset");
			Item val5 = obj.LoadAsset<Item>("Assets/Sonic_Verse/Shadow/Shadow's Item.asset");
			Item val6 = obj.LoadAsset<Item>("Assets/Sonic_Verse/Rogue/Rogue's Item.asset");
			Item val7 = obj.LoadAsset<Item>("Assets/Sonic_Verse/Eggman/Eggman's Item.asset");
			Item val8 = obj.LoadAsset<Item>("Assets/Sonic_Verse/7 Chaos Emeralds/White_emerald_item.asset");
			Item val9 = obj.LoadAsset<Item>("Assets/Sonic_Verse/7 Chaos Emeralds/Yellow_emerald_item.asset");
			Item val10 = obj.LoadAsset<Item>("Assets/Sonic_Verse/7 Chaos Emeralds/Cyan_emerald_item.asset");
			Item val11 = obj.LoadAsset<Item>("Assets/Sonic_Verse/7 Chaos Emeralds/Pink_emerald_item.asset");
			Item val12 = obj.LoadAsset<Item>("Assets/Sonic_Verse/7 Chaos Emeralds/Purple_emerald_item.asset");
			Item val13 = obj.LoadAsset<Item>("Assets/Sonic_Verse/7 Chaos Emeralds/Red_emerald_item.asset");
			Item val14 = obj.LoadAsset<Item>("Assets/Sonic_Verse/7 Chaos Emeralds/Green_emerald_item.asset");
			Item val15 = obj.LoadAsset<Item>("Assets/Sonic_Verse/Ring/Ring's Item.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Utilities.FixMixerGroups(val2.spawnPrefab);
			Items.RegisterScrap(val2, 0, (LevelTypes)(-1));
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Utilities.FixMixerGroups(val.spawnPrefab);
			SpawnableMapObjectDef val16 = ScriptableObject.CreateInstance<SpawnableMapObjectDef>();
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val.spawnPrefab;
			AnimationCurve curve = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
			{
				new Keyframe(0f, 1f),
				new Keyframe(0.5f, 2f),
				new Keyframe(1f, 10f)
			});
			MapObjects.RegisterMapObject(val16, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve));
			NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
			Utilities.FixMixerGroups(val3.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val3.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
			Utilities.FixMixerGroups(val4.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val4.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
			Utilities.FixMixerGroups(val5.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val5.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab);
			Utilities.FixMixerGroups(val6.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val6.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val7.spawnPrefab);
			Utilities.FixMixerGroups(val7.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val7.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab);
			Utilities.FixMixerGroups(val8.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val8.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val9.spawnPrefab);
			Utilities.FixMixerGroups(val9.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val9.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val10.spawnPrefab);
			Utilities.FixMixerGroups(val10.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val10.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val11.spawnPrefab);
			Utilities.FixMixerGroups(val11.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val11.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val12.spawnPrefab);
			Utilities.FixMixerGroups(val12.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val12.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val13.spawnPrefab);
			Utilities.FixMixerGroups(val13.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val13.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val14.spawnPrefab);
			Utilities.FixMixerGroups(val14.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val14.spawnPrefab;
			NetworkPrefabs.RegisterNetworkPrefab(val15.spawnPrefab);
			Utilities.FixMixerGroups(val15.spawnPrefab);
			val16.spawnableMapObject = new SpawnableMapObject();
			val16.spawnableMapObject.prefabToSpawn = val15.spawnPrefab;
			TerminalNode val17 = ScriptableObject.CreateInstance<TerminalNode>();
			val17.clearPreviousText = true;
			val17.displayText = "This is Sonic\n\n";
			Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val17, 0);
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Drazuls-Sonic_Verse-0.1.3");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Added all objects to the game and shop!");
		}
	}
}
namespace ScriptsDLL.Behaviours
{
	public class FeedingObject : MonoBehaviour
	{
		public Collider feedingObjectCollider;

		[field: SerializeField]
		public EmeraldType WhatEmeraldIsIt { get; private set; }
	}
	public enum EmeraldType
	{
		Cyan,
		Green,
		White,
		Red,
		Yellow,
		Blue,
		Pink,
		Purple,
		None
	}
	public class StatueItem : MonoBehaviour
	{
		public PhysicsProp thisItem;

		public MeshRenderer cyanEmerald;

		public MeshRenderer greenEmerald;

		public MeshRenderer whiteEmerald;

		public MeshRenderer redEmerald;

		public MeshRenderer yellowEmerald;

		public MeshRenderer purpleEmerald;

		public MeshRenderer pinkEmerald;

		public MeshRenderer sonicmeshpolygon1;

		public MeshRenderer sonicmeshpolygon2;

		public MeshRenderer sonicmeshpolygon3;

		public MeshRenderer sonicmeshpolygon4;

		public MeshRenderer sonicmeshpolygon5;

		public MeshRenderer sonicmeshpolygon6;

		public MeshRenderer sonicmeshpolygon7;

		public MeshRenderer sonicmeshpolygon8;

		public MeshRenderer sonicmeshpolygon9;

		public MeshRenderer sonicmeshpolygon10;

		public ParticleSystem particleSystem;

		public MeshRenderer scyanEmerald;

		public MeshRenderer sgreenEmerald;

		public MeshRenderer swhiteEmerald;

		public MeshRenderer sredEmerald;

		public MeshRenderer syellowEmerald;

		public MeshRenderer spurpleEmerald;

		public MeshRenderer spinkEmerald;

		public Transform sonicsTransform;

		public Transform superWholeTransform;

		public Transform superSpecificTransform;

		public MeshRenderer sonicsmesh;

		public SkinnedMeshRenderer superSonicmesh;

		public SkinnedMeshRenderer superSonicmeshMouth;

		public GameObject sonicSNtag;

		public GameObject ssonicSNtag;

		public Collider triggerCollider;

		public AudioSource audioSource;

		public AudioClip superTransformation;

		private bool havegreenEmerald;

		private bool havewhiteEmerald;

		private bool haveredEmerald;

		private bool havecyanEmerald;

		private bool havepinkEmerald;

		private bool havepurpleEmerald;

		private bool haveyellowEmerald;

		private void Start()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			superWholeTransform.localScale = new Vector3(0.001f, 0.001f, 0.001f);
			superSpecificTransform.localScale = new Vector3(0.001f, 0.001f, 0.001f);
			((Renderer)superSonicmeshMouth).enabled = false;
			((Renderer)superSonicmesh).enabled = false;
			((Renderer)scyanEmerald).enabled = false;
			((Renderer)sgreenEmerald).enabled = false;
			((Renderer)swhiteEmerald).enabled = false;
			((Renderer)sredEmerald).enabled = false;
			((Renderer)syellowEmerald).enabled = false;
			((Renderer)spurpleEmerald).enabled = false;
			((Renderer)spinkEmerald).enabled = false;
			particleSystem.emissionRate = 0f;
			((Renderer)sonicmeshpolygon1).enabled = true;
			((Renderer)sonicmeshpolygon2).enabled = true;
			((Renderer)sonicmeshpolygon3).enabled = true;
			((Renderer)sonicmeshpolygon4).enabled = true;
			((Renderer)sonicmeshpolygon5).enabled = true;
			((Renderer)sonicmeshpolygon6).enabled = true;
			((Renderer)sonicmeshpolygon7).enabled = true;
			((Renderer)sonicmeshpolygon8).enabled = true;
			((Renderer)sonicmeshpolygon9).enabled = true;
			((Renderer)sonicmeshpolygon9).enabled = true;
		}

		public void OnTriggerEnter(Collider other)
		{
			FeedingObject component = ((Component)other).GetComponent<FeedingObject>();
			if ((Object)(object)component != (Object)null)
			{
				if (component.WhatEmeraldIsIt == EmeraldType.Cyan && !havecyanEmerald)
				{
					TheThing(other, ref havecyanEmerald, cyanEmerald);
				}
				if (component.WhatEmeraldIsIt == EmeraldType.Green && !havegreenEmerald)
				{
					TheThing(other, ref havegreenEmerald, greenEmerald);
				}
				if (component.WhatEmeraldIsIt == EmeraldType.White && !havewhiteEmerald)
				{
					TheThing(other, ref havewhiteEmerald, whiteEmerald);
				}
				if (component.WhatEmeraldIsIt == EmeraldType.Red && !haveredEmerald)
				{
					TheThing(other, ref haveredEmerald, redEmerald);
				}
				if (component.WhatEmeraldIsIt == EmeraldType.Pink && !havepinkEmerald)
				{
					TheThing(other, ref havepinkEmerald, pinkEmerald);
				}
				if (component.WhatEmeraldIsIt == EmeraldType.Purple && !havepurpleEmerald)
				{
					TheThing(other, ref havepurpleEmerald, purpleEmerald);
				}
				if (component.WhatEmeraldIsIt == EmeraldType.Yellow && !haveyellowEmerald)
				{
					TheThing(other, ref haveyellowEmerald, yellowEmerald);
				}
			}
		}

		public void TheThing(Collider other, ref bool booleanEntered, MeshRenderer gameObject)
		{
			booleanEntered = true;
			((Renderer)gameObject).enabled = true;
			((Component)gameObject).tag = "Untagged";
			PhysicsProp obj = thisItem;
			((GrabbableObject)obj).scrapValue = ((GrabbableObject)obj).scrapValue + 150;
			CheckAllFunction();
			Object.Destroy((Object)(object)((Component)((Component)other).transform.parent).gameObject);
		}

		private void CheckAllFunction()
		{
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			if (havecyanEmerald && havegreenEmerald && havepinkEmerald && havepurpleEmerald && haveredEmerald && havewhiteEmerald && haveyellowEmerald)
			{
				Object.Destroy((Object)(object)sonicSNtag);
				ssonicSNtag.layer = 22;
				((Renderer)greenEmerald).enabled = false;
				((Component)greenEmerald).tag = "DoNotSet";
				((Renderer)whiteEmerald).enabled = false;
				((Component)whiteEmerald).tag = "DoNotSet";
				((Renderer)redEmerald).enabled = false;
				((Component)redEmerald).tag = "DoNotSet";
				((Renderer)cyanEmerald).enabled = false;
				((Component)cyanEmerald).tag = "DoNotSet";
				((Renderer)pinkEmerald).enabled = false;
				((Component)pinkEmerald).tag = "DoNotSet";
				((Renderer)purpleEmerald).enabled = false;
				((Component)purpleEmerald).tag = "DoNotSet";
				((Renderer)yellowEmerald).enabled = false;
				((Component)yellowEmerald).tag = "DoNotSet";
				sonicsTransform.localScale = new Vector3(0.001f, 0.001f, 0.001f);
				((Renderer)sonicmeshpolygon1).enabled = false;
				((Renderer)sonicmeshpolygon2).enabled = false;
				((Renderer)sonicmeshpolygon3).enabled = false;
				((Renderer)sonicmeshpolygon4).enabled = false;
				((Renderer)sonicmeshpolygon5).enabled = false;
				((Renderer)sonicmeshpolygon6).enabled = false;
				((Renderer)sonicmeshpolygon7).enabled = false;
				((Renderer)sonicmeshpolygon8).enabled = false;
				((Renderer)sonicmeshpolygon9).enabled = false;
				((Renderer)sonicmeshpolygon10).enabled = false;
				superWholeTransform.localScale = new Vector3(0.14f, 0.14f, 0.14f);
				superSpecificTransform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
				((Renderer)sgreenEmerald).enabled = true;
				((Component)sgreenEmerald).tag = "Untagged";
				((Renderer)swhiteEmerald).enabled = true;
				((Component)swhiteEmerald).tag = "Untagged";
				((Renderer)sredEmerald).enabled = true;
				((Component)sredEmerald).tag = "Untagged";
				((Renderer)scyanEmerald).enabled = true;
				((Component)scyanEmerald).tag = "Untagged";
				((Renderer)spinkEmerald).enabled = true;
				((Component)spinkEmerald).tag = "Untagged";
				((Renderer)spurpleEmerald).enabled = true;
				((Component)spurpleEmerald).tag = "Untagged";
				((Renderer)syellowEmerald).enabled = true;
				((Component)syellowEmerald).tag = "Untagged";
				((Renderer)superSonicmesh).enabled = true;
				((Renderer)superSonicmeshMouth).enabled = true;
				particleSystem.emissionRate = 400f;
				audioSource.PlayOneShot(superTransformation, 1f);
				PhysicsProp obj = thisItem;
				((GrabbableObject)obj).scrapValue = ((GrabbableObject)obj).scrapValue * 2;
			}
		}
	}
}