Decompiled source of L86LSW v1.2.0

L86LSW.dll

Decompiled 4 months ago
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class PlaySound : MonoBehaviour
{
	public AudioSource audioSource;

	public void PlayButtonSound()
	{
		if ((Object)(object)audioSource != (Object)null)
		{
			audioSource.Play();
		}
	}
}
namespace Volksterism.L86LSW;

[BepInPlugin("Volksterism.L86LSW", "L86LSW", "1.2.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class L86LSWPlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	internal static ManualLogSource Logger;

	private void Awake()
	{
		Logger = ((BaseUnityPlugin)this).Logger;
		LoadAssets();
	}

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volksterism.L86LSW");
		OtherLoader.RegisterDirectLoad(BasePath, "Volksterism.L86LSW", "", "", "l86lsw", "");
	}
}
public class BouncingObject : MonoBehaviour
{
	public float bounceForce = 10f;

	public float bounceInterval = 0.5f;

	public float bounceDuration = 5f;

	public Vector3 randomDirectionRange = new Vector3(1f, 1f, 1f);

	private Rigidbody rb;

	private float bounceTimer = 0f;

	private float durationTimer = 0f;

	private void Start()
	{
		rb = ((Component)this).GetComponent<Rigidbody>();
		if ((Object)(object)rb == (Object)null)
		{
			Debug.LogError((object)"Rigidbody component not found. Please add a Rigidbody component to this object.");
			((Behaviour)this).enabled = false;
		}
	}

	private void Update()
	{
		if (!((Behaviour)this).enabled)
		{
			return;
		}
		durationTimer += Time.deltaTime;
		if (durationTimer >= bounceDuration)
		{
			((Behaviour)this).enabled = false;
			return;
		}
		bounceTimer += Time.deltaTime;
		if (bounceTimer >= bounceInterval)
		{
			Bounce();
			bounceTimer = 0f;
		}
	}

	private void Bounce()
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: 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)
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(Random.Range(0f - randomDirectionRange.x, randomDirectionRange.x), Random.Range(0.5f, 1f), Random.Range(0f - randomDirectionRange.z, randomDirectionRange.z));
		Vector3 normalized = ((Vector3)(ref val)).normalized;
		rb.AddForce(normalized * bounceForce, (ForceMode)1);
	}
}
public class HelicopterBlade1 : MonoBehaviour
{
	public float rotationSpeed = 1000f;

	private bool isRotating = false;

	private void Update()
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)32))
		{
			ToggleRotation();
		}
		if (isRotating)
		{
			((Component)this).transform.Rotate(Vector3.up, rotationSpeed * Time.deltaTime);
		}
	}

	private void ToggleRotation()
	{
		isRotating = !isRotating;
		if (isRotating)
		{
			Debug.Log((object)"Helicopter blades started rotating.");
		}
		else
		{
			Debug.Log((object)"Helicopter blades stopped rotating.");
		}
	}
}
public class HelicopterBladeH3VR : MonoBehaviour
{
	public float rotationSpeed = 2500f;

	private void Update()
	{
	}
}
[Serializable]
public class ArmSettings
{
	public Transform armTransform;

	public Vector3 extendedRotation;
}
public class HelicopterControl : MonoBehaviour
{
	public Transform[] bladeTransforms;

	public float rotationSpeed = 1000f;

	public ArmSettings[] armSettings;

	public float extensionSpeed = 1f;

	public float forwardSpeed = 10f;

	private bool isMovingForward = false;

	private bool isActivated = false;

	private Vector3[] initialRotations;

	private void Start()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		initialRotations = (Vector3[])(object)new Vector3[armSettings.Length];
		for (int i = 0; i < armSettings.Length; i++)
		{
			ref Vector3 reference = ref initialRotations[i];
			reference = armSettings[i].armTransform.localEulerAngles;
		}
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)32))
		{
			isActivated = !isActivated;
		}
		if (isActivated)
		{
			ExtendArms();
			RotateBlades();
			MoveForward();
		}
		else
		{
			RetractArms();
			StopMoving();
		}
	}

	private void ExtendArms()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < armSettings.Length; i++)
		{
			armSettings[i].armTransform.localRotation = Quaternion.Lerp(armSettings[i].armTransform.localRotation, Quaternion.Euler(armSettings[i].extendedRotation), extensionSpeed * Time.deltaTime);
		}
	}

	private void RetractArms()
	{
		//IL_0023: 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_004a: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < armSettings.Length; i++)
		{
			armSettings[i].armTransform.localRotation = Quaternion.Lerp(armSettings[i].armTransform.localRotation, Quaternion.Euler(initialRotations[i]), extensionSpeed * Time.deltaTime);
		}
	}

	private void RotateBlades()
	{
		//IL_0016: 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_002b: Unknown result type (might be due to invalid IL or missing references)
		Transform[] array = bladeTransforms;
		foreach (Transform val in array)
		{
			val.Rotate(Vector3.up * rotationSpeed * Time.deltaTime, (Space)1);
		}
	}

	private void MoveForward()
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		if (!isMovingForward)
		{
			isMovingForward = true;
			Debug.Log((object)"Moving forward");
		}
		((Component)this).transform.Translate(Vector3.forward * forwardSpeed * Time.deltaTime);
	}

	private void StopMoving()
	{
		if (isMovingForward)
		{
			isMovingForward = false;
			Debug.Log((object)"Stopping forward movement");
		}
	}

	public bool IsInteractable()
	{
		return !isActivated;
	}

	public void BeginInteraction(FVRViveHand hand)
	{
		isActivated = true;
	}
}
public class ObjectReturner : MonoBehaviour
{
	public float timeLimit = 20f;

	private Vector3 originalPosition;

	private bool isCheckingPosition = false;

	private float timer = 0f;

	private void Start()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		originalPosition = ((Component)this).transform.position;
	}

	private void Update()
	{
		if (!isCheckingPosition)
		{
			timer += Time.deltaTime;
			if (timer >= timeLimit)
			{
				isCheckingPosition = true;
				CheckAndReturnObject();
			}
		}
	}

	private void CheckAndReturnObject()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		if (((Component)this).transform.position != originalPosition)
		{
			((Component)this).transform.position = originalPosition;
		}
		timer = 0f;
		isCheckingPosition = false;
	}
}
public class SimpleActivator : MonoBehaviour
{
	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)32))
		{
			Debug.Log((object)"Spacebar pressed! The script works!");
		}
	}
}
public class WaterCanteen : MonoBehaviour
{
	public int maxCharges = 5;

	public int currentCharges = 5;

	public MonoBehaviour actionScript;

	public KeyCode useKey = (KeyCode)32;

	private void Start()
	{
		currentCharges = maxCharges;
	}

	private void Update()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown(useKey))
		{
			UseCanteen();
		}
	}

	public void UseCanteen()
	{
		if (currentCharges > 0)
		{
			Debug.Log((object)("Player used the water canteen. Remaining charges: " + (currentCharges - 1)));
			if ((Object)(object)actionScript != (Object)null)
			{
				((Component)actionScript).SendMessage("PerformAction", (SendMessageOptions)1);
				Debug.Log((object)"Action script was triggered by the water canteen.");
				CheckActionScriptActivation();
			}
			currentCharges--;
		}
		else
		{
			Debug.Log((object)"The water canteen is empty. Find more water!");
		}
	}

	private void CheckActionScriptActivation()
	{
	}
}