Decompiled source of BringBackDualGun v2.0.2

DualGuns/BringBackDualGun.dll

Decompiled 4 days ago
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ThundergunRevised")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ThundergunRevised")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5711e2a0-d5a7-4ddf-b8d4-00f355fe9397")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en-FI")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace DualGuns;

[BepInPlugin("plonk.dualRevolver", "Dual Wield Revolvers", "1.0.0")]
public class MainCode : BaseUnityPlugin
{
	public static string tcbundle;

	public static void Log(string message, int type = 1)
	{
		switch (type)
		{
		case 1:
			Debug.Log((object)("[BringBackDualGun] " + message));
			break;
		case 2:
			Debug.LogWarning((object)("[BringBackDualGun] " + message));
			break;
		case 3:
			Debug.LogError((object)("[BringBackDualGun] " + message));
			break;
		}
	}

	public static Type Fetch<Type>(string path, bool autofill = true) where Type : Object
	{
		//IL_0015: 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)
		return Addressables.LoadAssetAsync<Type>((object)((autofill ? "Assets/formods/DualWieldRevolvers/" : "") + path)).WaitForCompletion();
	}

	public void Awake()
	{
		//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)
		if (tcbundle == null)
		{
			string path = (tcbundle = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
			if (tcbundle != null)
			{
				Log("Got bundle " + ((tcbundle != null) ? tcbundle.ToString() : null));
				string text = Path.Combine(path, "catalog.json");
				Path.Combine(path, "settings.json");
				AsyncOperationHandle<IResourceLocator> cat = Addressables.LoadContentCatalogAsync(text, true, (string)null);
				cat.Completed += delegate
				{
					foreach (string key in cat.Result.Keys)
					{
						if (key.StartsWith("Assets/formods/DualWieldRevolvers/"))
						{
							Log(key);
						}
					}
					Log("Got Content Catalog!");
				};
			}
			else
			{
				Log("Failed to get bundles!", 3);
			}
		}
		if (tcbundle != null)
		{
			Log("Got bundle");
		}
		SceneManager.sceneLoaded += OnSceneChange;
	}

	public void Start()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("plonk.dualRevolver").PatchAll();
	}

	public void OnSceneChange(Scene scene, LoadSceneMode mode)
	{
	}

	public void Update()
	{
	}

	public static GameObject[] GetWeapon(int name, GameObject[] fallback)
	{
		GameObject[] array = (GameObject[])(object)new GameObject[2];
		switch (name)
		{
		case 0:
			array[0] = MainCode.Fetch<GameObject>("Dual Revolver Pierce.prefab", autofill: true);
			break;
		case 1:
			array[0] = MainCode.Fetch<GameObject>("Dual Revolver Ricochet.prefab", autofill: true);
			break;
		case 2:
			array[0] = MainCode.Fetch<GameObject>("Dual Revolver Twirl.prefab", autofill: true);
			break;
		}
		array[1] = fallback[1];
		return array;
	}
}
[HarmonyPatch]
public static class Patches
{
	public static int[] ignoreSaves = new int[2] { 11, 1015064006 };

	[HarmonyPrefix]
	[HarmonyPatch(typeof(GunSetter), "ForceWeapon")]
	public static bool ForceWeaponOverride(GunSetter __instance, string weaponName)
	{
		if (ignoreSaves.Contains(MonoSingleton<PrefsManager>.Instance.GetInt("selectedSaveSlot", 0)))
		{
			return true;
		}
		if ((Object)(object)__instance.gunc == (Object)null)
		{
			__instance.gunc = ((Component)__instance).GetComponent<GunControl>();
		}
		int num = 0;
		if (MonoSingleton<PrefsManager>.Instance.GetInt("weapon." + weaponName, 0) == 2)
		{
			num = 1;
		}
		switch (weaponName)
		{
		case "rev0":
			__instance.gunc.ForceWeapon(MainCode.GetWeapon(0, AddressablesExtensions.ToAssets(__instance.revolverPierce))[num], true);
			break;
		case "rev2":
			__instance.gunc.ForceWeapon(MainCode.GetWeapon(1, AddressablesExtensions.ToAssets(__instance.revolverRicochet))[num], true);
			break;
		case "rev1":
			__instance.gunc.ForceWeapon(MainCode.GetWeapon(2, AddressablesExtensions.ToAssets(__instance.revolverTwirl))[num], true);
			break;
		default:
			return true;
		}
		return false;
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(RevolverAnimationReceiver), "ReadyGun")]
	public static bool FuckingFixThisFuckingShit(RevolverAnimationReceiver __instance)
	{
		if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponentInParent<Revolver>()))
		{
			if (((Object)((Component)__instance).transform).name == "Revolver_Rerigged_Standard")
			{
				((Component)__instance).GetComponentInParent<Revolver>().ReadyGun();
			}
			return false;
		}
		return true;
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(RevolverAnimationReceiver), "Click")]
	public static bool FuckingFixThisFuckingShit2(RevolverAnimationReceiver __instance)
	{
		if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponentInParent<Revolver>()))
		{
			if (((Object)((Component)__instance).transform).name == "Revolver_Rerigged_Standard")
			{
				if (Object.op_Implicit((Object)(object)__instance.click))
				{
					Object.Instantiate<GameObject>(__instance.click);
				}
				((Component)__instance).GetComponentInParent<Revolver>().Click();
				((Component)__instance).GetComponentInParent<Revolver>().cylinder.DoTurn();
				((Component)__instance).GetComponentInParent<Revolver>().cylinder2.DoTurn();
			}
			return false;
		}
		return true;
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(StyleHUD), "Update")]
	public static void NullFreshnessFix(StyleHUD __instance)
	{
		if (ignoreSaves.Contains(MonoSingleton<PrefsManager>.Instance.GetInt("selectedSaveSlot", 0)))
		{
			return;
		}
		Dictionary<GameObject, float> dictionary = new Dictionary<GameObject, float>();
		foreach (KeyValuePair<GameObject, float> item in __instance.weaponFreshness)
		{
			if ((Object)(object)item.Key == (Object)null)
			{
				dictionary.Add(item.Key, item.Value);
			}
		}
		foreach (KeyValuePair<GameObject, float> item2 in dictionary)
		{
			__instance.weaponFreshness.Remove(item2.Key);
		}
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(GunSetter), "ResetWeapons")]
	public static bool WeaponOverride(GunSetter __instance, bool firstTime = false)
	{
		if (ignoreSaves.Contains(MonoSingleton<PrefsManager>.Instance.GetInt("selectedSaveSlot", 0)))
		{
			return true;
		}
		if ((Object)(object)__instance.gunc == (Object)null)
		{
			__instance.gunc = ((Component)__instance).GetComponent<GunControl>();
		}
		int num = 5;
		for (int i = 0; i < Mathf.Min(__instance.gunc.slots.Count, num); i++)
		{
			List<GameObject> list = __instance.gunc.slots[i];
			foreach (GameObject item in list)
			{
				Object.Destroy((Object)(object)item);
			}
			list.Clear();
		}
		List<int> list2 = __instance.CheckWeaponOrder("rev");
		for (int j = 1; j < 5; j++)
		{
			switch (list2.IndexOf(j))
			{
			case 0:
				__instance.CheckWeapon("rev0", __instance.gunc.slot1, MainCode.GetWeapon(0, AddressablesExtensions.ToAssets(__instance.revolverPierce)));
				break;
			case 2:
				__instance.CheckWeapon("rev2", __instance.gunc.slot1, MainCode.GetWeapon(1, AddressablesExtensions.ToAssets(__instance.revolverRicochet)));
				break;
			case 1:
				__instance.CheckWeapon("rev1", __instance.gunc.slot1, MainCode.GetWeapon(2, AddressablesExtensions.ToAssets(__instance.revolverTwirl)));
				break;
			}
		}
		list2 = __instance.CheckWeaponOrder("sho");
		for (int k = 1; k < 5; k++)
		{
			switch (list2.IndexOf(k))
			{
			case 0:
				__instance.CheckWeapon("sho0", __instance.gunc.slot2, AddressablesExtensions.ToAssets(__instance.shotgunGrenade));
				break;
			case 1:
				__instance.CheckWeapon("sho1", __instance.gunc.slot2, AddressablesExtensions.ToAssets(__instance.shotgunPump));
				break;
			case 2:
				__instance.CheckWeapon("sho2", __instance.gunc.slot2, AddressablesExtensions.ToAssets(__instance.shotgunRed));
				break;
			}
		}
		list2 = __instance.CheckWeaponOrder("nai");
		for (int l = 1; l < 5; l++)
		{
			switch (list2.IndexOf(l))
			{
			case 0:
				__instance.CheckWeapon("nai0", __instance.gunc.slot3, AddressablesExtensions.ToAssets(__instance.nailMagnet));
				break;
			case 1:
				__instance.CheckWeapon("nai1", __instance.gunc.slot3, AddressablesExtensions.ToAssets(__instance.nailOverheat));
				break;
			case 2:
				__instance.CheckWeapon("nai2", __instance.gunc.slot3, AddressablesExtensions.ToAssets(__instance.nailRed));
				break;
			}
		}
		list2 = __instance.CheckWeaponOrder("rai");
		for (int m = 1; m < 5; m++)
		{
			switch (list2.IndexOf(m))
			{
			case 0:
				__instance.CheckWeapon("rai0", __instance.gunc.slot4, AddressablesExtensions.ToAssets(__instance.railCannon));
				break;
			case 1:
				__instance.CheckWeapon("rai1", __instance.gunc.slot4, AddressablesExtensions.ToAssets(__instance.railHarpoon));
				break;
			case 2:
				__instance.CheckWeapon("rai2", __instance.gunc.slot4, AddressablesExtensions.ToAssets(__instance.railMalicious));
				break;
			}
		}
		list2 = __instance.CheckWeaponOrder("rock");
		for (int n = 1; n < 5; n++)
		{
			switch (list2.IndexOf(n))
			{
			case 0:
				__instance.CheckWeapon("rock0", __instance.gunc.slot5, AddressablesExtensions.ToAssets(__instance.rocketBlue));
				break;
			case 1:
				__instance.CheckWeapon("rock1", __instance.gunc.slot5, AddressablesExtensions.ToAssets(__instance.rocketGreen));
				break;
			case 2:
				__instance.CheckWeapon("rock2", __instance.gunc.slot5, AddressablesExtensions.ToAssets(__instance.rocketRed));
				break;
			}
		}
		__instance.gunc.UpdateWeaponList(firstTime);
		if ((Object)(object)__instance.gunc.currentWeapon == (Object)null && ((Component)__instance.gunc).transform.childCount > 0 && !MonoSingleton<FistControl>.Instance.shopping)
		{
			__instance.gunc.ForceWeapon(((Component)((Component)__instance.gunc).transform.GetChild(0)).gameObject, true);
			__instance.gunc.UpdateWeaponIcon(false);
		}
		return false;
	}
}
public class Revolver : MonoBehaviour
{
	public Transform secondGun;

	public Vector3[] secondGunPos = (Vector3[])(object)new Vector3[2];

	public Vector3[] secondGunRot = (Vector3[])(object)new Vector3[2];

	public InputManager inman;

	public WeaponIdentifier wid;

	public int gunVariation;

	public bool altVersion;

	public AudioSource gunAud;

	public GameObject[] gunShots;

	public int currentGunShot;

	public GameObject gunBarrel;

	public GameObject gunBarrel2;

	public bool gunReady;

	public bool shootReady = true;

	public bool pierceReady = true;

	public float shootCharge;

	public float pierceCharge;

	public bool chargingPierce;

	public float pierceShotCharge;

	public Vector3 shotHitPoint;

	public GameObject revolverBeam;

	public GameObject revolverBeamSuper;

	public AudioSource superGunSound;

	public RaycastHit hit;

	public RaycastHit[] allHits;

	public int currentHit;

	public int currentHitMultiplier;

	public float recoilFOV;

	public GameObject chargeEffect;

	public GameObject chargeEffect2;

	public AudioSource ceaud;

	public Light celight;

	public GameObject camObj;

	public Camera cam;

	public CameraController cc;

	public Vector3 tempCamPos;

	public Vector3 beamReflectPos;

	public GameObject beamDirectionSetter;

	public MeshRenderer screenMR;

	public MaterialPropertyBlock screenProps;

	public Material batteryMat;

	public Texture2D batteryFull;

	public Texture2D batteryMid;

	public Texture2D batteryLow;

	public Texture2D[] batteryCharges;

	public AudioSource screenAud;

	public AudioClip chargedSound;

	public AudioClip chargingSound;

	public Transform twirlBone;

	public Transform twirlBone2;

	public float latestTwirlRotation;

	public float twirlLevel;

	public bool twirlRecovery;

	public SpriteRenderer twirlSprite;

	public SpriteRenderer twirlSprite2;

	public GameObject twirlShotSound;

	public GameObject currentDrip;

	public GameObject coin;

	public GameObject quickTwirlEffect;

	public RevolverCylinder cylinder;

	public RevolverCylinder cylinder2;

	public SwitchMaterial rimLight;

	public GunControl gc;

	public Animator anim;

	public Animator anim2;

	public Punch punch;

	public NewMovement nmov;

	public WeaponPos wpos;

	public Image[] coinPanels;

	public bool[] coinPanelsCharged;

	public WeaponCharges wc;

	public CameraFrustumTargeter targeter;

	public float coinCharge = 400f;

	public void Start()
	{
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Expected O, but got Unknown
		targeter = MonoSingleton<CameraFrustumTargeter>.Instance;
		inman = MonoSingleton<InputManager>.Instance;
		wid = ((Component)this).GetComponent<WeaponIdentifier>();
		gunReady = false;
		cam = ((Component)MonoSingleton<CameraController>.Instance).GetComponent<Camera>();
		camObj = ((Component)cam).gameObject;
		cc = MonoSingleton<CameraController>.Instance;
		nmov = MonoSingleton<NewMovement>.Instance;
		shootCharge = 0f;
		pierceShotCharge = 0f;
		pierceCharge = 100f;
		pierceReady = false;
		gunAud = ((Component)this).GetComponent<AudioSource>();
		if (gunVariation == 0)
		{
			screenAud = ((Component)screenMR).gameObject.GetComponent<AudioSource>();
		}
		else
		{
			screenAud = ((Component)((Component)this).GetComponentInChildren<Canvas>()).GetComponent<AudioSource>();
		}
		if (Object.op_Implicit((Object)(object)chargeEffect))
		{
			ceaud = chargeEffect.GetComponent<AudioSource>();
			celight = chargeEffect.GetComponent<Light>();
		}
		if (gunVariation == 0)
		{
			screenAud.clip = chargingSound;
			screenAud.loop = true;
			AudioSourceExtensions.SetPitch(screenAud, 1f);
			screenAud.volume = 0.25f;
			AudioSourceExtensions.Play(screenAud, true);
		}
		gc = ((Component)this).GetComponentInParent<GunControl>();
		beamDirectionSetter = new GameObject();
		wc = MonoSingleton<WeaponCharges>.Instance;
		wpos = ((Component)this).GetComponent<WeaponPos>();
		if (wid.delay != 0f && gunVariation == 0)
		{
			pierceCharge = wc.rev0charge;
		}
	}

	public void OnDisable()
	{
		//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)
		FistControl instance = MonoSingleton<FistControl>.Instance;
		instance.forceNoHold--;
		Scene scene = ((Component)this).gameObject.scene;
		if (((Scene)(ref scene)).isLoaded)
		{
			if ((Object)(object)wc == (Object)null)
			{
				wc = MonoSingleton<WeaponCharges>.Instance;
			}
			if (gunVariation == 0)
			{
				wc.rev0alt = altVersion;
				wc.rev0charge = pierceCharge;
			}
			pierceShotCharge = 0f;
			gunReady = false;
		}
	}

	public void OnEnable()
	{
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Expected O, but got Unknown
		FistControl instance = MonoSingleton<FistControl>.Instance;
		instance.forceNoHold++;
		if ((Object)(object)wc == (Object)null)
		{
			wc = MonoSingleton<WeaponCharges>.Instance;
		}
		shootCharge = 100f;
		if (gunVariation == 0)
		{
			pierceCharge = wc.rev0charge;
		}
		else
		{
			pierceCharge = 100f;
			pierceReady = true;
			CheckCoinCharges();
		}
		if (gunVariation == 2)
		{
			wc.rev2alt = altVersion;
		}
		if (altVersion)
		{
			if (!Object.op_Implicit((Object)(object)anim))
			{
				anim = ((Component)this).GetComponentInChildren<Animator>();
			}
			if (wc.revaltpickupcharges[gunVariation] > 0f)
			{
				anim.SetBool("SlowPickup", true);
			}
			else
			{
				anim.SetBool("SlowPickup", false);
			}
		}
		if (screenProps == null)
		{
			screenProps = new MaterialPropertyBlock();
		}
		if (Object.op_Implicit((Object)(object)screenMR))
		{
			((Renderer)screenMR).GetPropertyBlock(screenProps);
		}
		gunReady = false;
	}

	public void Update()
	{
		//IL_038d: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_08fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0905: Unknown result type (might be due to invalid IL or missing references)
		//IL_091a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0925: Unknown result type (might be due to invalid IL or missing references)
		//IL_092f: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		if (!shootReady)
		{
			if (shootCharge + 200f * Time.deltaTime < 100f)
			{
				shootCharge += 200f * Time.deltaTime;
			}
			else
			{
				shootCharge = 100f;
				shootReady = true;
			}
		}
		if (!pierceReady)
		{
			if (gunVariation == 0)
			{
				if (NoWeaponCooldown.NoCooldown)
				{
					pierceCharge = 100f;
				}
				float num = 1f;
				if (altVersion)
				{
					num = 0.5f;
				}
				if (pierceCharge + 40f * Time.deltaTime < 100f)
				{
					pierceCharge += 40f * Time.deltaTime * num;
				}
				else
				{
					pierceCharge = 100f;
					pierceReady = true;
					screenAud.clip = chargedSound;
					screenAud.loop = false;
					screenAud.volume = 0.35f;
					AudioSourceExtensions.SetPitch(screenAud, Random.Range(1f, 1.1f));
					AudioSourceExtensions.Play(screenAud, true);
				}
				if (cylinder.spinSpeed > 0f)
				{
					cylinder.spinSpeed = Mathf.MoveTowards(cylinder.spinSpeed, 0f, Time.deltaTime * 50f);
				}
				if (cylinder2.spinSpeed > 0f)
				{
					cylinder2.spinSpeed = Mathf.MoveTowards(cylinder2.spinSpeed, 0f, Time.deltaTime * 50f);
				}
				if (pierceCharge < 50f)
				{
					screenProps.SetTexture("_MainTex", (Texture)(object)batteryLow);
					screenProps.SetColor("_Color", Color.red);
				}
				else if (pierceCharge < 100f)
				{
					screenProps.SetTexture("_MainTex", (Texture)(object)batteryMid);
					screenProps.SetColor("_Color", Color.yellow);
				}
				else
				{
					screenProps.SetTexture("_MainTex", (Texture)(object)batteryFull);
				}
			}
			else if (pierceCharge + 480f * Time.deltaTime < 100f)
			{
				pierceCharge += 480f * Time.deltaTime;
			}
			else
			{
				pierceCharge = 100f;
				pierceReady = true;
			}
		}
		else if (gunVariation == 0)
		{
			if (pierceShotCharge != 0f)
			{
				if (pierceShotCharge < 50f)
				{
					screenProps.SetTexture("_MainTex", (Texture)(object)batteryCharges[0]);
				}
				else if (pierceShotCharge < 100f)
				{
					screenProps.SetTexture("_MainTex", (Texture)(object)batteryCharges[1]);
				}
				else
				{
					screenProps.SetTexture("_MainTex", (Texture)(object)batteryCharges[2]);
				}
				((Component)this).transform.localPosition = new Vector3(wpos.currentDefault.x + pierceShotCharge / 250f * Random.Range(-0.05f, 0.05f), wpos.currentDefault.y + pierceShotCharge / 250f * Random.Range(-0.05f, 0.05f), wpos.currentDefault.z + pierceShotCharge / 250f * Random.Range(-0.05f, 0.05f));
				cylinder.spinSpeed = pierceShotCharge;
				cylinder2.spinSpeed = pierceShotCharge;
			}
			else
			{
				screenProps.SetTexture("_MainTex", (Texture)(object)batteryFull);
				if (cylinder.spinSpeed != 0f)
				{
					cylinder.spinSpeed = 0f;
				}
				if (cylinder2.spinSpeed != 0f)
				{
					cylinder2.spinSpeed = 0f;
				}
			}
		}
		if (gc.activated)
		{
			if (gunVariation != 1 && gunReady)
			{
				float num2 = ((gunVariation == 0) ? 175 : (altVersion ? 750 : 75));
				if ((inman.InputSource.Fire2.WasCanceledThisFrame || (!inman.PerformingCheatMenuCombo() && !GameStateManager.Instance.PlayerInputLocked && inman.InputSource.Fire1.IsPressed)) && shootReady && ((gunVariation == 0) ? (pierceShotCharge == 100f) : (pierceShotCharge >= 25f)))
				{
					if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
					{
						Shoot(2);
					}
					else
					{
						shootReady = false;
						shootCharge = 0f;
						((MonoBehaviour)this).Invoke("DelayedShoot2", wid.delay);
					}
				}
				else if (!inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed && shootReady && !chargingPierce)
				{
					if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
					{
						Shoot();
					}
					else
					{
						shootReady = false;
						shootCharge = 0f;
						((MonoBehaviour)this).Invoke("DelayedShoot", wid.delay);
					}
				}
				else if (inman.InputSource.Fire2.IsPressed && (gunVariation == 2 || shootReady) && ((gunVariation == 0) ? pierceReady : (coinCharge >= (float)(altVersion ? 300 : 100))))
				{
					if (!chargingPierce && !twirlRecovery)
					{
						latestTwirlRotation = 0f;
					}
					chargingPierce = true;
					if (pierceShotCharge + num2 * Time.deltaTime < 100f)
					{
						pierceShotCharge += num2 * Time.deltaTime;
					}
					else
					{
						pierceShotCharge = 100f;
					}
				}
				else
				{
					if (chargingPierce)
					{
						twirlRecovery = true;
					}
					chargingPierce = false;
					if (pierceShotCharge - num2 * Time.deltaTime > 0f)
					{
						pierceShotCharge -= num2 * Time.deltaTime;
					}
					else
					{
						pierceShotCharge = 0f;
					}
				}
			}
			else if (gunVariation == 1)
			{
				if (inman.InputSource.Fire2.WasPerformedThisFrame && pierceReady && coinCharge >= 100f)
				{
					cc.StopShake();
					if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
					{
						WeaponCharges obj = wc;
						obj.rev1charge -= 100f;
					}
					if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
					{
						ThrowCoin();
					}
					else
					{
						((MonoBehaviour)this).Invoke("ThrowCoin", wid.delay);
						pierceReady = false;
						pierceCharge = 0f;
					}
				}
				else if (gunReady && !inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed && shootReady)
				{
					if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
					{
						Shoot();
					}
					else
					{
						shootReady = false;
						shootCharge = 0f;
						((MonoBehaviour)this).Invoke("DelayedShoot", wid.delay);
					}
					if (Object.op_Implicit((Object)(object)ceaud) && ceaud.volume != 0f)
					{
						ceaud.volume = 0f;
					}
				}
			}
		}
		if (Object.op_Implicit((Object)(object)celight))
		{
			if (pierceShotCharge == 0f && ((Behaviour)celight).enabled)
			{
				((Behaviour)celight).enabled = false;
			}
			else if (pierceShotCharge != 0f)
			{
				((Behaviour)celight).enabled = true;
				celight.range = pierceShotCharge * 0.01f;
			}
		}
		if (gunVariation != 1)
		{
			if (gunVariation == 0)
			{
				chargeEffect.transform.localScale = Vector3.one * pierceShotCharge * 0.02f;
				chargeEffect2.transform.localScale = Vector3.one * pierceShotCharge * 0.02f;
				AudioSourceExtensions.SetPitch(ceaud, pierceShotCharge * 0.005f);
			}
			ceaud.volume = 0.25f + pierceShotCharge * 0.005f;
			if (Object.op_Implicit((Object)(object)MonoSingleton<RumbleManager>.Instance))
			{
				MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.RevolverCharge, ((Component)ceaud).gameObject).intensityMultiplier = pierceShotCharge / 250f;
			}
		}
		if (gunVariation != 0)
		{
			CheckCoinCharges();
		}
		else if (pierceCharge == 100f && Object.op_Implicit((Object)(object)MonoSingleton<ColorBlindSettings>.Instance))
		{
			screenProps.SetColor("_Color", MonoSingleton<ColorBlindSettings>.Instance.variationColors[gunVariation]);
		}
		if (gunVariation == 0)
		{
			((Renderer)screenMR).SetPropertyBlock(screenProps);
		}
	}

	public void LateUpdate()
	{
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: 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_0049: 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_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f0: 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_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Unknown result type (might be due to invalid IL or missing references)
		//IL_034c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0360: Unknown result type (might be due to invalid IL or missing references)
		//IL_0359: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0370: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_0393: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0455: Unknown result type (might be due to invalid IL or missing references)
		//IL_0460: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)MonoSingleton<PowerUpMeter>.Instance))
		{
			if (MonoSingleton<PowerUpMeter>.Instance.hasPowerUp)
			{
				((Component)secondGun).transform.localPosition = secondGunPos[1];
				((Component)secondGun).transform.localRotation = Quaternion.Euler(secondGunRot[1]);
				((Component)secondGun).transform.localScale = new Vector3(0.75f, 0.65f, 0.65f);
			}
			else
			{
				((Component)secondGun).transform.localPosition = secondGunPos[0];
				((Component)secondGun).transform.localRotation = Quaternion.Euler(secondGunRot[0]);
				((Component)secondGun).transform.localScale = new Vector3(-0.75f, 0.65f, 0.65f);
			}
		}
		if (gunVariation != 2)
		{
			return;
		}
		if (chargingPierce || twirlRecovery)
		{
			anim.SetBool("Spinning", true);
			anim2.SetBool("Spinning", true);
			bool flag = latestTwirlRotation < 0f;
			if (chargingPierce)
			{
				twirlLevel = Mathf.Min(3f, Mathf.Floor(pierceShotCharge / 25f)) + 1f;
			}
			else
			{
				twirlLevel = Mathf.MoveTowards(twirlLevel, 0.1f, Time.deltaTime * 100f * twirlLevel);
			}
			latestTwirlRotation += 1200f * (twirlLevel / 3f + 0.5f) * Time.deltaTime;
			if (Object.op_Implicit((Object)(object)twirlSprite))
			{
				twirlSprite.color = new Color(1f, 1f, 1f, Mathf.Min(2f, Mathf.Floor(pierceShotCharge / 25f)) / 3f);
			}
			if (Object.op_Implicit((Object)(object)twirlSprite2))
			{
				twirlSprite2.color = new Color(1f, 1f, 1f, Mathf.Min(2f, Mathf.Floor(pierceShotCharge / 25f)) / 3f);
			}
			if (!ceaud.isPlaying)
			{
				AudioSourceExtensions.Play(ceaud, true);
			}
			AudioSourceExtensions.SetPitch(ceaud, 0.5f + twirlLevel / 2f);
			if (twirlRecovery && flag && latestTwirlRotation >= 0f)
			{
				latestTwirlRotation = 0f;
				twirlRecovery = false;
				if (Object.op_Implicit((Object)(object)twirlSprite))
				{
					twirlSprite.color = new Color(1f, 1f, 1f, 0f);
				}
				if (Object.op_Implicit((Object)(object)twirlSprite2))
				{
					twirlSprite2.color = new Color(1f, 1f, 1f, 0f);
				}
			}
			else
			{
				while (latestTwirlRotation > 180f)
				{
					latestTwirlRotation -= 360f;
				}
				Transform obj = twirlBone;
				Quaternion localRotation = twirlBone.localRotation;
				obj.localRotation = Quaternion.Euler(((Quaternion)(ref localRotation)).eulerAngles + (altVersion ? Vector3.left : Vector3.forward) * latestTwirlRotation);
				Transform obj2 = twirlBone2;
				localRotation = twirlBone2.localRotation;
				obj2.localRotation = Quaternion.Euler(((Quaternion)(ref localRotation)).eulerAngles - (altVersion ? Vector3.left : Vector3.forward) * latestTwirlRotation);
			}
			anim.SetFloat("TwirlSpeed", twirlLevel / 3f);
			anim2.SetFloat("TwirlSpeed", twirlLevel / 3f);
			if (Object.op_Implicit((Object)(object)wid) && wid.delay != 0f && !MonoSingleton<NewMovement>.Instance.gc.onGround)
			{
				MonoSingleton<NewMovement>.Instance.rb.AddForce(((Component)MonoSingleton<CameraController>.Instance).transform.up * 400f * twirlLevel * Time.deltaTime, (ForceMode)5);
			}
		}
		else
		{
			anim.SetBool("Spinning", false);
			anim2.SetBool("Spinning", false);
			if (Object.op_Implicit((Object)(object)twirlSprite))
			{
				twirlSprite.color = new Color(1f, 1f, 1f, 0f);
			}
			if (Object.op_Implicit((Object)(object)twirlSprite2))
			{
				twirlSprite2.color = new Color(1f, 1f, 1f, 0f);
			}
			ceaud.Stop();
		}
	}

	public void ShootOther()
	{
		//IL_0011: 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_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(revolverBeam, ((Component)cc).transform.position, ((Component)cc).transform.rotation);
		if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
		{
			Transform transform = val.transform;
			Bounds bounds = targeter.CurrentTarget.bounds;
			transform.LookAt(((Bounds)(ref bounds)).center);
		}
		RevolverBeam component = val.GetComponent<RevolverBeam>();
		component.sourceWeapon = gc.currentWeapon;
		component.alternateStartPoint = gunBarrel2.transform.position;
		component.gunVariation = gunVariation;
		AnimatorStateInfo currentAnimatorStateInfo = anim2.GetCurrentAnimatorStateInfo(0);
		if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("PickUp"))
		{
			component.quickDraw = true;
		}
		Object.Instantiate<GameObject>(gunShots[Random.Range(0, gunShots.Length)]);
		cam.fieldOfView += cc.defaultFov / 40f;
		MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.GunFire, ((Component)this).gameObject);
		anim2.SetFloat("RandomChance", Random.Range(0f, 1f));
		anim2.SetTrigger("Shoot");
	}

	public void Shoot(int shotType = 1)
	{
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: 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_02b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_022c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0231: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: 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_0139: 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_033c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0341: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: 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)
		//IL_038c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0391: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		//IL_0307: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
		cc.StopShake();
		shootReady = false;
		shootCharge = 0f;
		PlayerAnimations instance = MonoSingleton<PlayerAnimations>.Instance;
		if ((Object)(object)instance != (Object)null)
		{
			instance.Shoot(altVersion ? 0.5f : 1f);
		}
		if (altVersion)
		{
			MonoSingleton<WeaponCharges>.Instance.revaltpickupcharges[gunVariation] = 2f;
		}
		Bounds bounds;
		AnimatorStateInfo currentAnimatorStateInfo;
		switch (shotType)
		{
		case 1:
		{
			((MonoBehaviour)this).Invoke("ShootOther", altVersion ? 0.5f : 0.275f);
			GameObject val2 = Object.Instantiate<GameObject>(revolverBeam, ((Component)cc).transform.position, ((Component)cc).transform.rotation);
			if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
			{
				Transform transform3 = val2.transform;
				bounds = targeter.CurrentTarget.bounds;
				transform3.LookAt(((Bounds)(ref bounds)).center);
			}
			RevolverBeam component2 = val2.GetComponent<RevolverBeam>();
			component2.sourceWeapon = gc.currentWeapon;
			component2.alternateStartPoint = gunBarrel.transform.position;
			component2.gunVariation = gunVariation;
			currentAnimatorStateInfo = anim.GetCurrentAnimatorStateInfo(0);
			if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("PickUp"))
			{
				component2.quickDraw = true;
			}
			currentGunShot = Random.Range(0, gunShots.Length);
			Object.Instantiate<GameObject>(gunShots[Random.Range(0, gunShots.Length)]);
			cam.fieldOfView += cc.defaultFov / 40f;
			MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.GunFire, ((Component)this).gameObject);
			break;
		}
		case 2:
		{
			GameObject val = Object.Instantiate<GameObject>(revolverBeamSuper, ((Component)cc).transform.position, ((Component)cc).transform.rotation);
			if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
			{
				Transform transform = val.transform;
				bounds = targeter.CurrentTarget.bounds;
				transform.LookAt(((Bounds)(ref bounds)).center);
			}
			RevolverBeam component = val.GetComponent<RevolverBeam>();
			component.sourceWeapon = gc.currentWeapon;
			component.alternateStartPoint = gunBarrel.transform.position;
			component.gunVariation = gunVariation;
			if (gunVariation == 2)
			{
				component.ricochetAmount = Mathf.Min(3, Mathf.FloorToInt(pierceShotCharge / 25f));
			}
			val = Object.Instantiate<GameObject>(revolverBeamSuper, ((Component)cc).transform.position, ((Component)cc).transform.rotation);
			if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
			{
				Transform transform2 = val.transform;
				bounds = targeter.CurrentTarget.bounds;
				transform2.LookAt(((Bounds)(ref bounds)).center);
			}
			component = val.GetComponent<RevolverBeam>();
			component.sourceWeapon = gc.currentWeapon;
			component.alternateStartPoint = gunBarrel2.transform.position;
			component.gunVariation = gunVariation;
			if (gunVariation == 2)
			{
				component.ricochetAmount = Mathf.Min(3, Mathf.FloorToInt(pierceShotCharge / 25f));
			}
			pierceShotCharge = 0f;
			currentAnimatorStateInfo = anim.GetCurrentAnimatorStateInfo(0);
			if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("PickUp"))
			{
				component.quickDraw = true;
			}
			pierceReady = false;
			pierceCharge = 0f;
			if (gunVariation == 0)
			{
				screenAud.clip = chargingSound;
				screenAud.loop = true;
				if (altVersion)
				{
					AudioSourceExtensions.SetPitch(screenAud, 0.5f);
				}
				else
				{
					AudioSourceExtensions.SetPitch(screenAud, 1f);
				}
				screenAud.volume = 0.55f;
				AudioSourceExtensions.Play(screenAud, true);
			}
			else if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
			{
				WeaponCharges obj = wc;
				obj.rev2charge -= (float)(altVersion ? 300 : 100);
			}
			if (Object.op_Implicit((Object)(object)superGunSound))
			{
				Object.Instantiate<AudioSource>(superGunSound);
			}
			if (gunVariation == 2 && Object.op_Implicit((Object)(object)twirlShotSound))
			{
				Object.Instantiate<GameObject>(twirlShotSound, ((Component)this).transform.position, Quaternion.identity);
			}
			cam.fieldOfView += cc.defaultFov / 20f;
			MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.GunFireStrong, ((Component)this).gameObject);
			break;
		}
		}
		if (!altVersion)
		{
			cylinder.DoTurn();
			cylinder2.DoTurn();
		}
		anim.SetFloat("RandomChance", Random.Range(0f, 1f));
		if (shotType == 1)
		{
			anim.SetTrigger("Shoot");
		}
		else
		{
			anim.SetTrigger("ChargeShoot");
			anim2.SetTrigger("ChargeShoot");
		}
		gunReady = false;
	}

	public void ThrowCoin()
	{
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: 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_0145: 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_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_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_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)punch == (Object)null || !((Component)punch).gameObject.activeInHierarchy)
		{
			punch = MonoSingleton<FistControl>.Instance.currentPunch;
		}
		if (Object.op_Implicit((Object)(object)punch))
		{
			punch.CoinFlip();
		}
		PlayerAnimations instance = MonoSingleton<PlayerAnimations>.Instance;
		if ((Object)(object)instance != (Object)null)
		{
			instance.CoinToss();
		}
		Coin component = Object.Instantiate<GameObject>(coin, camObj.transform.position + camObj.transform.up * -0.5f, camObj.transform.rotation).GetComponent<Coin>();
		component.sourceWeapon = gc.currentWeapon;
		Vector3 val = Vector3.down;
		Vector3 val2 = default(Vector3);
		if (PhysicsExtensions.TryGetCustomGravity(nmov.rb, ref val2) && PhysicsExtensions.GetCustomGravityMode(nmov.rb))
		{
			val = val2;
		}
		Rigidbody rb = component.rb;
		Vector3 normalized = ((Vector3)(ref val)).normalized;
		Vector3 gravity = Physics.gravity;
		PhysicsExtensions.SetCustomGravity(rb, normalized * ((Vector3)(ref gravity)).magnitude);
		PhysicsExtensions.SetCustomGravityMode(component.rb, true);
		MonoSingleton<RumbleManager>.Instance.SetVibration(RumbleProperties.CoinToss);
		component.rb.AddForce(camObj.transform.forward * 20f + -((Vector3)(ref val)).normalized * 15f + MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(true), (ForceMode)2);
		pierceCharge = 0f;
		pierceReady = false;
	}

	public void ReadyToShoot()
	{
		shootReady = true;
	}

	public void Punch()
	{
		gunReady = false;
		anim.SetTrigger("ChargeShoot");
		anim2.SetTrigger("ChargeShoot");
	}

	public void ReadyGun()
	{
		gunReady = true;
	}

	public void Click()
	{
		if (altVersion)
		{
			MonoSingleton<WeaponCharges>.Instance.revaltpickupcharges[gunVariation] = 0f;
		}
		if (gunVariation == 2)
		{
			chargingPierce = false;
			twirlRecovery = false;
		}
	}

	public void InstaClick()
	{
		//IL_0042: 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_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		if (altVersion)
		{
			for (int i = 0; i < MonoSingleton<WeaponCharges>.Instance.revaltpickupcharges.Length; i++)
			{
				MonoSingleton<WeaponCharges>.Instance.revaltpickupcharges[i] = 0f;
			}
			Object.Instantiate<GameObject>(quickTwirlEffect, ((Component)cylinder).transform.position, ((Component)this).transform.rotation).transform.SetParent(((Component)cylinder).transform);
			Object.Instantiate<GameObject>(quickTwirlEffect, ((Component)cylinder2).transform.position, ((Component)this).transform.rotation).transform.SetParent(((Component)cylinder2).transform);
			anim.Rebind();
			anim2.Rebind();
			anim.Play("ShootTwirl", -1, 0f);
			anim2.Play("ShootTwirl", -1, 0f);
		}
	}

	public void MaxCharge()
	{
		if (gunVariation == 0)
		{
			pierceCharge = 100f;
		}
		else
		{
			CheckCoinCharges();
		}
	}

	public void DelayedShoot()
	{
		Shoot();
	}

	public void DelayedShoot2()
	{
		Shoot(2);
	}

	public void CheckCoinCharges()
	{
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		if (coinPanelsCharged == null || coinPanelsCharged.Length == 0)
		{
			coinPanelsCharged = new bool[coinPanels.Length];
		}
		coinCharge = ((gunVariation == 1) ? wc.rev1charge : wc.rev2charge);
		for (int i = 0; i < coinPanels.Length; i++)
		{
			if (altVersion && gunVariation == 2)
			{
				coinPanels[i].fillAmount = coinCharge / 300f;
			}
			else
			{
				coinPanels[i].fillAmount = coinCharge / 100f - (float)i;
			}
			if (coinPanels[i].fillAmount < 1f)
			{
				((Graphic)coinPanels[i]).color = ((gunVariation == 1) ? Color.red : Color.gray);
				coinPanelsCharged[i] = false;
				continue;
			}
			if (Object.op_Implicit((Object)(object)MonoSingleton<ColorBlindSettings>.Instance) && ((Graphic)coinPanels[i]).color != MonoSingleton<ColorBlindSettings>.Instance.variationColors[gunVariation])
			{
				((Graphic)coinPanels[i]).color = MonoSingleton<ColorBlindSettings>.Instance.variationColors[gunVariation];
			}
			if (!coinPanelsCharged[i] && (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f))
			{
				if (!Object.op_Implicit((Object)(object)screenAud))
				{
					screenAud = ((Component)((Component)this).GetComponentInChildren<Canvas>()).GetComponent<AudioSource>();
				}
				AudioSourceExtensions.SetPitch(screenAud, 1f + (float)i / 2f);
				AudioSourceExtensions.Play(screenAud, true);
				coinPanelsCharged[i] = true;
			}
		}
	}
}