Decompiled source of HuntFireBomb v1.0.3

HuntFireBomb.dll

Decompiled 2 months ago
using System.Collections;
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 BitWizrd.Molotov;
using FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;

[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]
namespace BitWizrd.HuntFireBomb
{
	[BepInPlugin("BitWizrd.HuntFireBomb", "HuntFireBomb", "1.0.3")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class HuntFireBombPlugin : 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(), "BitWizrd.HuntFireBomb");
			OtherLoader.RegisterDirectLoad(BasePath, "BitWizrd.HuntFireBomb", "", "huntfirebomb", "", "");
		}
	}
}
public class BloodBondSR : MonoBehaviour
{
	private void Awake()
	{
		string name = "Ammo_69_CashMoney_D100(Clone)";
		((Object)((Component)this).gameObject).name = name;
		Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren<Collider>(true);
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			((Object)((Component)componentsInChildren[i]).gameObject).name = name;
		}
	}
}
public class CooldownSound : MonoBehaviour
{
	public ClosedBoltWeapon weapon;

	public AudioClip[] audioClips;

	public float volume = 1f;

	public int minShots = 5;

	public int maxShots = 10;

	public float minDelay = 0.5f;

	public float maxDelay = 2f;

	public float resetTime = 1.5f;

	private AudioSource audioSource;

	private int shotCounter = 0;

	private float lastShotTime;

	private bool lastRoundSpent;

	private int nextShotThreshold;

	private bool isPlayingSound = false;

	private void Start()
	{
		if ((Object)(object)weapon == (Object)null)
		{
			weapon = ((Component)this).GetComponent<ClosedBoltWeapon>();
		}
		if ((Object)(object)weapon == (Object)null)
		{
			Debug.LogError((object)"CooldownSound: Weapon reference is missing. Attach this script to a ClosedBoltWeapon.");
			return;
		}
		audioSource = ((Component)weapon).gameObject.GetComponent<AudioSource>();
		if ((Object)(object)audioSource == (Object)null)
		{
			audioSource = ((Component)weapon).gameObject.AddComponent<AudioSource>();
		}
		audioSource.spatialBlend = 1f;
		audioSource.playOnAwake = false;
		audioSource.rolloffMode = (AudioRolloffMode)0;
		lastRoundSpent = weapon.Chamber.IsSpent;
		SetNewShotThreshold();
	}

	private void Update()
	{
		DetectFiring();
	}

	private void DetectFiring()
	{
		if (weapon.Chamber.IsFull && weapon.Chamber.IsSpent && !lastRoundSpent)
		{
			OnWeaponFired();
		}
		lastRoundSpent = weapon.Chamber.IsSpent;
	}

	private void OnWeaponFired()
	{
		float num = Time.time - lastShotTime;
		if (num > resetTime)
		{
			shotCounter = 0;
			SetNewShotThreshold();
		}
		shotCounter++;
		lastShotTime = Time.time;
		if (shotCounter >= nextShotThreshold)
		{
			((MonoBehaviour)this).StartCoroutine(PlaySoundWithDelay());
			shotCounter = 0;
			SetNewShotThreshold();
		}
	}

	private IEnumerator PlaySoundWithDelay()
	{
		if (!isPlayingSound)
		{
			isPlayingSound = true;
			float delay = Random.Range(minDelay, maxDelay);
			yield return (object)new WaitForSeconds(delay);
			if (audioClips.Length > 0)
			{
				int index = Random.Range(0, audioClips.Length);
				audioSource.clip = audioClips[index];
				audioSource.PlayOneShot(audioSource.clip, volume);
				yield return (object)new WaitForSeconds(audioSource.clip.length);
			}
			isPlayingSound = false;
		}
	}

	private void SetNewShotThreshold()
	{
		nextShotThreshold = Random.Range(minShots, maxShots + 1);
	}
}
public class CustomWaggleJoint : MonoBehaviour
{
	public float distanceLimit = 0.25f;

	public float angleLimitLeft = 45f;

	public float angleLimitRight = 45f;

	public float gravityScale = 1f;

	public bool useSpring;

	public float springApproachRate = 0.95f;

	public float damping;

	public Transform hingeGraphic;

	public Vector3 hingeGraphicRotationOffset;

	public bool invertWaggleAxis;

	public bool ManualExecution;

	public float onHitLimitCooldown = 0.05f;

	public Vector3 waggleAxis = Vector3.up;

	public Vector3 rotationAxis = Vector3.up;

	[Header("Gizmo Options")]
	public bool debugGizmos = false;

	public bool showRotationExtremes = false;

	public bool showRotationDirectionArrows = false;

	private Vector3 particlePos;

	private Vector3 particleVel;

	private bool leftCatchState;

	private bool rightCatchState;

	private float lastTouchTime = float.MinValue;

	private Vector3 EffectiveWaggleDir()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		return ((Component)this).transform.TransformDirection((!invertWaggleAxis) ? waggleAxis : (-waggleAxis));
	}

	private void GetEffectiveAngleLimits(out float effectiveAngleMin, out float effectiveAngleMax)
	{
		if (invertWaggleAxis)
		{
			effectiveAngleMin = 0f - angleLimitLeft;
			effectiveAngleMax = angleLimitRight;
		}
		else
		{
			effectiveAngleMin = 0f - angleLimitRight;
			effectiveAngleMax = angleLimitLeft;
		}
	}

	public void ResetParticlePos()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_002e: Unknown result type (might be due to invalid IL or missing references)
		particlePos = ((Component)this).transform.position + EffectiveWaggleDir() * distanceLimit;
		particleVel = Vector3.zero;
	}

	private void OnHitLimit(float angularVelocity)
	{
	}

	public void Execute()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: 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_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: 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_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: 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_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		float deltaTime = Time.deltaTime;
		Transform transform = ((Component)this).transform;
		Vector3 val = Physics.gravity * gravityScale;
		Vector3 val2 = particlePos;
		Vector3 val3 = particleVel * Mathf.Pow(1f - damping, deltaTime) + val * deltaTime;
		Vector3 val4 = val2 + val3 * deltaTime;
		Vector3 val5 = transform.TransformDirection(((Vector3)(ref rotationAxis)).normalized);
		Vector3 val6 = EffectiveWaggleDir();
		Vector3 position = transform.position;
		if (useSpring)
		{
			val4 = Vector3.Lerp(val4, position + val6 * distanceLimit, 1f - Mathf.Pow(1f - springApproachRate, deltaTime));
		}
		GetEffectiveAngleLimits(out var effectiveAngleMin, out var effectiveAngleMax);
		particlePos = ProjectOnHinge(val4, position, val5, val6, distanceLimit, effectiveAngleMin, effectiveAngleMax);
		particleVel = (particlePos - val2) / deltaTime;
		if ((Object)(object)hingeGraphic != (Object)null)
		{
			hingeGraphic.rotation = Quaternion.LookRotation(particlePos - transform.position, val5) * Quaternion.Euler(hingeGraphicRotationOffset);
		}
	}

	private Vector3 ProjectOnHinge(Vector3 point, Vector3 hingePivot, Vector3 hingeAxis, Vector3 hingeDirection, float distanceLimit, float angleMin, float angleMax)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: 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_003b: Unknown result type (might be due to invalid IL or missing references)
		float num = ToHingeAngle(point, hingePivot, hingeAxis, hingeDirection);
		num = Mathf.Clamp(num, angleMin, angleMax);
		Vector3 val = Quaternion.AngleAxis(num, hingeAxis) * hingeDirection;
		return val * distanceLimit + hingePivot;
	}

	private float ToHingeAngle(Vector3 point, Vector3 hingePivot, Vector3 hingeAxis, Vector3 hingeDirection)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: 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)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = point - hingePivot;
		Vector3 val2 = Vector3.ProjectOnPlane(val, hingeAxis);
		Vector3 normalized = ((Vector3)(ref val2)).normalized;
		return SignedAngle(hingeDirection, normalized, hingeAxis);
	}

	private float SignedAngle(Vector3 from, Vector3 to, Vector3 axis)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: 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)
		float num = Vector3.Angle(from, to);
		return num * Mathf.Sign(Vector3.Dot(axis, Vector3.Cross(from, to)));
	}

	private void Start()
	{
		ResetParticlePos();
	}

	private void Update()
	{
		if (!ManualExecution)
		{
			Execute();
		}
	}

	private void OnDrawGizmosSelected()
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: 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_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: 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_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: 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_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: 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_0172: 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_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: 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_018c: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: 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_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//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_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: 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_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: 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_021e: 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_022e: 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_023a: 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_024c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		if (debugGizmos && !((Object)(object)Selection.activeGameObject != (Object)(object)((Component)this).gameObject))
		{
			Transform transform = ((Component)this).transform;
			Vector3 position = transform.position;
			Vector3 val = EffectiveWaggleDir();
			Vector3 val2 = transform.TransformDirection(((Vector3)(ref rotationAxis)).normalized);
			Vector3 val3 = position + val * distanceLimit;
			Gizmos.color = Color.white;
			float num = 0.01f;
			Gizmos.DrawLine(position + Vector3.left * num, position + Vector3.right * num);
			Gizmos.DrawLine(position + Vector3.up * num, position + Vector3.down * num);
			Gizmos.DrawLine(position + Vector3.forward * num, position + Vector3.back * num);
			Handles.BeginGUI();
			Handles.Label(position, "Pivot");
			Handles.EndGUI();
			Gizmos.color = Color.green;
			Gizmos.DrawLine(position, val3);
			GetEffectiveAngleLimits(out var effectiveAngleMin, out var effectiveAngleMax);
			Vector3 val4 = Quaternion.AngleAxis(effectiveAngleMax, val2) * val;
			Vector3 val5 = Quaternion.AngleAxis(effectiveAngleMin, val2) * val;
			Vector3 val6 = position + val4 * distanceLimit;
			Vector3 val7 = position + val5 * distanceLimit;
			Gizmos.color = Color.cyan;
			Gizmos.DrawLine(position, val6);
			Gizmos.DrawLine(position, val7);
			Handles.color = Color.yellow;
			Handles.DrawWireArc(position, val2, val5, effectiveAngleMax - effectiveAngleMin, distanceLimit * 0.5f);
			if (Application.isPlaying)
			{
				Gizmos.color = Color.red;
				float num2 = 0.01f;
				Gizmos.DrawLine(particlePos + Vector3.left * num2, particlePos + Vector3.right * num2);
				Gizmos.DrawLine(particlePos + Vector3.up * num2, particlePos + Vector3.down * num2);
				Gizmos.DrawLine(particlePos + Vector3.forward * num2, particlePos + Vector3.back * num2);
			}
		}
	}
}
public class HuntDollarSR : MonoBehaviour
{
	private IEnumerator Start()
	{
		yield return (object)new WaitForSeconds(3f);
		string str = "CharcoalBriquette(Clone)";
		((Object)((Component)this).gameObject).name = str;
		Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren<Collider>(true);
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			Component val = (Component)(object)componentsInChildren[i];
			((Object)val.gameObject).name = str;
		}
	}
}
namespace BitWizrd.Molotov
{
	public class IgniteBlast : MonoBehaviour
	{
		public float Radius = 5f;

		public LayerMask Mask_Blockers;

		private void Start()
		{
			TriggerIgnition();
		}

		private void TriggerIgnition()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, Radius);
			Collider[] array2 = array;
			RaycastHit val3 = default(RaycastHit);
			foreach (Collider val in array2)
			{
				Vector3 val2 = ((Component)val).transform.position - ((Component)this).transform.position;
				float magnitude = ((Vector3)(ref val2)).magnitude;
				if (!Physics.Raycast(((Component)this).transform.position, val2, ref val3, magnitude, LayerMask.op_Implicit(Mask_Blockers)) || !((Object)(object)((RaycastHit)(ref val3)).collider != (Object)(object)val))
				{
					FVRIgnitable component = ((Component)val).GetComponent<FVRIgnitable>();
					if ((Object)(object)component == (Object)null && (Object)(object)val.attachedRigidbody != (Object)null)
					{
						component = ((Component)val.attachedRigidbody).GetComponent<FVRIgnitable>();
					}
					if ((Object)(object)component != (Object)null)
					{
						FXM.Ignite(component, 200f);
					}
					IFVRDamageable component2 = ((Component)val).GetComponent<IFVRDamageable>();
					if (component2 != null)
					{
						Damage val4 = new Damage();
						val4.Dam_Thermal = 31f;
						val4.Class = (DamageClass)4;
						Damage val5 = val4;
						component2.Damage(val5);
					}
				}
			}
		}

		private void OnDrawGizmosSelected()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			Gizmos.color = Color.red;
			Gizmos.DrawWireSphere(((Component)this).transform.position, Radius);
		}
	}
}
namespace BitWizrd.Ignite
{
	public class IgniteMod : MonoBehaviour, IFVRDamageable
	{
		public Collider ignitionZone;

		public float HandIgnitionThreshold = 0.1f;

		public Rigidbody rb;

		public FVRIgnitable ignitable;

		public float ignitionDelay = 0.5f;

		public GameObject ignitionParticleEffect;

		public Transform ignitionParticleSpawnPoint;

		public AudioSource snapAudioSource;

		public AudioClip[] snapFingerSounds;

		public AudioSource ignitionAudioSource;

		public AudioClip[] ignitionSounds;

		public AudioSource cookingAudioSource;

		public AudioClip[] cookingClips;

		public AudioSource fastThrowAudioSource;

		public AudioClip[] fastThrowClips;

		public AudioSource sloshAudioSource;

		public AudioClip[] sloshSounds;

		public float fastThrowVelocityThreshold = 10f;

		public float cookingSoundDelay = 1f;

		public float releaseWindow = 0.5f;

		private bool hasPlayedFastThrowSound = false;

		private bool hasPlayedSloshSound = false;

		private bool hasPlayedCookingSound = false;

		private bool isWickLit = false;

		private bool shouldCheckVelocity = false;

		private float timeSinceRelease = 0f;

		private FVRViveHand leftHand;

		private FVRViveHand rightHand;

		private FVRViveHand currentHandHolding = null;

		private int lastSloshSoundIndex = -1;

		private int lastPlayedIndex = -1;

		private bool isInQuickbelt = false;

		private bool isSpawnLocked = false;

		private bool forceNotIgnitable = false;

		private FVRPhysicalObject physicalObject;

		public MolotovMod molotovmod;

		public GameObject childObjectToDisable;

		private void Start()
		{
			if ((Object)(object)rb == (Object)null || (Object)(object)ignitable == (Object)null || (Object)(object)molotovmod == (Object)null)
			{
				return;
			}
			leftHand = ((Component)GM.CurrentPlayerBody.LeftHand).GetComponent<FVRViveHand>();
			rightHand = ((Component)GM.CurrentPlayerBody.RightHand).GetComponent<FVRViveHand>();
			if (!((Object)(object)leftHand == (Object)null) && !((Object)(object)rightHand == (Object)null))
			{
				physicalObject = ((Component)this).GetComponent<FVRPhysicalObject>();
				if (!((Object)(object)physicalObject == (Object)null))
				{
					((Behaviour)ignitable).enabled = true;
				}
			}
		}

		private void Update()
		{
			CheckQuickbeltAndSpawnLockState();
			if (isInQuickbelt && isSpawnLocked)
			{
				forceNotIgnitable = true;
				DisableIgnition();
				if ((Object)(object)childObjectToDisable != (Object)null)
				{
					childObjectToDisable.SetActive(false);
				}
			}
			else
			{
				forceNotIgnitable = false;
				EnableIgnition();
				if ((Object)(object)childObjectToDisable != (Object)null)
				{
					childObjectToDisable.SetActive(true);
				}
			}
			CheckIfHeld();
			CheckFastThrowSound();
			CheckHandIgnition();
			CheckWickIgnition();
		}

		private void CheckQuickbeltAndSpawnLockState()
		{
			if ((Object)(object)physicalObject.QuickbeltSlot != (Object)null)
			{
				isInQuickbelt = true;
				isSpawnLocked = physicalObject.m_isSpawnLock;
			}
			else
			{
				isInQuickbelt = false;
				isSpawnLocked = false;
			}
		}

		private void CheckWickIgnition()
		{
			if ((Object)(object)ignitable != (Object)null && ignitable.IsOnFire() && !isWickLit)
			{
				isWickLit = true;
				PlayIgnitionSound();
				((MonoBehaviour)this).StartCoroutine(PlayCookingSoundWithDelay());
			}
		}

		private IEnumerator PlayCookingSoundWithDelay()
		{
			if (!hasPlayedCookingSound && (Object)(object)cookingAudioSource != (Object)null && cookingClips.Length > 0)
			{
				yield return (object)new WaitForSeconds(cookingSoundDelay);
				cookingAudioSource.clip = cookingClips[Random.Range(0, cookingClips.Length)];
				cookingAudioSource.Play();
				hasPlayedCookingSound = true;
			}
		}

		private void CheckHandIgnition()
		{
			if ((!isInQuickbelt || !isSpawnLocked) && !isWickLit && IsHandNearIgnitionZone() && ignitable.IsIgniteable())
			{
				if (leftHand.Input.TriggerDown && IsHandEligibleForIgnition(leftHand))
				{
					((MonoBehaviour)this).StartCoroutine(HandleIgnitionWithDelay());
				}
				else if (rightHand.Input.TriggerDown && IsHandEligibleForIgnition(rightHand))
				{
					((MonoBehaviour)this).StartCoroutine(HandleIgnitionWithDelay());
				}
			}
		}

		private bool IsHandEligibleForIgnition(FVRViveHand hand)
		{
			//IL_0018: 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)
			//IL_0020: 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)
			int result;
			if ((Object)(object)hand.CurrentInteractable == (Object)null)
			{
				Bounds bounds = ignitionZone.bounds;
				result = ((Vector3.Distance(((Bounds)(ref bounds)).center, ((Component)hand).transform.position) < HandIgnitionThreshold) ? 1 : 0);
			}
			else
			{
				result = 0;
			}
			return (byte)result != 0;
		}

		private void CheckFastThrowSound()
		{
			//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)
			if (!shouldCheckVelocity || HasPickedUp() || !isWickLit)
			{
				return;
			}
			timeSinceRelease += Time.deltaTime;
			if (timeSinceRelease <= releaseWindow)
			{
				Vector3 velocity = rb.velocity;
				if (((Vector3)(ref velocity)).magnitude > fastThrowVelocityThreshold && !hasPlayedFastThrowSound)
				{
					PlayFastThrowSound();
					hasPlayedFastThrowSound = true;
					return;
				}
			}
			if (timeSinceRelease > releaseWindow)
			{
				shouldCheckVelocity = false;
			}
		}

		private void PlaySnapSound()
		{
			if ((Object)(object)snapAudioSource != (Object)null && snapFingerSounds.Length > 0)
			{
				int nonRepeatingRandomIndex = GetNonRepeatingRandomIndex(snapFingerSounds.Length);
				snapAudioSource.PlayOneShot(snapFingerSounds[nonRepeatingRandomIndex]);
			}
		}

		private void PlayIgnitionSound()
		{
			if ((Object)(object)ignitionAudioSource != (Object)null && ignitionSounds.Length > 0)
			{
				int nonRepeatingRandomIndex = GetNonRepeatingRandomIndex(ignitionSounds.Length);
				ignitionAudioSource.PlayOneShot(ignitionSounds[nonRepeatingRandomIndex]);
			}
		}

		private void PlayFastThrowSound()
		{
			if (fastThrowClips.Length > 0 && (Object)(object)fastThrowAudioSource != (Object)null)
			{
				int nonRepeatingRandomIndex = GetNonRepeatingRandomIndex(fastThrowClips.Length);
				fastThrowAudioSource.PlayOneShot(fastThrowClips[nonRepeatingRandomIndex]);
			}
		}

		private int GetNonRepeatingRandomIndex(int length)
		{
			if (length <= 1)
			{
				return 0;
			}
			int num;
			do
			{
				num = Random.Range(0, length);
			}
			while (num == lastPlayedIndex);
			lastPlayedIndex = num;
			return num;
		}

		private void DisableIgnition()
		{
			if ((Object)(object)ignitable != (Object)null && ignitable.IsIgniteable())
			{
				((Behaviour)ignitable).enabled = false;
			}
			if ((Object)(object)ignitionZone != (Object)null && ignitionZone.enabled)
			{
				ignitionZone.enabled = false;
			}
		}

		private void EnableIgnition()
		{
			if ((Object)(object)ignitable != (Object)null && !ignitable.IsIgniteable())
			{
				((Behaviour)ignitable).enabled = true;
			}
			if ((Object)(object)ignitionZone != (Object)null && !ignitionZone.enabled)
			{
				ignitionZone.enabled = true;
			}
		}

		private IEnumerator HandleIgnitionWithDelay()
		{
			if (ignitable.IsIgniteable())
			{
				PlaySnapSound();
				if ((Object)(object)ignitionParticleEffect != (Object)null && (Object)(object)ignitionParticleSpawnPoint != (Object)null)
				{
					Object.Instantiate<GameObject>(ignitionParticleEffect, ignitionParticleSpawnPoint.position, ignitionParticleSpawnPoint.rotation);
				}
				else if ((Object)(object)ignitionParticleEffect != (Object)null)
				{
					Object.Instantiate<GameObject>(ignitionParticleEffect, ((Component)this).transform.position, ((Component)this).transform.rotation);
				}
				yield return (object)new WaitForSeconds(ignitionDelay);
				FXM.Ignite(ignitable, 0.1f);
				if (!hasPlayedCookingSound && (Object)(object)cookingAudioSource != (Object)null && cookingClips.Length > 0)
				{
					cookingAudioSource.clip = cookingClips[Random.Range(0, cookingClips.Length)];
					cookingAudioSource.Play();
					hasPlayedCookingSound = true;
				}
			}
		}

		private bool IsHandNearIgnitionZone()
		{
			//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_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			Bounds bounds = ignitionZone.bounds;
			float num = Vector3.Distance(((Bounds)(ref bounds)).center, ((Component)leftHand).transform.position);
			Bounds bounds2 = ignitionZone.bounds;
			float num2 = Vector3.Distance(((Bounds)(ref bounds2)).center, ((Component)rightHand).transform.position);
			return num < HandIgnitionThreshold || num2 < HandIgnitionThreshold;
		}

		private bool HasPickedUp()
		{
			return IsHoldingMolotovMod(leftHand, rightHand);
		}

		private bool IsHoldingMolotovMod(FVRViveHand leftHand, FVRViveHand rightHand)
		{
			bool flag = (Object)(object)leftHand != (Object)null && (Object)(object)leftHand.CurrentInteractable == (Object)(object)molotovmod;
			bool flag2 = (Object)(object)rightHand != (Object)null && (Object)(object)rightHand.CurrentInteractable == (Object)(object)molotovmod;
			return flag || flag2;
		}

		private void CheckIfHeld()
		{
			bool flag = HasPickedUp();
			FVRViveHand val = GetCurrentHandHolding();
			if (flag && (Object)(object)currentHandHolding != (Object)(object)val)
			{
				PlaySloshSound();
				hasPlayedSloshSound = true;
				currentHandHolding = val;
				hasPlayedFastThrowSound = false;
				shouldCheckVelocity = false;
				timeSinceRelease = 0f;
			}
			else if (!flag && hasPlayedSloshSound)
			{
				shouldCheckVelocity = true;
				timeSinceRelease = 0f;
				hasPlayedSloshSound = false;
				currentHandHolding = null;
			}
		}

		private FVRViveHand GetCurrentHandHolding()
		{
			if ((Object)(object)leftHand.CurrentInteractable != (Object)null && (Object)(object)leftHand.CurrentInteractable == (Object)(object)molotovmod)
			{
				return leftHand;
			}
			if ((Object)(object)rightHand.CurrentInteractable != (Object)null && (Object)(object)rightHand.CurrentInteractable == (Object)(object)molotovmod)
			{
				return rightHand;
			}
			return null;
		}

		private void PlaySloshSound()
		{
			if ((Object)(object)sloshAudioSource != (Object)null && sloshSounds.Length > 0)
			{
				int nonRepeatingRandomIndex = GetNonRepeatingRandomIndex(sloshSounds.Length);
				sloshAudioSource.PlayOneShot(sloshSounds[nonRepeatingRandomIndex]);
			}
		}

		public void Damage(Damage d)
		{
			if ((!isInQuickbelt || !isSpawnLocked) && d.Dam_Thermal > 30f)
			{
				FXM.Ignite(ignitable, 1f);
			}
		}

		private void OnParticleCollision(GameObject other)
		{
			if (!isInQuickbelt || !isSpawnLocked)
			{
				ignitable.OnParticleCollision(other);
			}
		}
	}
}
namespace BitWizrd.Liquid
{
	public class LiquidController : MonoBehaviour
	{
		[Header("Liquid Surface Settings")]
		public Transform LiquidSurfaceBone;

		public float SloshAmount = 40f;

		public float AngularSloshFactor = 1f;

		[Header("Physics Parameters")]
		public float SpringConstant = 100f;

		public float DampingFactor = 0.99f;

		public float VelocityMultiplier = 500f;

		public float SettleThreshold = 0.01f;

		private Vector3 sloshOffset;

		private Vector3 sloshVelocity;

		private Rigidbody rb;

		private Quaternion lastRotation;

		private void Start()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			sloshOffset = Vector3.zero;
			sloshVelocity = Vector3.zero;
			rb = ((Component)this).GetComponentInParent<Rigidbody>();
			if ((Object)(object)rb != (Object)null)
			{
				lastRotation = rb.rotation;
			}
		}

		private void Update()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//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_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: 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_017b: 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_017f: 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_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_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: 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_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_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: 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_0257: 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_0203: 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)
			if (!((Object)(object)rb == (Object)null) && !((Object)(object)LiquidSurfaceBone == (Object)null))
			{
				Vector3 val = ((Component)this).transform.InverseTransformDirection(Physics.gravity);
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				Vector3 val2 = new Vector3(normalized.y, normalized.x, normalized.z) * SloshAmount;
				Quaternion val3 = Quaternion.Inverse(lastRotation) * rb.rotation;
				Vector3 val4 = ((Quaternion)(ref val3)).eulerAngles / Time.deltaTime;
				((Vector3)(ref val4))..ctor(Mathf.DeltaAngle(0f, val4.x), Mathf.DeltaAngle(0f, val4.y), Mathf.DeltaAngle(0f, val4.z));
				val4 = ((Component)this).transform.InverseTransformDirection(val4) * AngularSloshFactor;
				Vector3 val5 = ((Component)this).transform.InverseTransformDirection(rb.velocity) * VelocityMultiplier;
				Vector3 val6 = ((Component)this).transform.InverseTransformDirection(rb.angularVelocity) * AngularSloshFactor * VelocityMultiplier;
				Vector3 val7 = val5 + val6 + val4;
				Vector3 val8 = (0f - SpringConstant) * (sloshOffset - val2);
				Vector3 val9 = (0f - DampingFactor) * sloshVelocity;
				Vector3 val10 = val8 + val9 + val7;
				sloshVelocity += val10 * Time.deltaTime;
				sloshOffset += sloshVelocity * Time.deltaTime;
				if (((Vector3)(ref sloshVelocity)).magnitude < SettleThreshold)
				{
					sloshVelocity = Vector3.zero;
				}
				if (((Vector3)(ref sloshOffset)).magnitude < SettleThreshold)
				{
					sloshOffset = Vector3.zero;
				}
				sloshOffset = Vector3.ClampMagnitude(sloshOffset, SloshAmount);
				Vector3 val11 = default(Vector3);
				((Vector3)(ref val11))..ctor(0f - sloshOffset.x, 0f - sloshOffset.y, 0f - sloshOffset.z);
				LiquidSurfaceBone.localRotation = Quaternion.Euler(val11);
				lastRotation = rb.rotation;
			}
		}
	}
}
namespace BitWizrd.Molotov
{
	public class MolotovMod : FVRPhysicalObject, IFVRDamageable
	{
		public float ShatterThreshold = 3f;

		public FVRIgnitable Igniteable;

		public AudioEvent AudEvent_Ignite;

		public GameObject Prefab_ShatterFX;

		public GameObject Prefab_FireSplosion;

		public GameObject Prefab_GroundFire;

		public float GroundFireRange = 5f;

		public LayerMask LM_Env;

		public LayerMask LM_Water;

		public bool CanExplodeOnWater = false;

		public int MinGroundFires = 1;

		public int MaxGroundFires = 3;

		private RaycastHit m_hit;

		private float TickDownToShatter = 28f;

		private bool m_hasShattered;

		public void Damage(Damage d)
		{
			if (d.Dam_Thermal > 30f)
			{
				FXM.Ignite(Igniteable, 1f);
			}
			if (d.Dam_TotalKinetic > 100f)
			{
				Shatter();
			}
		}

		public void RemoteIgnite()
		{
			FXM.Ignite(Igniteable, 1f);
		}

		public override void FVRUpdate()
		{
			((FVRPhysicalObject)this).FVRUpdate();
			if (Igniteable.IsOnFire())
			{
				TickDownToShatter -= Time.deltaTime;
				if (TickDownToShatter <= 0f)
				{
					Shatter();
				}
			}
			CheckForWaterImpact();
		}

		private void CheckForWaterImpact()
		{
			//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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			if (CanExplodeOnWater && Physics.Raycast(((Component)this).transform.position, Vector3.down, ref m_hit, 0.1f, LayerMask.op_Implicit(LM_Water)))
			{
				Vector3 velocity = ((Component)this).GetComponent<Rigidbody>().velocity;
				float magnitude = ((Vector3)(ref velocity)).magnitude;
				if (magnitude > ShatterThreshold)
				{
					Shatter();
				}
			}
		}

		public override void OnCollisionEnter(Collision col)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).OnCollisionEnter(col);
			Vector3 relativeVelocity = col.relativeVelocity;
			float magnitude = ((Vector3)(ref relativeVelocity)).magnitude;
			if (magnitude > ShatterThreshold)
			{
				Shatter();
			}
		}

		private void Shatter()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (!m_hasShattered)
			{
				m_hasShattered = true;
				if (Igniteable.IsOnFire())
				{
					Object.Instantiate<GameObject>(Prefab_FireSplosion, ((Component)this).transform.position, ((Component)this).transform.rotation);
					SM.PlayGenericSound(AudEvent_Ignite, ((Component)this).transform.position);
					InstantiateGroundFire();
				}
				Object.Instantiate<GameObject>(Prefab_ShatterFX, ((Component)this).transform.position, ((Component)this).transform.rotation);
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private void InstantiateGroundFire()
		{
			//IL_0040: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			int num2 = Random.Range(MinGroundFires, MaxGroundFires + 1);
			for (int i = 0; i < 10; i++)
			{
				if (num >= num2)
				{
					break;
				}
				Vector3 val = ((i != 0) ? Random.onUnitSphere : (-Vector3.up));
				if (val.y > 0f)
				{
					val.y = 0f - val.y;
				}
				if (Physics.Raycast(((Component)this).transform.position + Vector3.up, val, ref m_hit, GroundFireRange, LayerMask.op_Implicit(LM_Env), (QueryTriggerInteraction)1))
				{
					Object.Instantiate<GameObject>(Prefab_GroundFire, ((RaycastHit)(ref m_hit)).point, Quaternion.LookRotation(Vector3.up));
					num++;
				}
			}
		}

		private void OnParticleCollision(GameObject other)
		{
			if (!((Object)(object)((FVRPhysicalObject)this).QuickbeltSlot != (Object)null) || !base.m_isSpawnLock)
			{
				Igniteable.OnParticleCollision(other);
			}
		}
	}
	public class NavMeshObstacleController : MonoBehaviour
	{
		public NavMeshObstacle navMeshObstacle;

		public float minEnableDelay = 1.5f;

		public float maxEnableDelay = 2.5f;

		private void Start()
		{
			if ((Object)(object)navMeshObstacle != (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(EnableNavMeshObstacleWithDelay());
			}
		}

		private IEnumerator EnableNavMeshObstacleWithDelay()
		{
			float delay = Random.Range(minEnableDelay, maxEnableDelay);
			yield return (object)new WaitForSeconds(delay);
			((Behaviour)navMeshObstacle).enabled = true;
		}
	}
	public class ParticleThermalDmg : MonoBehaviour
	{
		public ParticleSystem ParticleSystemToUse;

		private ParticleCollisionEvent[] collisionEvents;

		private void Start()
		{
			if ((Object)(object)ParticleSystemToUse == (Object)null)
			{
				ParticleSystemToUse = ((Component)this).GetComponent<ParticleSystem>();
			}
			collisionEvents = (ParticleCollisionEvent[])(object)new ParticleCollisionEvent[16];
		}

		private void OnParticleCollision(GameObject other)
		{
			int num = ParticlePhysicsExtensions.GetCollisionEvents(ParticleSystemToUse, other, collisionEvents);
			for (int i = 0; i < num; i++)
			{
				ApplyThermalDamageRecursively(other, 0.1f);
			}
		}

		private void ApplyThermalDamageRecursively(GameObject obj, float thermalDamage)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			IFVRDamageable component = obj.GetComponent<IFVRDamageable>();
			if (component != null)
			{
				Damage val = new Damage();
				val.Dam_Thermal = thermalDamage;
				component.Damage(val);
			}
			foreach (Transform item in obj.transform)
			{
				Transform val2 = item;
				ApplyThermalDamageRecursively(((Component)val2).gameObject, thermalDamage);
			}
		}
	}
}
public class PlayRandomSoundOnSpawn : MonoBehaviour
{
	public AudioClip[] spawnSounds;

	public float volume = 1f;

	[Header("Pitch Settings")]
	public float minPitch = 0.9f;

	public float maxPitch = 1.1f;

	private AudioSource audioSource;

	private void Start()
	{
		if (spawnSounds.Length > 0)
		{
			audioSource = ((Component)this).gameObject.AddComponent<AudioSource>();
			audioSource.playOnAwake = false;
			audioSource.spatialBlend = 1f;
			audioSource.volume = volume;
			AudioClip val = spawnSounds[Random.Range(0, spawnSounds.Length)];
			audioSource.pitch = Random.Range(minPitch, maxPitch);
			audioSource.PlayOneShot(val);
		}
	}
}
namespace BitWizrd.RandomSound
{
	public class RandomSound : MonoBehaviour
	{
		public AudioSource audioSource;

		public AudioClip[] soundClips;

		private int lastPlayedIndex = -1;

		private void Start()
		{
			if ((Object)(object)audioSource == (Object)null)
			{
				audioSource = ((Component)this).GetComponent<AudioSource>();
				if ((Object)(object)audioSource == (Object)null)
				{
					Debug.LogError((object)"No AudioSource found! Please assign one in the Inspector.");
					return;
				}
			}
			PlayRandomSound();
		}

		public void PlayRandomSound()
		{
			if (soundClips.Length == 0)
			{
				Debug.LogWarning((object)"No sound clips assigned.");
				return;
			}
			int num;
			do
			{
				num = Random.Range(0, soundClips.Length);
			}
			while (num == lastPlayedIndex);
			audioSource.clip = soundClips[num];
			audioSource.Play();
			lastPlayedIndex = num;
		}
	}
}
public class RandomSpinOnSpawn : MonoBehaviour
{
	public float spinForce = 0.5f;

	public Vector3 torqueAxis = new Vector3(1f, 0f, 0f);

	private Rigidbody rb;

	private void Start()
	{
		//IL_003e: 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)
		rb = ((Component)this).GetComponent<Rigidbody>();
		if ((Object)(object)rb != (Object)null)
		{
			((Component)this).transform.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
			rb.AddTorque(((Vector3)(ref torqueAxis)).normalized * spinForce, (ForceMode)1);
		}
	}
}