Decompiled source of HUNKVariants v1.2.0

HunkVariants.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using HunkMod;
using HunkMod.Modules;
using HunkMod.Modules.Components;
using HunkMod.Modules.Survivors;
using HunkMod.Modules.Weapons;
using HunkMod.SkillStates.BaseStates;
using HunkMod.SkillStates.Hunk;
using HunkVariants.RobStates;
using JetBrains.Annotations;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using Survariants;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("HunkVariants")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HunkVariants")]
[assembly: AssemblyTitle("HunkVariants")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace HunkVariants
{
	public class AnalogGlitch : MonoBehaviour
	{
		[SerializeField]
		[Range(0f, 1f)]
		private float _scanLineJitter = 0f;

		[SerializeField]
		[Range(0f, 1f)]
		private float _verticalJump = 0f;

		[SerializeField]
		[Range(0f, 1f)]
		private float _horizontalShake = 0f;

		[SerializeField]
		[Range(0f, 1f)]
		private float _colorDrift = 0f;

		public Shader shader;

		private Material _material;

		private float _verticalJumpTime;

		public float scanLineJitter
		{
			get
			{
				return _scanLineJitter;
			}
			set
			{
				_scanLineJitter = value;
			}
		}

		public float verticalJump
		{
			get
			{
				return _verticalJump;
			}
			set
			{
				_verticalJump = value;
			}
		}

		public float horizontalShake
		{
			get
			{
				return _horizontalShake;
			}
			set
			{
				_horizontalShake = value;
			}
		}

		public float colorDrift
		{
			get
			{
				return _colorDrift;
			}
			set
			{
				_colorDrift = value;
			}
		}

		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if ((Object)(object)_material == (Object)null)
			{
				_material = new Material(shader);
				((Object)_material).hideFlags = (HideFlags)52;
			}
			_verticalJumpTime += Time.deltaTime * _verticalJump * 11.3f;
			float num = Mathf.Clamp01(1f - _scanLineJitter * 1.2f);
			float num2 = 0.002f + Mathf.Pow(_scanLineJitter, 3f) * 0.05f;
			_material.SetVector("_ScanLineJitter", Vector4.op_Implicit(new Vector2(num2, num)));
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(_verticalJump, _verticalJumpTime);
			_material.SetVector("_VerticalJump", Vector4.op_Implicit(val));
			_material.SetFloat("_HorizontalShake", _horizontalShake * 0.2f);
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(_colorDrift * 0.04f, Time.time * 606.11f);
			_material.SetVector("_ColorDrift", Vector4.op_Implicit(val2));
			Graphics.Blit((Texture)(object)source, destination, _material);
		}
	}
	public class JacketComboGauge : MonoBehaviour
	{
		public HUD targetHUD;

		private GameObject targetBody;

		private JacketController jacket;

		private CanvasGroup canvasGroup;

		private JacketGaugeTick[] ticks;

		private float opacity;

		private void Awake()
		{
			canvasGroup = ((Component)this).GetComponent<CanvasGroup>();
			ticks = new JacketGaugeTick[10]
			{
				((Component)((Component)this).transform.Find("Border/Segments/Segment")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (1)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (2)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (3)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (4)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (5)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (6)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (7)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (8)")).gameObject.AddComponent<JacketGaugeTick>(),
				((Component)((Component)this).transform.Find("Border/Segments/Segment (9)")).gameObject.AddComponent<JacketGaugeTick>()
			};
		}

		private void FixedUpdate()
		{
			if (!Object.op_Implicit((Object)(object)targetHUD))
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)targetBody))
			{
				if (!Object.op_Implicit((Object)(object)jacket))
				{
					jacket = targetBody.GetComponent<JacketController>();
				}
				if (!Object.op_Implicit((Object)(object)jacket))
				{
					return;
				}
				HandleOpacity();
				for (int i = 0; i < ticks.Length; i++)
				{
					if (jacket.gauge > i)
					{
						ticks[i].Set(whar: true);
					}
					else
					{
						ticks[i].Set(whar: false);
					}
				}
			}
			else if (Object.op_Implicit((Object)(object)targetHUD.targetBodyObject))
			{
				targetBody = targetHUD.targetBodyObject;
			}
		}

		private void HandleOpacity()
		{
			if (jacket.gauge > 0)
			{
				opacity += Time.fixedDeltaTime * 2f;
			}
			else
			{
				opacity -= Time.fixedDeltaTime * 2f;
			}
			opacity = Mathf.Clamp01(opacity);
			canvasGroup.alpha = opacity;
		}
	}
	public class JacketGaugeTick : MonoBehaviour
	{
		private GameObject mainTick;

		private GameObject secondaryTick;

		private void Awake()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			mainTick = ((Component)((Component)this).transform.Find("SegmentFilled1")).gameObject;
			secondaryTick = ((Component)((Component)this).transform.Find("SegmentFilled2")).gameObject;
			ObjectScaleCurve val = mainTick.AddComponent<ObjectScaleCurve>();
			AnimationCurve val2 = new AnimationCurve();
			val2.keys = (Keyframe[])(object)new Keyframe[3]
			{
				new Keyframe(0f, 0f),
				new Keyframe(0.25f, 1.1f),
				new Keyframe(1f, 1f)
			};
			val2.postWrapMode = (WrapMode)8;
			val2.preWrapMode = (WrapMode)8;
			val.overallCurve = val2;
			val.timeMax = 0.35f;
			val.useOverallCurveOnly = true;
		}

		public void Set(bool whar)
		{
			if (whar)
			{
				mainTick.SetActive(true);
				secondaryTick.SetActive(false);
			}
			else
			{
				mainTick.SetActive(false);
				secondaryTick.SetActive(false);
			}
		}
	}
	public class JacketController : MonoBehaviour
	{
		public float gunTimer = 0f;

		public int gauge = 0;

		public float gaugeDecay = 0f;

		public float gaugeDecayRate = 0f;

		public float gaugeDecayAcceleration = 0.015f;

		public bool isBatCurrentlyHeld = true;

		public JacketFullGauge fullGaugeDisplay;

		private HunkController hunk;

		private HunkWeaponDef[] weaponPool = (HunkWeaponDef[])(object)new HunkWeaponDef[11]
		{
			((BaseWeapon)BaseWeapon<Shotgun>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<SMG>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<Magnum>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<MGL>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<Colt>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<Flamethrower>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<Slugger>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<AssaultRifle>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<GrenadeLauncher>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<Sparkshot>.instance).weaponDef,
			((BaseWeapon)BaseWeapon<StreetSweeper>.instance).weaponDef
		};

		private uint staticPlayID;

		private AnalogGlitch glitchEffect;

		private GameObject batInstance;

		private GameObject maskRenderer;

		private SkinnedMeshRenderer batRenderer;

		private JacketMask mask;

		private CharacterModel characterModel;

		public bool isGaugeFull => gauge >= 10;

		public bool hasGun => Object.op_Implicit((Object)(object)hunk.heldGrenadeDef);

		private void Awake()
		{
			hunk = ((Component)this).GetComponent<HunkController>();
			characterModel = ((Component)this).GetComponentInChildren<CharacterModel>();
		}

		private void Start()
		{
			if (Object.op_Implicit((Object)(object)hunk))
			{
				HunkController obj = hunk;
				obj.onTriggerCounter = (Action<int>)Delegate.Combine(obj.onTriggerCounter, new Action<int>(OnCounter));
				hunk.weaponTracker.lastEquippedIndex = 0;
				batInstance = Object.Instantiate<GameObject>(HunkAssets.mainAssetBundle.LoadAsset<GameObject>("mdlJacketBat"));
				HandleBat();
			}
			maskRenderer = ((Component)hunk.childLocator.FindChild("WeaponModel")).gameObject;
			((MonoBehaviour)this).InvokeRepeating("ApplyBatSkin", 0f, 0.25f);
			((MonoBehaviour)this).InvokeRepeating("ApplyMask", 0.25f, 0.5f);
		}

		private void ApplyBatSkin()
		{
			if (!Object.op_Implicit((Object)(object)batRenderer))
			{
				batRenderer = ((Component)hunk.childLocator.FindChild("KnifeModel")).gameObject.GetComponent<SkinnedMeshRenderer>();
				return;
			}
			batInstance.GetComponentInChildren<MeshFilter>().mesh = batRenderer.sharedMesh;
			((Renderer)batInstance.GetComponentInChildren<MeshRenderer>()).material = ((Renderer)batRenderer).material;
		}

		private void ApplyMask()
		{
			if (!Object.op_Implicit((Object)(object)mask))
			{
				mask = ((Component)this).GetComponent<JacketMask>();
			}
			if (Object.op_Implicit((Object)(object)mask))
			{
				SkinnedMeshRenderer component = ((Component)hunk.childLocator.FindChild("WeaponModel")).gameObject.GetComponent<SkinnedMeshRenderer>();
				switch (mask.maskSkillSlot.skillDef.skillNameToken)
				{
				case "Carl":
					component.sharedMesh = HunkAssets.mainAssetBundle.LoadAsset<Mesh>("meshMaskCarl");
					characterModel.baseRendererInfos[8].defaultMaterial = Plugin.matCarl;
					break;
				case "Richter":
					component.sharedMesh = HunkAssets.mainAssetBundle.LoadAsset<Mesh>("meshMaskRichter");
					characterModel.baseRendererInfos[8].defaultMaterial = Plugin.matRichter;
					break;
				case "Tony":
					component.sharedMesh = HunkAssets.mainAssetBundle.LoadAsset<Mesh>("meshMaskTony");
					characterModel.baseRendererInfos[8].defaultMaterial = Plugin.matTony;
					break;
				case "Dennis":
					component.sharedMesh = HunkAssets.mainAssetBundle.LoadAsset<Mesh>("meshMaskDennis");
					characterModel.baseRendererInfos[8].defaultMaterial = Plugin.matDennis;
					break;
				case "Dennis EX":
					component.sharedMesh = HunkAssets.mainAssetBundle.LoadAsset<Mesh>("meshMaskDennisAlt");
					characterModel.baseRendererInfos[8].defaultMaterial = Plugin.matDennisAlt;
					break;
				}
			}
		}

		private void Update()
		{
			maskRenderer.SetActive(true);
		}

		private void OnCounter(int amount)
		{
			if (((NetworkBehaviour)hunk.characterBody).hasAuthority)
			{
				AuthorityAddGauge(4);
			}
		}

		public void ServerGrantGun()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			HunkWeaponDef val = weaponPool[Random.Range(0, weaponPool.Length)];
			NetworkIdentity component = ((Component)this).gameObject.GetComponent<NetworkIdentity>();
			if (Object.op_Implicit((Object)(object)component))
			{
				NetMessageExtensions.Send((INetMessage)(object)new SyncGunGet(component.netId, ((Component)this).gameObject, val.index), (NetworkDestination)1);
			}
		}

		public void GrantGun(int index)
		{
			//IL_00a7: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: 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)
			if (!Object.op_Implicit((Object)(object)hunk.heldGrenadeDef))
			{
				isBatCurrentlyHeld = false;
				hunk.heldGrenadeDef = HunkWeaponCatalog.GetWeaponFromIndex(index);
				hunk.EquipWeapon(hunk.weaponTracker.equippedIndex, true);
				EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Slide").SetNextStateToMain();
				hunk.skillLocator.secondary.stock = 0;
				hunk.skillLocator.secondary.rechargeStopwatch = 0f;
				GameObject val = Object.Instantiate<GameObject>(HunkAssets.ammoPickupEffectPrefab, hunk.characterBody.aimOrigin + Vector3.up * 0.95f + hunk.characterBody.inputBank.aimDirection * 5f, Quaternion.identity);
				val.GetComponentInChildren<LanguageTextMeshController>().token = hunk.heldGrenadeDef.nameToken;
				Util.PlaySound("sfx_hunk_pickup", ((Component)this).gameObject);
				gunTimer = 7f;
				gaugeDecay = -6f;
			}
		}

		public void ServerAddGauge(int amount = 1)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			NetworkIdentity component = ((Component)this).gameObject.GetComponent<NetworkIdentity>();
			if (Object.op_Implicit((Object)(object)component))
			{
				NetMessageExtensions.Send((INetMessage)(object)new SyncGaugeFill(component.netId, ((Component)this).gameObject, amount), (NetworkDestination)1);
			}
		}

		public void AuthorityAddGauge(int amount = 1)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			NetworkIdentity component = ((Component)this).gameObject.GetComponent<NetworkIdentity>();
			if (Object.op_Implicit((Object)(object)component))
			{
				NetMessageExtensions.Send((INetMessage)(object)new SyncGaugeFill(component.netId, ((Component)this).gameObject, amount), (NetworkDestination)2);
			}
		}

		public void AddGauge(int amount = 1)
		{
			if (Object.op_Implicit((Object)(object)hunk.heldGrenadeDef))
			{
				if (gaugeDecay >= -0.75f)
				{
					gaugeDecay = -0.75f;
				}
				gaugeDecayRate = 0f;
				return;
			}
			bool flag = true;
			if (gauge < 10)
			{
				flag = false;
			}
			gauge += amount;
			gaugeDecay = -0.75f;
			gaugeDecayRate = 0f;
			if (gauge < 11 && !flag && ((NetworkBehaviour)hunk.characterBody).hasAuthority)
			{
				Util.PlayAttackSpeedSound("sfx_jacket_tick", ((Component)this).gameObject, Util.Remap((float)gauge, 0f, 9f, -0.5f, 1.5f));
			}
			if (gauge >= 10)
			{
				if (((NetworkBehaviour)hunk.characterBody).hasAuthority && !flag)
				{
					Util.PlaySound("sfx_jacket_gauge_max", ((Component)this).gameObject);
				}
				gauge = 10;
				gaugeDecay = -6f;
			}
		}

		public void ServerPauseDecay()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			NetworkIdentity component = ((Component)this).gameObject.GetComponent<NetworkIdentity>();
			if (Object.op_Implicit((Object)(object)component))
			{
				NetMessageExtensions.Send((INetMessage)(object)new SyncGaugePause(component.netId, ((Component)this).gameObject), (NetworkDestination)1);
			}
		}

		public void PauseDecay()
		{
			if (!Object.op_Implicit((Object)(object)hunk.heldGrenadeDef))
			{
				if (gaugeDecay >= -0.75f)
				{
					gaugeDecay = -0.75f;
				}
				gaugeDecayRate = 0f;
			}
		}

		private void FixedUpdate()
		{
			gunTimer -= Time.fixedDeltaTime;
			gaugeDecayRate += Time.fixedDeltaTime * gaugeDecayAcceleration;
			gaugeDecay += gaugeDecayRate;
			if (gauge <= 0)
			{
				gauge = 0;
				gaugeDecay = 0f;
				gaugeDecayRate = 0f;
			}
			if (gaugeDecay >= 1f)
			{
				gaugeDecay = 0f;
				gauge--;
				if (((NetworkBehaviour)hunk.characterBody).hasAuthority)
				{
					Util.PlaySound("sfx_jacket_tick_down", ((Component)this).gameObject);
				}
			}
			HandleGlitchEffect();
			HandleStatic();
			HandleBuff();
			HandleBat();
			if (Object.op_Implicit((Object)(object)hunk.heldGrenadeDef))
			{
				hunk.skillLocator.special.SetSkillOverride((object)this, Plugin.throwGunSkillDef, (SkillOverridePriority)5);
			}
			else
			{
				hunk.skillLocator.special.UnsetSkillOverride((object)this, Plugin.throwGunSkillDef, (SkillOverridePriority)5);
			}
			if (hunk.characterBody.HasBuff(Buffs.HiddenInvincibility))
			{
				PauseDecay();
			}
			if (gauge <= 0 && Object.op_Implicit((Object)(object)hunk.heldGrenadeDef))
			{
				DropGun();
			}
		}

		private void DropGun()
		{
			EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Weapon").SetInterruptState((EntityState)(object)new ThrowGun(), (InterruptPriority)2);
		}

		private void HandleStatic()
		{
			if (!((NetworkBehaviour)hunk.characterBody).hasAuthority)
			{
				return;
			}
			if (isGaugeFull || Object.op_Implicit((Object)(object)hunk.heldGrenadeDef))
			{
				if (staticPlayID == 0)
				{
					staticPlayID = Util.PlaySound("sfx_jacket_static", ((Component)this).gameObject);
				}
			}
			else if (staticPlayID != 0)
			{
				AkSoundEngine.StopPlayingID(staticPlayID);
				staticPlayID = 0u;
			}
		}

		private void OnDisable()
		{
			if (staticPlayID != 0)
			{
				AkSoundEngine.StopPlayingID(staticPlayID);
				staticPlayID = 0u;
			}
		}

		private void HandleBuff()
		{
			if (!NetworkServer.active)
			{
				return;
			}
			if (isGaugeFull || Object.op_Implicit((Object)(object)hunk.heldGrenadeDef))
			{
				if (!hunk.characterBody.HasBuff(Plugin.jacketHyperBuff))
				{
					hunk.characterBody.AddBuff(Plugin.jacketHyperBuff);
				}
			}
			else if (hunk.characterBody.HasBuff(Plugin.jacketHyperBuff))
			{
				hunk.characterBody.RemoveBuff(Plugin.jacketHyperBuff);
			}
		}

		private void HandleGlitchEffect()
		{
			if (!((NetworkBehaviour)hunk.characterBody).hasAuthority)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)glitchEffect))
			{
				if (!Object.op_Implicit((Object)(object)glitchEffect.shader))
				{
					glitchEffect.shader = HunkAssets.mainAssetBundle.LoadAsset<Shader>("AnalogGlitch");
				}
				float scanLineJitter = Mathf.Clamp(Util.Remap((float)gauge, 3f, 10f, 0f, 0.12f), 0f, float.PositiveInfinity);
				float verticalJump = Mathf.Clamp(Util.Remap((float)gauge, 3f, 10f, 0f, 0.025f), 0f, float.PositiveInfinity);
				float colorDrift = Mathf.Clamp(Util.Remap((float)gauge, 3f, 10f, 0f, 0.013f), 0f, float.PositiveInfinity);
				glitchEffect.scanLineJitter = scanLineJitter;
				glitchEffect.verticalJump = verticalJump;
				glitchEffect.colorDrift = colorDrift;
			}
			else if (Object.op_Implicit((Object)(object)hunk.characterBody) && Object.op_Implicit((Object)(object)hunk.characterBody.master) && Object.op_Implicit((Object)(object)hunk.characterBody.master.playerCharacterMasterController) && Object.op_Implicit((Object)(object)hunk.characterBody.master.playerCharacterMasterController.networkUser))
			{
				glitchEffect = ((Component)hunk.characterBody.master.playerCharacterMasterController.networkUser.cameraRigController.sceneCam).gameObject.AddComponent<AnalogGlitch>();
				glitchEffect.shader = HunkAssets.mainAssetBundle.LoadAsset<Shader>("AnalogGlitch");
			}
		}

		private void HandleBat()
		{
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: 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_00d3: 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_00ee: 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)
			if (Object.op_Implicit((Object)(object)batInstance))
			{
				if (Object.op_Implicit((Object)(object)hunk.characterModel) && hunk.characterModel.invisibilityCount > 0)
				{
					batInstance.SetActive(false);
				}
				else
				{
					batInstance.SetActive(true);
				}
				if (isBatCurrentlyHeld)
				{
					batInstance.transform.parent = hunk.childLocator.FindChild("KnifeBase");
					batInstance.transform.localPosition = new Vector3(0f, -27f, 2f);
					batInstance.transform.localRotation = Quaternion.Euler(new Vector3(4f, 0f, 180f));
					batInstance.transform.localScale = Vector3.one * 50f;
				}
				else
				{
					batInstance.transform.parent = hunk.childLocator.FindChild("BackWeapon");
					batInstance.transform.localPosition = Vector3.zero;
					batInstance.transform.localRotation = Quaternion.identity;
					batInstance.transform.localScale = Vector3.one * 50f;
				}
			}
		}
	}
	public class JacketCSS : MonoBehaviour
	{
		private GameObject pistolInstance;

		private GameObject batInstance;

		private ChildLocator childLocator;

		private void Awake()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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_0108: 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_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			childLocator = ((Component)this).GetComponent<ChildLocator>();
			GameObject modelPrefab = ((BaseWeapon)BaseWeapon<BroomHC>.instance).weaponDef.modelPrefab;
			pistolInstance = Object.Instantiate<GameObject>(modelPrefab);
			pistolInstance.transform.parent = childLocator.FindChild("Weapon");
			pistolInstance.transform.localPosition = Vector3.zero;
			pistolInstance.transform.localRotation = Quaternion.identity;
			pistolInstance.transform.localScale = Vector3.one;
			modelPrefab = HunkAssets.mainAssetBundle.LoadAsset<GameObject>("mdlJacketBat");
			batInstance = Object.Instantiate<GameObject>(modelPrefab);
			batInstance.transform.parent = childLocator.FindChild("KnifeBase");
			batInstance.transform.localPosition = new Vector3(0f, -27f, 2f);
			batInstance.transform.localRotation = Quaternion.Euler(new Vector3(4f, 0f, 180f));
			batInstance.transform.localScale = Vector3.one * 50f;
			HunkAssets.ConvertAllRenderersToHopooShader(batInstance, true);
		}
	}
	public class JacketFullGauge : MonoBehaviour
	{
		public HUD targetHUD;

		public float smoothSpeed = 8f;

		public Vector3 activePosition = new Vector3(0f, -230f, 0f);

		public Vector3 inactivePosition = new Vector3(0f, -900f, 0f);

		private GameObject targetBody;

		private JacketController jacket;

		private Image fill;

		private TextMeshProUGUI label;

		private Vector3 desiredPosition;

		private RectTransform rectTransform;

		private GameObject activationRing;

		private Animator animator;

		private void Awake()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: 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_0154: Unknown result type (might be due to invalid IL or missing references)
			fill = ((Component)((Component)this).transform.Find("Center/Outer/Fill")).gameObject.GetComponent<Image>();
			rectTransform = ((Component)this).GetComponent<RectTransform>();
			activationRing = ((Component)((Component)this).transform.Find("Center/ActivationRing")).gameObject;
			animator = ((Component)this).GetComponent<Animator>();
			ObjectScaleCurve val = activationRing.AddComponent<ObjectScaleCurve>();
			AnimationCurve val2 = new AnimationCurve();
			val2.keys = (Keyframe[])(object)new Keyframe[4]
			{
				new Keyframe(0f, 0f),
				new Keyframe(0.1f, 0.85f),
				new Keyframe(0.8f, 0.5f),
				new Keyframe(1f, 0f)
			};
			val2.postWrapMode = (WrapMode)8;
			val2.preWrapMode = (WrapMode)8;
			val.overallCurve = val2;
			val.timeMax = 0.35f;
			val.useOverallCurveOnly = true;
			activationRing.SetActive(false);
			label = ((Component)((Component)this).transform.Find("Center/Inner/Label")).gameObject.GetComponent<TextMeshProUGUI>();
			((TMP_Text)label).font = HunkAssets.hgFont;
			desiredPosition = inactivePosition;
			if (Object.op_Implicit((Object)(object)rectTransform))
			{
				((Transform)rectTransform).localPosition = desiredPosition;
			}
		}

		private void FixedUpdate()
		{
			if (!Object.op_Implicit((Object)(object)targetHUD))
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)targetBody))
			{
				if (!Object.op_Implicit((Object)(object)jacket))
				{
					jacket = targetBody.GetComponent<JacketController>();
				}
				if (Object.op_Implicit((Object)(object)jacket))
				{
					jacket.fullGaugeDisplay = this;
					HandleMovement();
					HandleFill();
				}
			}
			else if (Object.op_Implicit((Object)(object)targetHUD.targetBodyObject))
			{
				targetBody = targetHUD.targetBodyObject;
			}
		}

		private void HandleMovement()
		{
			//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_0025: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			if (jacket.hasGun || !jacket.isGaugeFull)
			{
				desiredPosition = inactivePosition;
			}
			else
			{
				desiredPosition = activePosition;
			}
			if (Object.op_Implicit((Object)(object)rectTransform))
			{
				((Transform)rectTransform).localPosition = Vector3.Slerp(((Transform)rectTransform).localPosition, desiredPosition, smoothSpeed * Time.fixedDeltaTime);
			}
		}

		private void HandleFill()
		{
			float fillAmount = Mathf.Clamp(Util.Remap(jacket.gaugeDecay, -5f, 1f, 1f, 0f), 0f, 1f);
			fill.fillAmount = fillAmount;
		}

		public void OnActivation()
		{
			activationRing.SetActive(false);
			activationRing.SetActive(true);
			animator.PlayInFixedTime("Pressed");
		}
	}
	public class JacketGaugeSkillDef : SkillDef
	{
		protected class InstanceData : BaseSkillInstanceData
		{
			public JacketController jacket;
		}

		public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot)
		{
			return (BaseSkillInstanceData)(object)new InstanceData
			{
				jacket = ((Component)skillSlot).GetComponent<JacketController>()
			};
		}

		private static bool IsGaugeFull([NotNull] GenericSkill skillSlot)
		{
			JacketController jacket = ((InstanceData)(object)skillSlot.skillInstanceData).jacket;
			return (Object)(object)jacket != (Object)null && jacket.isGaugeFull;
		}

		public override bool CanExecute([NotNull] GenericSkill skillSlot)
		{
			return IsGaugeFull(skillSlot) && ((SkillDef)this).CanExecute(skillSlot);
		}

		public override bool IsReady([NotNull] GenericSkill skillSlot)
		{
			return ((SkillDef)this).IsReady(skillSlot) && IsGaugeFull(skillSlot);
		}
	}
	public class JacketMask : MonoBehaviour
	{
		public GenericSkill maskSkillSlot;
	}
	internal class SyncGunGet : INetMessage, ISerializableObject
	{
		private NetworkInstanceId netId;

		private GameObject target;

		private int index;

		public SyncGunGet()
		{
		}

		public SyncGunGet(NetworkInstanceId netId, GameObject target, int index)
		{
			//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)
			this.netId = netId;
			this.target = target;
			this.index = index;
		}

		public void Deserialize(NetworkReader reader)
		{
			//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)
			netId = reader.ReadNetworkId();
			target = reader.ReadGameObject();
			index = reader.ReadInt32();
		}

		public void OnReceived()
		{
			if (Object.op_Implicit((Object)(object)target))
			{
				JacketController component = target.GetComponent<JacketController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.GrantGun(index);
				}
			}
		}

		public void Serialize(NetworkWriter writer)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			writer.Write(netId);
			writer.Write(target);
			writer.Write(index);
		}
	}
	internal class SyncGaugeFill : INetMessage, ISerializableObject
	{
		private NetworkInstanceId netId;

		private GameObject target;

		private int amount;

		public SyncGaugeFill()
		{
		}

		public SyncGaugeFill(NetworkInstanceId netId, GameObject target, int amount)
		{
			//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)
			this.netId = netId;
			this.target = target;
			this.amount = amount;
		}

		public void Deserialize(NetworkReader reader)
		{
			//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)
			netId = reader.ReadNetworkId();
			target = reader.ReadGameObject();
			amount = reader.ReadInt32();
		}

		public void OnReceived()
		{
			if (Object.op_Implicit((Object)(object)target))
			{
				JacketController component = target.GetComponent<JacketController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.AddGauge(amount);
				}
			}
		}

		public void Serialize(NetworkWriter writer)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			writer.Write(netId);
			writer.Write(target);
			writer.Write(amount);
		}
	}
	internal class SyncGaugePause : INetMessage, ISerializableObject
	{
		private NetworkInstanceId netId;

		private GameObject target;

		public SyncGaugePause()
		{
		}

		public SyncGaugePause(NetworkInstanceId netId, GameObject target)
		{
			//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)
			this.netId = netId;
			this.target = target;
		}

		public void Deserialize(NetworkReader reader)
		{
			//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)
			netId = reader.ReadNetworkId();
			target = reader.ReadGameObject();
		}

		public void OnReceived()
		{
			if (Object.op_Implicit((Object)(object)target))
			{
				JacketController component = target.GetComponent<JacketController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.PauseDecay();
				}
			}
		}

		public void Serialize(NetworkWriter writer)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			writer.Write(netId);
			writer.Write(target);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.rob.HunkVariants", "HunkVariants", "1.2.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string MODUID = "com.rob.HunkVariants";

		public static AssetBundle mainAssetBundle;

		internal static Material commandoMat;

		public static GameObject jacketBodyPrefab;

		public static GameObject jacketDisplayPrefab;

		public static GameObject jacketMasterPrefab;

		public static SurvivorDef jacketSurvivorDef;

		public static GameObject helldiverBodyPrefab;

		public static GameObject helldiverDisplayPrefab;

		public static GameObject helldiverMasterPrefab;

		public static SurvivorDef helldiverSurvivorDef;

		public static SkillDef throwGunSkillDef;

		public static SkillDef defaultMaskDef;

		public static SkillDef carlMaskDef;

		public static SkillDef richterMaskDef;

		public static SkillDef tonyMaskDef;

		public static SkillDef dennisMaskDef;

		public static SkillDef dennisAltMaskDef;

		public static Material matCarl;

		public static Material matRichter;

		public static Material matTony;

		public static Material matDennis;

		public static Material matDennisAlt;

		public static BuffDef jacketHyperBuff;

		private void Awake()
		{
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HunkVariants.robhunkvariants"))
			{
				mainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
			CreateJacketBody();
			CreateJacketSurvivor();
			NetworkingAPI.RegisterMessageType<SyncGaugeFill>();
			NetworkingAPI.RegisterMessageType<SyncGaugePause>();
			NetworkingAPI.RegisterMessageType<SyncGunGet>();
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)commandoMat))
			{
				commandoMat = Resources.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial;
			}
			Material val = Object.Instantiate<Material>(commandoMat);
			Material val2 = mainAssetBundle.LoadAsset<Material>(materialName);
			if (!Object.op_Implicit((Object)(object)val2))
			{
				return commandoMat;
			}
			((Object)val).name = materialName;
			val.SetColor("_Color", val2.GetColor("_Color"));
			val.SetTexture("_MainTex", val2.GetTexture("_MainTex"));
			val.SetColor("_EmColor", emissionColor);
			val.SetFloat("_EmPower", emission);
			val.SetTexture("_EmTex", val2.GetTexture("_EmissionMap"));
			if (normalStrength > 0f)
			{
				val.SetTexture("_NormalTex", val2.GetTexture("_BumpMap"));
			}
			val.SetFloat("_NormalStrength", normalStrength);
			return val;
		}

		public static Material CreateMaterial(string materialName)
		{
			return CreateMaterial(materialName, 0f);
		}

		public static Material CreateMaterial(string materialName, float emission)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, Color.black);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, emissionColor, 0f);
		}

		private void CreateJacketBody()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0063: Expected O, but got Unknown
			//IL_00a9: 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_00f6: 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_0146: Expected O, but got Unknown
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Expected O, but got Unknown
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Expected O, but got Unknown
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fa: Expected O, but got Unknown
			//IL_0540: Unknown result type (might be due to invalid IL or missing references)
			//IL_0545: Unknown result type (might be due to invalid IL or missing references)
			//IL_058d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Expected O, but got Unknown
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_0628: Unknown result type (might be due to invalid IL or missing references)
			//IL_0670: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c0: Expected O, but got Unknown
			//IL_0706: Unknown result type (might be due to invalid IL or missing references)
			//IL_070b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0753: Unknown result type (might be due to invalid IL or missing references)
			//IL_079c: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a3: Expected O, but got Unknown
			//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0836: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dd: Expected O, but got Unknown
			//IL_08fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_091d: Unknown result type (might be due to invalid IL or missing references)
			//IL_091f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0928: Unknown result type (might be due to invalid IL or missing references)
			//IL_094b: Unknown result type (might be due to invalid IL or missing references)
			//IL_094d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0956: Unknown result type (might be due to invalid IL or missing references)
			//IL_0979: Unknown result type (might be due to invalid IL or missing references)
			//IL_097b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0984: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2e: Expected O, but got Unknown
			//IL_0a4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab7: Expected O, but got Unknown
			//IL_0afd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba3: Expected O, but got Unknown
			//IL_0bc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2d: Expected O, but got Unknown
			//IL_0c73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c78: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d30: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d37: Expected O, but got Unknown
			//IL_0d54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dcd: Expected O, but got Unknown
			//IL_0dea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f3c: Expected O, but got Unknown
			jacketBodyPrefab = PrefabAPI.InstantiateClone(Hunk.characterPrefab, "RobJacketBody", true);
			jacketBodyPrefab.AddComponent<JacketController>();
			SkillDef val = Skills.CreatePrimarySkillDef(new SerializableEntityStateType(typeof(SwingWeapon)), "Weapon", "No Witnesses", "Swing your bat for <style=cIsDamage>320% damage</style>. Each hit fills your <color=#F20A42>Combo Meter</color>.", HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texJacketPrimaryIcon"), false);
			val.interruptPriority = (InterruptPriority)1;
			SkillDefInfo val2 = new SkillDefInfo();
			val2.skillName = "JacketDiscard";
			val2.skillNameToken = "Discard";
			val2.skillDescriptionToken = "Throw your current gun for <style=cIsDamage>1000% damage</style>, refunding half your <color=#F20A42>Combo Meter</color>.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texCancelIcon");
			val2.activationState = new SerializableEntityStateType(typeof(ThrowGun));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)2;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = true;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			throwGunSkillDef = Skills.CreateSkillDef(val2);
			val2 = new SkillDefInfo();
			val2.skillName = "JacketEquipGun";
			val2.skillNameToken = "Army Of One";
			val2.skillDescriptionToken = "Requires full <color=#F20A42>Combo Meter</color>. Equip a <style=cIsDamage>random gun</style> that lasts until your meter is depleted.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texJacketEquipIcon");
			val2.activationState = new SerializableEntityStateType(typeof(EquipGun));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 1f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)2;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			SkillDef skillDef = (SkillDef)(object)CreateSkillDef(val2);
			CharacterBody component = jacketBodyPrefab.GetComponent<CharacterBody>();
			component.baseNameToken = "Jacket";
			component.portraitIcon = HunkAssets.mainAssetBundle.LoadAsset<Texture>("texJacketIcon");
			component.bodyColor = new Color(0.9490196f, 2f / 51f, 22f / 85f);
			GameObject gameObject = ((Component)jacketBodyPrefab.GetComponentInChildren<ModelLocator>().modelTransform).gameObject;
			ModelSkinController component2 = gameObject.GetComponent<ModelSkinController>();
			component2.skins = (SkinDef[])(object)new SkinDef[1] { Hunk.jacketSkinDef };
			SkillLocator component3 = jacketBodyPrefab.GetComponent<SkillLocator>();
			component3.passiveSkill.enabled = true;
			component3.passiveSkill.keywordToken = "";
			component3.passiveSkill.icon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texJacketPassiveIcon");
			component3.passiveSkill.skillNameToken = "Killing Spree";
			component3.passiveSkill.skillDescriptionToken = "Jacket fills up a <color=#F20A42>Combo Meter</color> by killing enemies. When full, gain a burst of <style=cIsDamage>attack speed</style> and <style=cIsDamage>movement speed</style>.";
			GenericSkill[] components = jacketBodyPrefab.GetComponents<GenericSkill>();
			foreach (GenericSkill val3 in components)
			{
				Object.Destroy((Object)(object)val3);
			}
			val2 = new SkillDefInfo();
			val2.skillName = "RichardMask";
			val2.skillNameToken = "Richard";
			val2.skillDescriptionToken = "Does nothing.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texMaskRichardIcon");
			val2.activationState = new SerializableEntityStateType(typeof(Idle));
			val2.activationStateMachineName = "";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 2;
			val2.stockToConsume = 1;
			defaultMaskDef = Skills.CreateSkillDef(val2);
			val2 = new SkillDefInfo();
			val2.skillName = "CarlMask";
			val2.skillNameToken = "Carl";
			val2.skillDescriptionToken = "Does nothing yet.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texMaskCarlIcon");
			val2.activationState = new SerializableEntityStateType(typeof(Idle));
			val2.activationStateMachineName = "";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 2;
			val2.stockToConsume = 1;
			carlMaskDef = Skills.CreateSkillDef(val2);
			val2 = new SkillDefInfo();
			val2.skillName = "RichterMask";
			val2.skillNameToken = "Richter";
			val2.skillDescriptionToken = "Does nothing yet.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texMaskRichterIcon");
			val2.activationState = new SerializableEntityStateType(typeof(Idle));
			val2.activationStateMachineName = "";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 2;
			val2.stockToConsume = 1;
			richterMaskDef = Skills.CreateSkillDef(val2);
			val2 = new SkillDefInfo();
			val2.skillName = "TonyMask";
			val2.skillNameToken = "Tony";
			val2.skillDescriptionToken = "Does nothing yet.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texMaskRichardIcon");
			val2.activationState = new SerializableEntityStateType(typeof(Idle));
			val2.activationStateMachineName = "";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 2;
			val2.stockToConsume = 1;
			tonyMaskDef = Skills.CreateSkillDef(val2);
			val2 = new SkillDefInfo();
			val2.skillName = "DennisMask";
			val2.skillNameToken = "Dennis";
			val2.skillDescriptionToken = "Does nothing yet.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texMaskRichardIcon");
			val2.activationState = new SerializableEntityStateType(typeof(Idle));
			val2.activationStateMachineName = "";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 2;
			val2.stockToConsume = 1;
			dennisMaskDef = Skills.CreateSkillDef(val2);
			val2 = new SkillDefInfo();
			val2.skillName = "DennisAltMask";
			val2.skillNameToken = "Dennis EX";
			val2.skillDescriptionToken = "Does nothing yet.";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texMaskRichardIcon");
			val2.activationState = new SerializableEntityStateType(typeof(Idle));
			val2.activationStateMachineName = "";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 2;
			val2.stockToConsume = 1;
			dennisAltMaskDef = Skills.CreateSkillDef(val2);
			matCarl = HunkAssets.CreateMaterial("matCarl");
			matRichter = HunkAssets.CreateMaterial("matRichter");
			matTony = HunkAssets.CreateMaterial("matTony");
			matDennis = HunkAssets.CreateMaterial("matDennis1");
			matDennisAlt = HunkAssets.CreateMaterial("matDennis2");
			GenericSkill val4 = jacketBodyPrefab.AddComponent<GenericSkill>();
			SkillFamily val5 = new SkillFamily();
			val5.catalogIndex = 0;
			val5.defaultVariantIndex = 0u;
			SkillFamily obj = val5;
			Variant[] array = new Variant[5];
			Variant val6 = new Variant
			{
				skillDef = defaultMaskDef,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array[0] = val6;
			val6 = new Variant
			{
				skillDef = carlMaskDef,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array[1] = val6;
			val6 = new Variant
			{
				skillDef = tonyMaskDef,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array[2] = val6;
			val6 = new Variant
			{
				skillDef = dennisMaskDef,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array[3] = val6;
			val6 = new Variant
			{
				skillDef = dennisAltMaskDef,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array[4] = val6;
			obj.variants = (Variant[])(object)array;
			SkillFamily val7 = (val4._skillFamily = val5);
			val4.skillName = "JacketMask";
			val4.hideInCharacterSelect = false;
			jacketBodyPrefab.AddComponent<JacketMask>().maskSkillSlot = val4;
			ContentAddition.AddSkillFamily(val7);
			GenericSkill val8 = jacketBodyPrefab.AddComponent<GenericSkill>();
			val5 = new SkillFamily();
			val5.catalogIndex = 0;
			val5.defaultVariantIndex = 0u;
			SkillFamily obj2 = val5;
			Variant[] array2 = new Variant[1];
			val6 = new Variant
			{
				skillDef = val,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array2[0] = val6;
			obj2.variants = (Variant[])(object)array2;
			val7 = (val8._skillFamily = val5);
			val8.skillName = "JacketPrimary";
			val8.hideInCharacterSelect = false;
			jacketBodyPrefab.GetComponent<SkillLocator>().primary = val8;
			ContentAddition.AddSkillFamily(val7);
			val2 = new SkillDefInfo();
			val2.skillName = "JacketAim";
			val2.skillNameToken = "Dead Eye";
			val2.skillDescriptionToken = "ROB_HUNK_BODY_SECONDARY_AIM_DESCRIPTION";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texJacketAimIcon");
			val2.activationState = new SerializableEntityStateType(typeof(SteadyAim));
			val2.activationStateMachineName = "Slide";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0.4f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.resetCooldownTimerOnUse = false;
			val2.isCombatSkill = true;
			val2.mustKeyPress = false;
			val2.cancelSprintingOnActivation = true;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 0;
			SkillDef skillDef2 = Skills.CreateSkillDef(val2);
			GenericSkill val9 = jacketBodyPrefab.AddComponent<GenericSkill>();
			val5 = new SkillFamily();
			val5.catalogIndex = 0;
			val5.defaultVariantIndex = 0u;
			SkillFamily obj3 = val5;
			Variant[] array3 = new Variant[1];
			val6 = new Variant
			{
				skillDef = skillDef2,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array3[0] = val6;
			obj3.variants = (Variant[])(object)array3;
			val7 = (val9._skillFamily = val5);
			val9.skillName = "JacketSecondary";
			val9.hideInCharacterSelect = false;
			jacketBodyPrefab.GetComponent<SkillLocator>().secondary = val9;
			ContentAddition.AddSkillFamily(val7);
			val2 = new SkillDefInfo();
			val2.skillName = "JacketDodge";
			val2.skillNameToken = "Urban Evasion";
			val2.skillDescriptionToken = "ROB_HUNK_BODY_UTILITY_DODGE_DESCRIPTION";
			val2.skillIcon = HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texJacketDodgeIcon");
			val2.activationState = new SerializableEntityStateType(typeof(Step));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 2;
			val2.baseRechargeInterval = 6f;
			val2.beginSkillCooldownOnSkillEnd = true;
			val2.canceledFromSprinting = false;
			val2.forceSprintDuringState = true;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)2;
			val2.resetCooldownTimerOnUse = true;
			val2.isCombatSkill = false;
			val2.mustKeyPress = true;
			val2.cancelSprintingOnActivation = false;
			val2.rechargeStock = 99;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			SkillDef val10 = (SkillDef)(object)Skills.CreateAwesomeSkillDef(val2);
			val10.keywordTokens = new string[2] { "ROB_HUNK_KEYWORD_PERFECTDODGE", "ROB_HUNK_KEYWORD_COUNTER" };
			GenericSkill val11 = jacketBodyPrefab.AddComponent<GenericSkill>();
			val5 = new SkillFamily();
			val5.catalogIndex = 0;
			val5.defaultVariantIndex = 0u;
			SkillFamily obj4 = val5;
			Variant[] array4 = new Variant[1];
			val6 = new Variant
			{
				skillDef = val10,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array4[0] = val6;
			obj4.variants = (Variant[])(object)array4;
			val7 = (val11._skillFamily = val5);
			val11.skillName = "JacketUtility";
			val11.hideInCharacterSelect = false;
			jacketBodyPrefab.GetComponent<SkillLocator>().utility = val11;
			ContentAddition.AddSkillFamily(val7);
			GenericSkill val12 = jacketBodyPrefab.AddComponent<GenericSkill>();
			val5 = new SkillFamily();
			val5.catalogIndex = 0;
			val5.defaultVariantIndex = 0u;
			SkillFamily obj5 = val5;
			Variant[] array5 = new Variant[1];
			val6 = new Variant
			{
				skillDef = skillDef,
				unlockableDef = null
			};
			((Variant)(ref val6)).viewableNode = null;
			array5[0] = val6;
			obj5.variants = (Variant[])(object)array5;
			val7 = (val12._skillFamily = val5);
			val12.skillName = "JacketSpecial";
			val12.hideInCharacterSelect = false;
			jacketBodyPrefab.GetComponent<SkillLocator>().special = val12;
			ContentAddition.AddSkillFamily(val7);
			((BaseWeapon)new BroomHC()).Init();
			HunkVariantHandler val13 = jacketBodyPrefab.AddComponent<HunkVariantHandler>();
			val13.loadout = (ItemDef[])(object)new ItemDef[1] { ((BaseWeapon)BaseWeapon<BroomHC>.instance).itemDef };
			val13.canLootAmmo = false;
			val13.usesBat = true;
			ContentAddition.AddBody(jacketBodyPrefab);
			jacketDisplayPrefab = PrefabAPI.InstantiateClone(Hunk.displayPrefab, "RobJacketDisplay", true);
			jacketDisplayPrefab.GetComponentInChildren<Animator>().runtimeAnimatorController = HunkAssets.mainAssetBundle.LoadAsset<RuntimeAnimatorController>("animJacketCSS");
			jacketDisplayPrefab.AddComponent<JacketCSS>();
			jacketMasterPrefab = PrefabAPI.InstantiateClone(Hunk.umbraMaster, "RobJacketMonsterMaster", true);
			CharacterMaster component4 = jacketMasterPrefab.GetComponent<CharacterMaster>();
			component4.bodyPrefab = jacketBodyPrefab;
			ContentAddition.AddMaster(jacketMasterPrefab);
			jacketHyperBuff = AddNewBuff("JacketHyper", null, component.bodyColor, canStack: false, isDebuff: false);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			HUD.onHudTargetChangedGlobal += HUDSetup;
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(jacketHyperBuff))
			{
				self.moveSpeed += 3.5f;
				self.attackSpeed += 0.35f;
			}
		}

		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isHidden = false)
		{
			//IL_0010: 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)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = buffName;
			val.buffColor = buffColor;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.eliteDef = null;
			val.iconSprite = buffIcon;
			val.isHidden = isHidden;
			ContentAddition.AddBuffDef(val);
			return val;
		}

		private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
		{
			if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && damageReport.attackerBody.baseNameToken == "Jacket")
			{
				JacketController component = ((Component)damageReport.attackerBody).GetComponent<JacketController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.ServerAddGauge();
				}
			}
		}

		private void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
		{
			if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && damageReport.attackerBody.baseNameToken == "Jacket")
			{
				JacketController component = ((Component)damageReport.attackerBody).GetComponent<JacketController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.ServerPauseDecay();
				}
			}
		}

		public static JacketGaugeSkillDef CreateSkillDef(SkillDefInfo skillDefInfo)
		{
			return CreateSkillDef<JacketGaugeSkillDef>(skillDefInfo);
		}

		public static T CreateSkillDef<T>(SkillDefInfo skillDefInfo) where T : JacketGaugeSkillDef
		{
			T val = ScriptableObject.CreateInstance<T>();
			popuplateSKillDef(skillDefInfo, val);
			ContentAddition.AddSkillDef((SkillDef)(object)val);
			return val;
		}

		private static void popuplateSKillDef(SkillDefInfo skillDefInfo, JacketGaugeSkillDef skillDef)
		{
			//IL_0040: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			((SkillDef)skillDef).skillName = skillDefInfo.skillName;
			((Object)skillDef).name = skillDefInfo.skillName;
			((SkillDef)skillDef).skillNameToken = skillDefInfo.skillNameToken;
			((SkillDef)skillDef).skillDescriptionToken = skillDefInfo.skillDescriptionToken;
			((SkillDef)skillDef).icon = skillDefInfo.skillIcon;
			((SkillDef)skillDef).activationState = skillDefInfo.activationState;
			((SkillDef)skillDef).activationStateMachineName = skillDefInfo.activationStateMachineName;
			((SkillDef)skillDef).baseMaxStock = skillDefInfo.baseMaxStock;
			((SkillDef)skillDef).baseRechargeInterval = skillDefInfo.baseRechargeInterval;
			((SkillDef)skillDef).beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd;
			((SkillDef)skillDef).canceledFromSprinting = skillDefInfo.canceledFromSprinting;
			((SkillDef)skillDef).forceSprintDuringState = skillDefInfo.forceSprintDuringState;
			((SkillDef)skillDef).fullRestockOnAssign = skillDefInfo.fullRestockOnAssign;
			((SkillDef)skillDef).interruptPriority = skillDefInfo.interruptPriority;
			((SkillDef)skillDef).resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse;
			((SkillDef)skillDef).isCombatSkill = skillDefInfo.isCombatSkill;
			((SkillDef)skillDef).mustKeyPress = skillDefInfo.mustKeyPress;
			((SkillDef)skillDef).cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation;
			((SkillDef)skillDef).rechargeStock = skillDefInfo.rechargeStock;
			((SkillDef)skillDef).requiredStock = skillDefInfo.requiredStock;
			((SkillDef)skillDef).stockToConsume = skillDefInfo.stockToConsume;
			((SkillDef)skillDef).keywordTokens = skillDefInfo.keywordTokens;
		}

		private void CreateJacketSurvivor()
		{
			//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)
			jacketSurvivorDef = ScriptableObject.CreateInstance<SurvivorDef>();
			jacketSurvivorDef.bodyPrefab = jacketBodyPrefab;
			jacketSurvivorDef.displayPrefab = jacketDisplayPrefab;
			jacketSurvivorDef.displayNameToken = "Jacket";
			jacketSurvivorDef.descriptionToken = "";
			jacketSurvivorDef.outroFlavorToken = "..and so he left, buried behind the mask";
			jacketSurvivorDef.mainEndingEscapeFailureFlavorToken = "..and so he vanished doo doo fart";
			jacketSurvivorDef.desiredSortPosition = 3.99f;
			jacketSurvivorDef.unlockableDef = null;
			jacketSurvivorDef.cachedName = "Jacket";
			jacketSurvivorDef.primaryColor = new Color(29f / 51f, 0f, 1f);
			jacketSurvivorDef.hidden = true;
			ContentAddition.AddSurvivorDef(jacketSurvivorDef);
			SurvivorVariantDef val = ScriptableObject.CreateInstance<SurvivorVariantDef>();
			((Object)val).name = "Jacket";
			val.DisplayName = "Jacket";
			val.VariantSurvivor = jacketSurvivorDef;
			val.TargetSurvivor = Hunk.survivorDef;
			val.RequiredUnlock = null;
			val.Description = "Hmm";
			SurvivorVariantCatalog.AddSurvivorVariant(val);
		}

		internal static void HUDSetup(HUD hud)
		{
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_0108: 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_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: 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_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: 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_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)hud.targetBodyObject) && Object.op_Implicit((Object)(object)hud.targetMaster) && (Object)(object)hud.targetMaster.bodyPrefab == (Object)(object)jacketBodyPrefab && ((NetworkBehaviour)hud.targetMaster).hasAuthority)
			{
				Transform val = ((Component)hud).transform.Find("MainContainer/MainUIArea/SpringCanvas/BottomLeftCluster/BarRoots/LevelDisplayCluster");
				GameObject val2 = Object.Instantiate<GameObject>(HunkAssets.mainAssetBundle.LoadAsset<GameObject>("ComboGauge2"), val);
				((Object)val2).name = "JacketComboGauge";
				val2.transform.SetParent(((Component)hud).transform.Find("MainContainer/MainUIArea/CrosshairCanvas/CrosshairExtras"));
				val2.AddComponent<JacketComboGauge>().targetHUD = hud;
				RectTransform component = val2.GetComponent<RectTransform>();
				((Transform)component).localScale = new Vector3(0.1f, 3f, 5f);
				component.anchorMin = new Vector2(0f, 0f);
				component.anchorMax = new Vector2(0f, 0f);
				component.offsetMin = new Vector2(-150f, 0f);
				component.offsetMax = new Vector2(150f, 0f);
				component.pivot = new Vector2(0f, 0f);
				component.anchoredPosition = new Vector2(0f, 0f);
				((Transform)component).localPosition = new Vector3(-400f, 0f, 0f);
				((Transform)component).localRotation = Quaternion.Euler(new Vector3(352f, 15f, 350f));
				component.sizeDelta = new Vector2(100f, 10f);
				GameObject val3 = Object.Instantiate<GameObject>(HunkAssets.mainAssetBundle.LoadAsset<GameObject>("JacketFullGauge"), val);
				((Object)val3).name = "JacketFullGauge";
				val3.transform.SetParent(((Component)hud).transform.Find("MainContainer/MainUIArea/CrosshairCanvas/CrosshairExtras"));
				val3.AddComponent<JacketFullGauge>().targetHUD = hud;
				component = val3.GetComponent<RectTransform>();
				((Transform)component).localScale = new Vector3(0.35f, 0.45f, 0.35f);
				component.anchorMin = new Vector2(0f, 0f);
				component.anchorMax = new Vector2(0f, 0f);
				component.offsetMin = new Vector2(-150f, 0f);
				component.offsetMax = new Vector2(150f, 0f);
				component.pivot = new Vector2(0f, 0f);
				component.anchoredPosition = new Vector2(0f, 0f);
				((Transform)component).localPosition = new Vector3(0f, -300f, 0f);
				((Transform)component).localRotation = Quaternion.Euler(new Vector3(60f, 0f, 0f));
				component.sizeDelta = new Vector2(10f, 10f);
			}
		}

		private static RendererInfo[] SkinRendererInfos(RendererInfo[] defaultRenderers, Material[] materials)
		{
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length];
			defaultRenderers.CopyTo(array, 0);
			for (int i = 0; i < materials.Length; i++)
			{
				if (Object.op_Implicit((Object)(object)materials[i]))
				{
					array[i].defaultMaterial = materials[i];
				}
			}
			return array;
		}

		private void CreateHelldiverBody()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_0164: 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_016f: 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_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: 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_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			helldiverBodyPrefab = PrefabAPI.InstantiateClone(Hunk.characterPrefab, "RobHelldiverBody", true);
			CharacterBody component = helldiverBodyPrefab.GetComponent<CharacterBody>();
			component.baseNameToken = "Helldiver";
			component.portraitIcon = HunkAssets.mainAssetBundle.LoadAsset<Texture>("texJacketIcon");
			component.bodyColor = new Color(29f / 51f, 0f, 1f);
			GameObject gameObject = ((Component)helldiverBodyPrefab.GetComponentInChildren<ModelLocator>().modelTransform).gameObject;
			ModelSkinController component2 = gameObject.GetComponent<ModelSkinController>();
			ChildLocator component3 = gameObject.GetComponent<ChildLocator>();
			CharacterModel component4 = gameObject.GetComponent<CharacterModel>();
			SkinnedMeshRenderer mainSkinnedMeshRenderer = component4.mainSkinnedMeshRenderer;
			RendererInfo[] baseRendererInfos = component4.baseRendererInfos;
			SkinDef val = Skins.CreateSkinDef("Default", HunkAssets.mainAssetBundle.LoadAsset<Sprite>("texJacketSkin"), SkinRendererInfos(baseRendererInfos, (Material[])(object)new Material[2]
			{
				CreateMaterial("matHelldiver"),
				HunkAssets.CreateMaterial("matHunk", 1f, Color.white)
			}), mainSkinnedMeshRenderer, gameObject);
			val.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[7]
			{
				new MeshReplacement
				{
					renderer = (Renderer)(object)((Component)component3.FindChild("Model01")).GetComponent<SkinnedMeshRenderer>(),
					mesh = mainAssetBundle.LoadAsset<Mesh>("meshHelldiver")
				},
				new MeshReplacement
				{
					renderer = (Renderer)(object)((Component)component3.FindChild("Model02")).GetComponent<SkinnedMeshRenderer>(),
					mesh = HunkAssets.mainAssetBundle.LoadAsset<Mesh>("meshHunkGloves")
				},
				new MeshReplacement
				{
					renderer = (Renderer)(object)((Component)component3.FindChild("Model03")).GetComponent<SkinnedMeshRenderer>(),
					mesh = null
				},
				new MeshReplacement
				{
					renderer = (Renderer)(object)((Component)component3.FindChild("Model04")).GetComponent<SkinnedMeshRenderer>(),
					mesh = null
				},
				new MeshReplacement
				{
					renderer = (Renderer)(object)((Component)component3.FindChild("Model05")).GetComponent<SkinnedMeshRenderer>(),
					mesh = null
				},
				new MeshReplacement
				{
					renderer = (Renderer)(object)((Component)component3.FindChild("Model06")).GetComponent<SkinnedMeshRenderer>(),
					mesh = null
				},
				new MeshReplacement
				{
					renderer = (Renderer)(object)((Component)component3.FindChild("KnifeModel")).GetComponent<SkinnedMeshRenderer>(),
					mesh = null
				}
			};
			component2.skins = (SkinDef[])(object)new SkinDef[1] { val };
			SkillLocator component5 = helldiverBodyPrefab.GetComponent<SkillLocator>();
			component5.passiveSkill.enabled = false;
			GenericSkill[] components = helldiverBodyPrefab.GetComponents<GenericSkill>();
			Object.Destroy((Object)(object)components[0]);
			Object.Destroy((Object)(object)components[1]);
			Object.Destroy((Object)(object)components[6]);
			HunkVariantHandler val2 = helldiverBodyPrefab.AddComponent<HunkVariantHandler>();
			val2.loadout = (ItemDef[])(object)new ItemDef[2]
			{
				((BaseWeapon)BaseWeapon<SMG>.instance).itemDef,
				((BaseWeapon)BaseWeapon<AssaultRifle>.instance).itemDef
			};
			val2.canLootAmmo = false;
			val2.usesBat = false;
			ContentAddition.AddBody(helldiverBodyPrefab);
			helldiverDisplayPrefab = PrefabAPI.InstantiateClone(Hunk.displayPrefab, "RobHelldiverDisplay", true);
			helldiverMasterPrefab = PrefabAPI.InstantiateClone(Hunk.umbraMaster, "RobHelldiverMonsterMaster", true);
			CharacterMaster component6 = helldiverMasterPrefab.GetComponent<CharacterMaster>();
			component6.bodyPrefab = helldiverBodyPrefab;
			ContentAddition.AddMaster(helldiverMasterPrefab);
		}

		private void CreateHelldiverSurvivor()
		{
			//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)
			helldiverSurvivorDef = ScriptableObject.CreateInstance<SurvivorDef>();
			helldiverSurvivorDef.bodyPrefab = helldiverBodyPrefab;
			helldiverSurvivorDef.displayPrefab = helldiverDisplayPrefab;
			helldiverSurvivorDef.displayNameToken = "Helldiver";
			helldiverSurvivorDef.descriptionToken = "";
			helldiverSurvivorDef.outroFlavorToken = "..and so he left, buried behind the mask";
			helldiverSurvivorDef.mainEndingEscapeFailureFlavorToken = "..and so he vanished doo doo fart";
			helldiverSurvivorDef.desiredSortPosition = 3.99f;
			helldiverSurvivorDef.unlockableDef = null;
			helldiverSurvivorDef.cachedName = "Helldiver";
			helldiverSurvivorDef.primaryColor = new Color(29f / 51f, 0f, 1f);
			helldiverSurvivorDef.hidden = true;
			ContentAddition.AddSurvivorDef(helldiverSurvivorDef);
			SurvivorVariantDef val = ScriptableObject.CreateInstance<SurvivorVariantDef>();
			((Object)val).name = "Helldiver";
			val.DisplayName = "Helldiver";
			val.VariantSurvivor = helldiverSurvivorDef;
			val.TargetSurvivor = Hunk.survivorDef;
			val.RequiredUnlock = null;
			val.Description = "For Super Earth!";
			SurvivorVariantCatalog.AddSurvivorVariant(val);
		}
	}
}
namespace HunkVariants.RobStates
{
	public class EquipGun : BaseHunkSkillState
	{
		private float duration = 0.72f;

		private bool swapped;

		public override void OnEnter()
		{
			((BaseHunkSkillState)this).OnEnter();
			base.hunk.reloadTimer = 1f;
			((EntityState)this).PlayCrossfade("Gesture, Override", "StoreGun", "Swap.playbackRate", duration * 0.5f, 0.1f);
			Util.PlaySound("sfx_hunk_store_gun", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				Util.PlaySound("sfx_jacket_gauge_half", ((EntityState)this).gameObject);
			}
			((EntityState)this).GetComponent<JacketController>().fullGaugeDisplay.OnActivation();
			((EntityState)this).GetComponent<JacketController>().gaugeDecay = -6f;
			((EntityState)this).GetComponent<JacketController>().gaugeDecayRate = 0f;
		}

		public override void FixedUpdate()
		{
			((BaseHunkSkillState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= 0.5f * duration && !swapped)
			{
				swapped = true;
				if (NetworkServer.active)
				{
					((EntityState)this).GetComponent<JacketController>().ServerGrantGun();
				}
				((EntityState)this).PlayAnimation("Gesture, Override", "EquipGun", "Swap.playbackRate", duration, 0f);
				Util.PlaySound(base.hunk.heldGrenadeDef.equipSoundString, ((EntityState)this).gameObject);
			}
			if (!swapped)
			{
				((EntityState)this).skillLocator.secondary.stock = 0;
				((EntityState)this).skillLocator.secondary.rechargeStopwatch = 0f;
			}
			else
			{
				((EntityState)this).skillLocator.secondary.stock = 1;
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0010: 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_0013: Unknown result type (might be due to invalid IL or missing references)
			if (swapped)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)7;
		}
	}
	public class SwingWeapon : BaseMeleeAttack
	{
		private GameObject swingEffectInstance;

		private GameObject knifeInstance;

		private bool knifeHidden;

		public override void OnEnter()
		{
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: 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_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			((BaseHunkSkillState)this).hunk = ((EntityState)this).GetComponent<HunkController>();
			SkillDef knifeSkin = ((BaseHunkSkillState)this).hunk.knifeSkin;
			if (Object.op_Implicit((Object)(object)knifeSkin))
			{
				if (Hunk.knifeSkins.ContainsKey(knifeSkin))
				{
					((BaseHunkSkillState)this).prop = "";
					knifeInstance = CreateKnife(Hunk.knifeSkins[knifeSkin]);
				}
				else
				{
					((BaseHunkSkillState)this).prop = "HiddenKnifeModel";
				}
			}
			base.hitboxName = "Knife";
			base.swingIndex = Random.Range(0, 3);
			base.damageCoefficient = 3.2f;
			base.pushForce = 200f;
			base.baseDuration = 0.9f;
			base.baseEarlyExitTime = 0.55f;
			base.attackRecoil = 4f / ((BaseState)this).attackSpeedStat;
			base.hitHopVelocity = 6f;
			base.attackStartTime = 0.265f;
			base.attackEndTime = 0.5f;
			base.hitStopDuration = 0.18f;
			base.smoothHitstop = true;
			base.swingSoundString = "sfx_jacket_swing_bat";
			base.hitSoundString = "";
			base.impactSound = HunkAssets.batImpactSoundDef.index;
			if (Object.op_Implicit((Object)(object)((BaseHunkSkillState)this).hunk.heldGrenadeDef))
			{
				base.swingSoundString = "";
				base.impactSound = HunkAssets.bashImpactSoundDef.index;
			}
			base.damageType = (DamageType)0;
			switch (base.swingIndex)
			{
			case 0:
				base.muzzleString = "KnifeSwingMuzzle";
				break;
			case 1:
				base.muzzleString = "KnifeSwingMuzzle2";
				break;
			case 2:
				base.muzzleString = "BatSwingMuzzle";
				break;
			}
			if (Object.op_Implicit((Object)(object)((BaseHunkSkillState)this).hunk.heldGrenadeDef))
			{
				base.muzzleString = "GunBashMuzzle";
			}
			((BaseMeleeAttack)this).OnEnter();
			EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Slide").SetNextStateToMain();
			((EntityState)this).skillLocator.secondary.stock = 0;
			((EntityState)this).skillLocator.secondary.rechargeStopwatch = 0f;
			if (Object.op_Implicit((Object)(object)((BaseHunkSkillState)this).hunk.heldGrenadeDef))
			{
				Util.PlaySound("sfx_jacket_bash_foley", ((EntityState)this).gameObject);
				base.swingSoundString = "sfx_jacket_bash_swing";
				base.attack.impactSound = HunkAssets.bashImpactSoundDef.index;
				base.attack.hitEffectPrefab = HunkAssets.batImpactEffect;
				base.swingEffectPrefab = HunkAssets.gunSwingEffect;
			}
			else
			{
				Util.PlaySound("sfx_hunk_kick_foley", ((EntityState)this).gameObject);
				base.swingSoundString = "sfx_jacket_swing_bat";
				base.attack.impactSound = HunkAssets.batImpactSoundDef.index;
				base.attack.hitEffectPrefab = HunkAssets.batImpactEffect;
				base.swingEffectPrefab = HunkAssets.batSwingEffect;
			}
		}

		private GameObject CreateKnife(GameObject modelPrefab)
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((BaseHunkSkillState)this).hunk.variant) && ((BaseHunkSkillState)this).hunk.variant.usesBat)
			{
				return null;
			}
			GameObject val = Object.Instantiate<GameObject>(modelPrefab);
			val.transform.parent = ((BaseState)this).FindModelChild("KnifeBase");
			val.transform.localPosition = Vector3.zero;
			val.transform.localRotation = Quaternion.identity;
			val.transform.localScale = Vector3.one;
			return val;
		}

		public override void FixedUpdate()
		{
			((BaseMeleeAttack)this).FixedUpdate();
			if (((BaseHunkSkillState)this).hunk.isAiming && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			else if (!knifeHidden && base.stopwatch >= 0.85f * base.duration)
			{
				knifeHidden = true;
				if (((BaseHunkSkillState)this).prop != "")
				{
					((Component)((BaseState)this).FindModelChild(((BaseHunkSkillState)this).prop)).gameObject.SetActive(false);
				}
				if (Object.op_Implicit((Object)(object)knifeInstance))
				{
					EntityState.Destroy((Object)(object)knifeInstance);
				}
			}
		}

		public override void OnExit()
		{
			if (!knifeHidden)
			{
				knifeHidden = true;
				if (((BaseHunkSkillState)this).prop != "")
				{
					((Component)((BaseState)this).FindModelChild(((BaseHunkSkillState)this).prop)).gameObject.SetActive(false);
				}
				if (Object.op_Implicit((Object)(object)knifeInstance))
				{
					EntityState.Destroy((Object)(object)knifeInstance);
				}
			}
			((BaseMeleeAttack)this).OnExit();
		}

		protected override void FireAttack()
		{
			//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_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)
			//IL_001d: 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_0044: 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)
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				direction.y = Mathf.Max(direction.y, direction.y * 0.5f);
				((BaseState)this).FindModelChild("MeleePivot").rotation = Util.QuaternionSafeLookRotation(direction);
			}
			((BaseMeleeAttack)this).FireAttack();
		}

		protected override void PlaySwingEffect()
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound(base.swingSoundString, ((EntityState)this).gameObject);
			if (!Object.op_Implicit((Object)(object)base.swingEffectPrefab))
			{
				return;
			}
			Transform val = ((BaseState)this).FindModelChild(base.muzzleString);
			if (Object.op_Implicit((Object)(object)val))
			{
				swingEffectInstance = Object.Instantiate<GameObject>(base.swingEffectPrefab, val);
				if (base.swingIndex == 1 && !Object.op_Implicit((Object)(object)((BaseHunkSkillState)this).hunk.heldGrenadeDef))
				{
					Transform transform = swingEffectInstance.transform;
					transform.localScale *= 0.75f;
				}
				ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = component.initialDuration;
				}
			}
		}

		protected override void TriggerHitStop()
		{
			((BaseMeleeAttack)this).TriggerHitStop();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = 20f;
				}
			}
			if (((EntityState)this).isAuthority)
			{
				JacketController component2 = ((EntityState)this).GetComponent<JacketController>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.AuthorityAddGauge();
				}
			}
		}

		protected override void ClearHitStop()
		{
			((BaseMeleeAttack)this).ClearHitStop();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = component.initialDuration;
				}
			}
		}

		protected override void PlayAttackAnimation()
		{
			if (Object.op_Implicit((Object)(object)((BaseHunkSkillState)this).hunk.heldGrenadeDef))
			{
				((EntityState)this).PlayCrossfade("Gesture, Override", "GunBash", "Knife.playbackRate", base.duration, 0.1f);
			}
			else
			{
				((EntityState)this).PlayCrossfade("Gesture, Override", "SwingKnife" + (1 + base.swingIndex), "Knife.playbackRate", base.duration, 0.1f);
			}
		}

		protected override void SetNextState()
		{
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0021: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			if (base.stopwatch >= 0.5f * base.duration)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)2;
		}
	}
	public class ThrowGun : GenericProjectileBaseState
	{
		public static float baseDuration = 0.75f;

		public static float baseDelayDuration = 0.3f * baseDuration;

		public static float damageCoefficient = 10f;

		public override void OnEnter()
		{
			base.attackSoundString = "";
			base.baseDuration = baseDuration;
			base.baseDelayBeforeFiringProjectile = baseDelayDuration;
			base.damageCoefficient = damageCoefficient;
			base.force = 5000f;
			base.recoilAmplitude = 0.1f;
			base.bloom = 10f;
			((GenericProjectileBaseState)this).OnEnter();
			((EntityState)this).GetComponent<JacketController>().gaugeDecay = -6f;
			((EntityState)this).GetComponent<JacketController>().gaugeDecayRate = 0f;
			((EntityState)this).PlayAnimation("Gesture, Override", "ThrowGrenade", "Grenade.playbackRate", base.duration, 0f);
		}

		public override void FireProjectile()
		{
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: 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)
			Util.PlaySound("sfx_jacket_throw", ((EntityState)this).gameObject);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).gameObject, ((EntityState)this).GetComponent<HunkController>().heldGrenadeDef.primarySkillDef, (SkillOverridePriority)5);
			((EntityState)this).GetComponent<HunkController>().ConsumeGrenade();
			((EntityState)this).GetComponent<JacketController>().gunTimer = 0f;
			((EntityState)this).GetComponent<JacketController>().gauge = Mathf.FloorToInt((float)((EntityState)this).GetComponent<JacketController>().gauge * 0.5f);
			((EntityState)this).GetComponent<JacketController>().isBatCurrentlyHeld = true;
			if (((EntityState)this).isAuthority)
			{
				Ray val = ((BaseState)this).GetAimRay();
				val = ((GenericProjectileBaseState)this).ModifyProjectileAimRay(val);
				((Ray)(ref val)).direction = Util.ApplySpread(((Ray)(ref val)).direction, base.minSpread, base.maxSpread, 1f, 1f, 0f, base.projectilePitchBonus);
				ProjectileManager.instance.FireProjectile(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2ShivProjectile.prefab").WaitForCompletion(), ((Ray)(ref val)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, base.force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 80f);
			}
		}

		public override void FixedUpdate()
		{
			((GenericProjectileBaseState)this).FixedUpdate();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: 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)
			return (InterruptPriority)3;
		}

		public override void PlayAnimation(float duration)
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
			{
				((EntityState)this).PlayAnimation("Gesture, Override", "ThrowGrenade", "Grenade.playbackRate", base.duration, 0f);
			}
		}
	}
}