Decompiled source of Crocs Inspired REPO Experience v1.1.0

CrocsLevel2.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using REPOLib.Modules;
using REPOLib.Objects.Sdk;
using UnityEngine;

[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: AssemblyCompany("Magic_Wesley")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("Copyright © 2025 Magic_Wesley")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CrocsLevel")]
[assembly: AssemblyTitle("CrocsLevel")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CrocsLevel
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "CrocsLevel";

		public const string PLUGIN_NAME = "CrocsLevel";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace CrocsLevel.LevelItems
{
	internal class BombCroc : MonoBehaviour
	{
		public GameObject explosionPrefab;

		public Transform explosionPosition;

		public void explode()
		{
			Object.Instantiate<GameObject>(explosionPrefab, explosionPosition);
		}
	}
	internal class FireCroc : MonoBehaviour
	{
		private PhysGrabObject PhysGrabObject;

		public List<ParticleSystem> particles;

		public AudioSource AudioSource;

		public float maxAudioVolume;

		private bool playing;

		private void Awake()
		{
			PhysGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
		}

		private void Update()
		{
			if (PhysGrabObject.grabbed)
			{
				if (!playing)
				{
					playing = true;
					foreach (ParticleSystem particle in particles)
					{
						particle.Play();
					}
				}
				if (AudioSource.volume < maxAudioVolume)
				{
					AudioSource audioSource = AudioSource;
					audioSource.volume += 0.05f;
				}
			}
			else
			{
				if (playing)
				{
					playing = false;
					foreach (ParticleSystem particle2 in particles)
					{
						particle2.Stop();
					}
				}
				if (AudioSource.volume > 0f)
				{
					AudioSource audioSource2 = AudioSource;
					audioSource2.volume -= 0.05f;
				}
			}
			if (PhysGrabObject.grabbedLocal)
			{
				PlayerAvatar instance = PlayerAvatar.instance;
				PlayerController instance2 = PlayerController.instance;
				instance2.OverrideSpeed(1.4f, 0.1f);
				instance2.OverrideLookSpeed(1.4f, 0.5f, 1f, 0.1f);
				instance2.OverrideAnimationSpeed(1f, 0.5f, 1f, 0.1f);
				instance2.OverrideTimeScale(1.4f, 0.1f);
				PhysGrabObject.OverrideTorqueStrength(1.2f, 0.1f);
			}
		}
	}
	internal class GlitterCroc : MonoBehaviour
	{
		private PhysGrabObject PhysGrabObject;

		public List<ParticleSystem> particles;

		public AudioSource AudioSource;

		public float maxAudioVolume;

		private bool playing;

		private void Awake()
		{
			PhysGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
		}

		private void Update()
		{
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			if (PhysGrabObject.grabbed)
			{
				if (!playing)
				{
					playing = true;
					foreach (ParticleSystem particle in particles)
					{
						particle.Play();
					}
				}
				if (AudioSource.volume < maxAudioVolume)
				{
					AudioSource audioSource = AudioSource;
					audioSource.volume += 0.05f;
				}
			}
			else
			{
				if (playing)
				{
					playing = false;
					foreach (ParticleSystem particle2 in particles)
					{
						particle2.Stop();
					}
				}
				if (AudioSource.volume > 0f)
				{
					AudioSource audioSource2 = AudioSource;
					audioSource2.volume -= 0.05f;
				}
			}
			if (PhysGrabObject.grabbedLocal)
			{
				PlayerAvatar instance = PlayerAvatar.instance;
				instance.OverridePupilSize(3f, 4, 1f, 1f, 1f, 4f, 0.5f);
				PostProcessing.Instance.SaturationOverride(70f, 0.1f, 0.5f, 0.1f, ((Component)this).gameObject);
				PostProcessing.Instance.VignetteOverride(Color.magenta, 1f, 0.2f, 1f, 1f, 1f, ((Component)this).gameObject);
			}
		}
	}
	internal class GrowCroc : MonoBehaviour
	{
		public Light Light;

		public Transform crocObject;

		public Sound growthSound;

		private PhysGrabObject PhysGrabObject;

		private float scale;

		private float lightLevel;

		private bool playedSound;

		private void Awake()
		{
			scale = 1f;
			lightLevel = 0f;
			PhysGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
		}

		private void Update()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			if (PhysGrabObject.grabbed)
			{
				if (!playedSound)
				{
					playedSound = true;
					growthSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
				}
				if (lightLevel < 2f)
				{
					lightLevel += 0.03f;
				}
				scale += 0.0005f;
			}
			else
			{
				if (playedSound)
				{
					playedSound = false;
				}
				if (lightLevel > 0f)
				{
					lightLevel -= 0.03f;
				}
			}
			Vector3 localScale = default(Vector3);
			((Vector3)(ref localScale))..ctor(scale, scale, scale);
			((Component)crocObject).transform.localScale = localScale;
			Light.intensity = lightLevel;
		}
	}
	internal class ShockCroc : MonoBehaviour
	{
		public MeshRenderer renderer;

		public Material shock1;

		public Material shock2;

		public Material shock3;

		public Material shock4;

		public AudioSource shockambient;

		public GameObject explosionPrefab;

		public GameObject shockDamage;

		private float shockDamageScale;

		public Transform explosionPoint;

		private PhysGrabObject PhysGrabObject;

		public List<ParticleSystem> particles;

		public List<ParticleSystem> powerUpParticles;

		public List<ParticleSystem> shockSplosionParticles;

		public Sound explosionSound;

		public Sound powerUp;

		public Sound powerDown;

		private float holdTimer;

		private void Awake()
		{
			PhysGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
		}

		private void Update()
		{
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			if (PhysGrabObject.grabbed)
			{
				if (holdTimer < 8f)
				{
					holdTimer += Time.deltaTime;
				}
				else
				{
					zapsplode();
					holdTimer = 0f;
				}
			}
			else if (holdTimer > 0f)
			{
				holdTimer -= Time.deltaTime * 2f;
			}
			charge();
			if (shockDamageScale > 0f)
			{
				shockDamageScale -= Time.deltaTime * 4f;
			}
			Vector3 localScale = default(Vector3);
			((Vector3)(ref localScale))..ctor(shockDamageScale, shockDamageScale, shockDamageScale);
			shockDamage.transform.localScale = localScale;
		}

		private void zapsplode()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			foreach (ParticleSystem shockSplosionParticle in shockSplosionParticles)
			{
				shockSplosionParticle.Play();
			}
			explosionSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
			Object.Instantiate<GameObject>(explosionPrefab, explosionPoint);
			shockDamageScale = 4f;
		}

		private void charge()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			shockambient.volume = 0.125f * holdTimer;
			shockambient.pitch = 0.5f + 0.125f * holdTimer;
			foreach (ParticleSystem particle in particles)
			{
				EmissionModule emission = particle.emission;
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(5f * holdTimer);
			}
			chargeLevel();
		}

		private void chargeLevel()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			Material sharedMaterial = ((Renderer)renderer).sharedMaterial;
			if (holdTimer >= 6f)
			{
				if (!((Object)(object)sharedMaterial != (Object)(object)shock4))
				{
					return;
				}
				if ((Object)(object)sharedMaterial == (Object)(object)shock3)
				{
					powerUp.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
					foreach (ParticleSystem powerUpParticle in powerUpParticles)
					{
						powerUpParticle.Play();
					}
				}
				((Renderer)renderer).material = shock4;
			}
			else if (holdTimer >= 4f)
			{
				if (!((Object)(object)sharedMaterial != (Object)(object)shock3))
				{
					return;
				}
				if ((Object)(object)sharedMaterial == (Object)(object)shock2)
				{
					powerUp.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
					foreach (ParticleSystem powerUpParticle2 in powerUpParticles)
					{
						powerUpParticle2.Play();
					}
				}
				else if ((Object)(object)sharedMaterial == (Object)(object)shock4)
				{
					powerDown.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
				}
				((Renderer)renderer).material = shock3;
			}
			else if (holdTimer >= 2f)
			{
				if (!((Object)(object)sharedMaterial != (Object)(object)shock2))
				{
					return;
				}
				if ((Object)(object)sharedMaterial == (Object)(object)shock1)
				{
					powerUp.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
					foreach (ParticleSystem powerUpParticle3 in powerUpParticles)
					{
						powerUpParticle3.Play();
					}
				}
				else if ((Object)(object)sharedMaterial == (Object)(object)shock3)
				{
					powerDown.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
				}
				((Renderer)renderer).material = shock2;
			}
			else if ((Object)(object)sharedMaterial != (Object)(object)shock1)
			{
				if ((Object)(object)sharedMaterial == (Object)(object)shock2)
				{
					powerDown.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
				}
				((Renderer)renderer).material = shock1;
			}
		}
	}
}
namespace WesleysLevels
{
	[BepInPlugin("CrocsLevel", "CrocsLevel", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class CrocsLevel : BaseUnityPlugin
	{
		private void Awake()
		{
			string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			string text = Path.Combine(directoryName, "crocslevel");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			LevelContent val2 = val.LoadAsset<LevelContent>("StoreLevelContent");
			Levels.RegisterLevel(val2);
			List<string> list = new List<string>
			{
				"Valuable Box", "Valuable Cap", "Valuable CapDisplay", "Valuable Croc", "Valuable Crochead", "Valuable GlassBox", "Valuable Head", "Valuable Id", "Valuable LargeCroc", "Valuable Mannequin",
				"Valuable Mirror", "Valuable Mug", "Valuable ShoeDisplay", "Valuable ShoeHolder", "Valuable ShoeRack", "Valuable ShoppingBasket", "Valuable TallDisplay", "Valuable BombCroc", "Valuable CrocBlue", "Valuable CrocRed",
				"Valuable CrocYellow", "Valuable FireCroc", "Valuable GlitterCroc", "Valuable GrowCroc", "Valuable HugeCroc", "Valuable LargeTimeCroc", "Valuable ShockCroc", "Valuable TentaCroc"
			};
			List<string> list2 = new List<string> { "Valuables - Store" };
			foreach (string item in list)
			{
				Valuables.RegisterValuable(val.LoadAsset<GameObject>(item), list2);
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}