Decompiled source of PWNerfed v1.0.0

PWNerfed.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Commando;
using HG;
using On.RoR2;
using PhoenixWright.Modules;
using PhoenixWright.Modules.Achievements;
using PhoenixWright.Modules.Survivors;
using PhoenixWright.SkillStates;
using PhoenixWright.SkillStates.BaseStates;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("PhoenixWright")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PhoenixWright")]
[assembly: AssemblyTitle("PhoenixWright")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal string bodyNameToClone = "Commando";

	internal Texture characterPortrait = null;

	internal GameObject crosshair = null;

	internal GameObject podPrefab = null;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen = 0f;

	internal float shield = 0f;

	internal float shieldGrowth = 0f;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth = 0f;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth = 0f;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth = 0f;

	internal float armor = 0f;

	internal float armorGrowth = 0f;

	internal float crit = 1f;

	internal float critGrowth = 0f;

	internal int jumpCount = 1;

	internal Color bodyColor = Color.grey;

	internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f);

	internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f);

	internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f);
}
internal class CustomRendererInfo
{
	internal string childName;

	internal Material material;

	internal bool ignoreOverlays;
}
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public string activationStateMachineName;

	public int baseMaxStock;

	public float baseRechargeInterval;

	public bool beginSkillCooldownOnSkillEnd;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool fullRestockOnAssign;

	public InterruptPriority interruptPriority;

	public bool resetCooldownTimerOnUse;

	public bool isCombatSkill;

	public bool mustKeyPress;

	public bool cancelSprintingOnActivation;

	public int rechargeStock;

	public int requiredStock;

	public int stockToConsume;

	public string[] keywordTokens;
}
namespace PhoenixWright
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Zhank.PWNerf", "PWNerf", "1.0")]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI" })]
	public class PhoenixPlugin : BaseUnityPlugin
	{
		public static int currentStacks;

		public static bool turnaboutActive;

		public bool turnaboutEnabled;

		public const string MODUID = "com.Zhank.PWNerf";

		public const string MODNAME = "PWNerf";

		public const string MODVERSION = "1.0";

		public static PhoenixController phoenixController;

		public const string developerPrefix = "BOK";

		internal List<SurvivorBase> Survivors = new List<SurvivorBase>();

		public static PhoenixPlugin instance;

		private void Awake()
		{
			phoenixController = null;
			instance = this;
			Assets.Initialize();
			Config.ReadConfig();
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			new Phoenix().Initialize();
			new ContentPacks().Initialize();
			ContentManager.onContentPacksAssigned += LateSetup;
			Hook();
			turnaboutActive = true;
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
			SurvivorBase.instance.SetItemDisplays();
		}

		private void Hook()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			CharacterModel.Awake += new hook_Awake(CharacterModel_Awake);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			CharacterBody.FixedUpdate += new hook_FixedUpdate(CharacterBody_FixedUpdate);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.armorBuff))
			{
				self.armor += 0f;
			}
		}

		private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self)
		{
			//IL_0027: 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)
			orig.Invoke(self);
			if (self.baseNameToken == "BOK_PHOENIX_BODY_NAME")
			{
				self.SetBuffCount(Buffs.turnaboutBuff.buffIndex, currentStacks);
				if (currentStacks >= PhoenixController.maxStacks)
				{
					self.skillLocator.primary.UnsetSkillOverride((object)self.skillLocator.primary, Phoenix.primaryBottle, (SkillOverridePriority)4);
					self.skillLocator.primary.UnsetSkillOverride((object)self.skillLocator.primary, Phoenix.primaryKnife, (SkillOverridePriority)4);
					self.skillLocator.primary.UnsetSkillOverride((object)self.skillLocator.primary, Phoenix.primaryPhone, (SkillOverridePriority)4);
					self.skillLocator.primary.UnsetSkillOverride((object)self.skillLocator.primary, Phoenix.primaryServbot, (SkillOverridePriority)4);
					self.skillLocator.primary.SetSkillOverride((object)self.skillLocator.primary, Phoenix.primaryArm, (SkillOverridePriority)4);
					self.skillLocator.secondary.SetSkillOverride((object)self.skillLocator.secondary, Phoenix.secondaryPressStrong, (SkillOverridePriority)4);
					self.skillLocator.utility.SetSkillOverride((object)self.skillLocator.utility, Phoenix.utilityFall, (SkillOverridePriority)4);
					self.skillLocator.special.SetSkillOverride((object)self.skillLocator.special, Phoenix.specialGavelStrong, (SkillOverridePriority)4);
				}
				AkSoundEngine.SetRTPCValue(559438376u, Config.TurnaboutMusic.Value);
			}
		}

		private void CharacterModel_Awake(orig_Awake orig, CharacterModel self)
		{
			orig.Invoke(self);
			if (((Object)((Component)self).gameObject).name.Contains("PhoenixDisplay"))
			{
				if (Config.loweredVolume.Value)
				{
					Util.PlaySound("PhoenixMenuSoundQuiet", ((Component)self).gameObject);
				}
				else
				{
					Util.PlaySound("PhoenixMenuSound", ((Component)self).gameObject);
				}
				currentStacks = 0;
				turnaboutActive = true;
			}
		}
	}
}
namespace PhoenixWright.SkillStates
{
	public class Fall : BaseSkillState
	{
		public static float damageCoefficient = 2f;

		public static float procCoefficient = 5f;

		public static float duration = 0.5f;

		public static float initialSpeedCoefficient = 5f;

		public static float finalSpeedCoefficient = 2.5f;

		private bool hasFired;

		public static string dodgeSoundString = "HenryRoll";

		public static float dodgeFOV = DodgeState.dodgeFOV;

		private float rollSpeed;

		private Vector3 forwardDirection;

		private Vector3 previousPosition;

		protected string hitboxName = "fall";

		protected OverlapAttack attack;

		protected float attackStartTime = 0.001f * duration;

		protected float attackEndTime = 8f * duration;

		public override void OnEnter()
		{
			//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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: 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_0127: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: 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_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Expected O, but got Unknown
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			hasFired = false;
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
				forwardDirection = ((Vector3)(ref val)).normalized;
			}
			Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : forwardDirection);
			Vector3 val3 = Vector3.Cross(Vector3.up, val2);
			float num = Vector3.Dot(forwardDirection, val2);
			float num2 = Vector3.Dot(forwardDirection, val3);
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
				((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed;
			}
			Vector3 val4 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero);
			previousPosition = ((EntityState)this).transform.position - val4;
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 1f);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armorBuff, 2f);
			}
			((BaseState)this).StartAimMode(duration, true);
			((EntityState)this).PlayAnimation("FullBody, Override", "FallFlat", "Roll.playbackRate", duration * 2f);
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayAnimation("FullBody, Override", "GetUp", "Roll.playbackRate", duration * 2f);
			if (Config.loweredVolume.Value)
			{
				Util.PlaySound("FallQuiet", ((EntityState)this).gameObject);
			}
			else
			{
				Util.PlaySound("Fall", ((EntityState)this).gameObject);
			}
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			attack = new OverlapAttack();
			attack.damageType = (DamageType)2;
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
		}

		private void RecalculateRollSpeed()
		{
			rollSpeed = ((BaseState)this).moveSpeedStat * Mathf.Lerp(initialSpeedCoefficient, finalSpeedCoefficient, ((EntityState)this).fixedAge / duration);
		}

		public override void FixedUpdate()
		{
			//IL_0025: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = forwardDirection;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration);
			}
			Vector3 val = ((EntityState)this).transform.position - previousPosition;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && normalized != Vector3.zero)
			{
				Vector3 val2 = normalized * rollSpeed;
				float num = Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f);
				val2 = forwardDirection * num;
				val2.y = 0f;
				((EntityState)this).characterMotor.velocity = val2;
			}
			previousPosition = ((EntityState)this).transform.position;
			if (((EntityState)this).fixedAge >= attackStartTime && ((EntityState)this).fixedAge < attackEndTime)
			{
				FireAttack();
				if (PhoenixController.GetEvidenceType())
				{
					((EntityState)this).skillLocator.utility.Reset();
					PhoenixController.SetEvidenceType(input: false);
					ShufflePrimary();
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.fovOverride = -1f;
			}
			((EntityState)this).OnExit();
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(forwardDirection);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			((BaseSkillState)this).OnDeserialize(reader);
			forwardDirection = reader.ReadVector3();
		}

		private void FireAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				if (Config.loweredVolume.Value)
				{
					Util.PlaySound("FallVoiceQuiet", ((EntityState)this).gameObject);
				}
				else
				{
					Util.PlaySound("FallVoice", ((EntityState)this).gameObject);
				}
			}
			attack.Fire((List<HurtBox>)null);
		}

		private void ShufflePrimary()
		{
			switch (Random.Range(0, 3))
			{
			case 0:
				UnsetAll();
				PhoenixController.SetEvidenceType(input: false);
				break;
			case 1:
				UnsetAll();
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryBottle, (SkillOverridePriority)4);
				PhoenixController.SetEvidenceType(input: false);
				break;
			case 2:
				UnsetAll();
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryServbot, (SkillOverridePriority)4);
				PhoenixController.SetEvidenceType(input: false);
				break;
			}
		}

		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)2;
		}

		private void UnsetAll()
		{
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryBottle, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryKnife, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryPhone, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryServbot, (SkillOverridePriority)4);
		}
	}
	public class Gavel : BaseSkillState
	{
		public static float damageCoefficient = 7f;

		public static float procCoefficient = 1f;

		public static float duration = 0.7f;

		public Vector3 rayPosition;

		private bool hasFired;

		private float stopwatch;

		protected BlastAttack blastAttack;

		protected BlastAttack blastAttackStrong;

		protected float attackStartTime = 0.01f;

		protected float attackEndTime = 1f;

		public override void OnEnter()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Expected O, but got Unknown
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: 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_026e: 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)
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			hasFired = false;
			rayPosition = ((Ray)(ref aimRay)).origin;
			if (((EntityState)this).isAuthority)
			{
				EffectManager.SpawnEffect(Assets.gavelEffect, new EffectData
				{
					origin = new Vector3(((EntityState)this).transform.position.x, ((EntityState)this).transform.position.y + 10f, ((EntityState)this).transform.position.z),
					scale = 1f
				}, true);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 1f);
			}
			if (Config.loweredVolume.Value)
			{
				Util.PlaySound("SpecialSoundQuiet", ((EntityState)this).gameObject);
			}
			else
			{
				Util.PlaySound("SpecialSound", ((EntityState)this).gameObject);
			}
			blastAttack = new BlastAttack();
			blastAttack.radius = 25f;
			blastAttack.procCoefficient = procCoefficient;
			blastAttack.position = rayPosition;
			blastAttack.attacker = ((EntityState)this).gameObject;
			blastAttack.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			blastAttack.baseDamage = ((BaseState)this).damageStat * damageCoefficient;
			blastAttack.falloffModel = (FalloffModel)0;
			blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
			blastAttack.damageType = (DamageType)32;
			blastAttack.attackerFiltering = (AttackerFiltering)0;
			blastAttackStrong = new BlastAttack();
			blastAttackStrong.radius = 50f;
			blastAttackStrong.procCoefficient = procCoefficient;
			blastAttackStrong.position = rayPosition;
			blastAttackStrong.attacker = ((EntityState)this).gameObject;
			blastAttackStrong.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			blastAttackStrong.baseDamage = ((BaseState)this).damageStat * (damageCoefficient * 2f);
			blastAttackStrong.falloffModel = (FalloffModel)0;
			blastAttackStrong.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
			blastAttackStrong.damageType = (DamageType)16416;
			blastAttackStrong.attackerFiltering = (AttackerFiltering)0;
		}

		public override void FixedUpdate()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			Ray aimRay = ((BaseState)this).GetAimRay();
			rayPosition = ((Ray)(ref aimRay)).origin;
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * 0.4f)
			{
				FireAttack();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		public void FireAttack()
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			if (hasFired)
			{
				return;
			}
			hasFired = true;
			if (PhoenixController.GetEvidenceType())
			{
				if (((EntityState)this).isAuthority)
				{
					PhoenixController.SetEvidenceType(input: false);
					blastAttackStrong.Fire();
					ShufflePrimary();
				}
			}
			else if (((EntityState)this).isAuthority)
			{
				blastAttack.Fire();
			}
			if (((EntityState)this).isAuthority)
			{
				EffectManager.SpawnEffect(Assets.dustEffect, new EffectData
				{
					origin = new Vector3(((EntityState)this).transform.position.x, ((EntityState)this).transform.position.y, ((EntityState)this).transform.position.z),
					scale = 1f
				}, true);
			}
			((EntityState)this).PlayAnimation("FullBody, Override", "Getup", "ShootGun.playbackRate", duration);
			Wave val = default(Wave);
			val.amplitude = 2f;
			val.frequency = 180f;
			val.cycleOffset = 0f;
			Wave val2 = val;
			ShakeEmitter.CreateSimpleShakeEmitter(rayPosition, val2, 0.5f, 20f, true);
		}

		private void ShufflePrimary()
		{
			switch (Random.Range(0, 3))
			{
			case 0:
				UnsetAll();
				PhoenixController.SetEvidenceType(input: false);
				break;
			case 1:
				UnsetAll();
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryBottle, (SkillOverridePriority)4);
				PhoenixController.SetEvidenceType(input: false);
				break;
			case 2:
				UnsetAll();
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryServbot, (SkillOverridePriority)4);
				PhoenixController.SetEvidenceType(input: false);
				break;
			}
		}

		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)6;
		}

		private void UnsetAll()
		{
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryBottle, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryKnife, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryPhone, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryServbot, (SkillOverridePriority)4);
		}
	}
	public class GavelStrong : BaseSkillState
	{
		public static float damageCoefficient = 7f;

		public static float procCoefficient = 2f;

		public static float duration = 0.7f;

		public Vector3 rayPosition;

		private bool hasFired;

		private float stopwatch;

		private Animator animator;

		protected BlastAttack blastAttackStrong;

		protected float attackStartTime = 0.01f;

		protected float attackEndTime = 1f;

		public override void OnEnter()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			hasFired = false;
			rayPosition = ((Ray)(ref aimRay)).origin;
			if (((EntityState)this).isAuthority)
			{
				EffectManager.SpawnEffect(Assets.gavelEffect, new EffectData
				{
					origin = new Vector3(((EntityState)this).transform.position.x, ((EntityState)this).transform.position.y + 10f, ((EntityState)this).transform.position.z),
					scale = 1f
				}, true);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 1f);
			}
			if (Config.loweredVolume.Value)
			{
				Util.PlaySound("SpecialSoundQuiet", ((EntityState)this).gameObject);
			}
			else
			{
				Util.PlaySound("SpecialSound", ((EntityState)this).gameObject);
			}
			blastAttackStrong = new BlastAttack();
			blastAttackStrong.radius = 40f;
			blastAttackStrong.procCoefficient = procCoefficient;
			blastAttackStrong.position = rayPosition;
			blastAttackStrong.attacker = ((EntityState)this).gameObject;
			blastAttackStrong.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			blastAttackStrong.baseDamage = ((BaseState)this).damageStat * (damageCoefficient * 2f);
			blastAttackStrong.falloffModel = (FalloffModel)0;
			blastAttackStrong.teamIndex = TeamComponent.GetObjectTeam(blastAttackStrong.attacker);
			blastAttackStrong.damageType = (DamageType)16416;
			blastAttackStrong.attackerFiltering = (AttackerFiltering)0;
		}

		public override void FixedUpdate()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			Ray aimRay = ((BaseState)this).GetAimRay();
			rayPosition = ((Ray)(ref aimRay)).origin;
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * 0.4f && ((EntityState)this).isAuthority)
			{
				FireAttack();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		private void FireAttack()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_00de: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Expected O, but got Unknown
			if (!hasFired)
			{
				hasFired = true;
				if (((EntityState)this).isAuthority)
				{
					blastAttackStrong.Fire();
				}
				if (((EntityState)this).isAuthority)
				{
					EffectManager.SpawnEffect(Assets.dustEffect, new EffectData
					{
						origin = new Vector3(((EntityState)this).transform.position.x, ((EntityState)this).transform.position.y, ((EntityState)this).transform.position.z),
						scale = 1f
					}, true);
				}
				((EntityState)this).PlayAnimation("FullBody, Override", "Getup", "ShootGun.playbackRate", duration);
				Wave val = default(Wave);
				val.amplitude = 2f;
				val.frequency = 180f;
				val.cycleOffset = 0f;
				Wave val2 = val;
				ShakeEmitter.CreateSimpleShakeEmitter(rayPosition, val2, 0.5f, 20f, true);
			}
		}

		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)6;
		}
	}
	public class Press : BaseSkillState
	{
		public static float damageCoefficient = 4f;

		public static float procCoefficient = 1f;

		public static float duration = 0.025f;

		public Vector3 rayPosition;

		public static bool hasDamaged;

		private bool hasFired;

		protected BlastAttack blastAttack;

		protected float attackStartTime = 0.01f * duration;

		protected float attackEndTime = 1f * duration;

		public override void OnEnter()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: 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_00c8: 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_00cf: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: 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_00fd: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Ray)(ref aimRay)).origin + 1f * ((Ray)(ref aimRay)).direction, ((Ray)(ref aimRay)).direction);
			hasFired = false;
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(val, ref val2, 20f))
			{
				rayPosition = ((RaycastHit)(ref val2)).point;
			}
			else
			{
				rayPosition = ((Ray)(ref aimRay)).origin + 20f * ((Ray)(ref aimRay)).direction;
			}
			((BaseState)this).StartAimMode(duration, true);
			((EntityState)this).PlayAnimation("FullBody, Override", "Point", "ShootGun.playbackRate", duration / duration);
			if (((EntityState)this).isAuthority)
			{
				EffectManager.SpawnEffect(Assets.pressEffect, new EffectData
				{
					origin = rayPosition,
					scale = 1f,
					rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction)
				}, true);
			}
			blastAttack = new BlastAttack();
			blastAttack.radius = 10f;
			blastAttack.procCoefficient = procCoefficient;
			blastAttack.position = rayPosition;
			blastAttack.attacker = ((EntityState)this).gameObject;
			blastAttack.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			blastAttack.baseDamage = ((BaseState)this).damageStat * damageCoefficient;
			blastAttack.falloffModel = (FalloffModel)0;
			blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
			blastAttack.damageType = (DamageType)32;
			blastAttack.attackerFiltering = (AttackerFiltering)0;
		}

		public override void FixedUpdate()
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= attackStartTime && ((EntityState)this).fixedAge < attackEndTime && !hasFired)
			{
				hasFired = true;
				if (Config.loweredVolume.Value)
				{
					Util.PlaySound("HoldItQuiet", ((EntityState)this).gameObject);
				}
				else
				{
					Util.PlaySound("HoldIt", ((EntityState)this).gameObject);
				}
				if (((EntityState)this).isAuthority && blastAttack.Fire().hitCount > 0)
				{
					OnHitEnemyAuthority();
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		protected virtual void OnHitEnemyAuthority()
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			if (PhoenixController.GetEvidenceType())
			{
				((EntityState)this).characterBody.AddBuff(Buffs.turnaboutBuff);
				if (Config.loweredVolume.Value)
				{
					Util.PlaySound("GainStackQuiet", ((EntityState)this).gameObject);
				}
				else
				{
					Util.PlaySound("GainStack", ((EntityState)this).gameObject);
				}
				if (!Config.gainTurnaboutOnHit.Value)
				{
					PhoenixPlugin.currentStacks += blastAttack.Fire().hitCount;
				}
				else
				{
					PhoenixPlugin.currentStacks++;
				}
				ShufflePrimary();
				if (PhoenixPlugin.currentStacks >= PhoenixController.maxStacks && PhoenixPlugin.turnaboutActive)
				{
					AkSoundEngine.SetRTPCValue("TurnaboutMusic", Config.TurnaboutMusic.Value);
					AkSoundEngine.PostEvent(559438376u, ((EntityState)this).gameObject);
					PhoenixPlugin.turnaboutActive = false;
				}
			}
		}

		private void ShufflePrimary()
		{
			switch (Random.Range(0, 3))
			{
			case 0:
				UnsetAll();
				PhoenixController.SetEvidenceType(input: false);
				break;
			case 1:
				UnsetAll();
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryBottle, (SkillOverridePriority)4);
				PhoenixController.SetEvidenceType(input: false);
				break;
			case 2:
				UnsetAll();
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryServbot, (SkillOverridePriority)4);
				PhoenixController.SetEvidenceType(input: false);
				break;
			}
		}

		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;
		}

		private void UnsetAll()
		{
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryBottle, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryKnife, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryPhone, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, Phoenix.primaryServbot, (SkillOverridePriority)4);
		}
	}
	public class PressTurnabout : BaseSkillState
	{
		public static float damageCoefficient = 6f;

		public static float procCoefficient = 2f;

		public static float duration = 1f;

		public Vector3 rayPosition;

		private bool hasFired;

		private float stopwatch;

		private Animator animator;

		private int random;

		protected string hitboxName = "press";

		protected BlastAttack blastAttack;

		protected float attackStartTime = 0.01f * duration;

		protected float attackEndTime = 1f * duration;

		public override void OnEnter()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: 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_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Expected O, but got Unknown
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Ray)(ref aimRay)).origin + 1f * ((Ray)(ref aimRay)).direction, ((Ray)(ref aimRay)).direction);
			hasFired = false;
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(val, ref val2, 20f))
			{
				rayPosition = ((RaycastHit)(ref val2)).point;
			}
			else
			{
				rayPosition = ((Ray)(ref aimRay)).origin + 20f * ((Ray)(ref aimRay)).direction;
			}
			((BaseState)this).StartAimMode(duration, true);
			((EntityState)this).PlayAnimation("FullBody, Override", "Point", "ShootGun.playbackRate", duration / duration);
			random = Random.Range(0, 2);
			if (random == 0)
			{
				if (((EntityState)this).isAuthority)
				{
					EffectManager.SpawnEffect(Assets.pressobjectEffect, new EffectData
					{
						origin = rayPosition,
						scale = 1f,
						rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction)
					}, true);
					if (Config.loweredVolume.Value)
					{
						Util.PlaySound("ObjectionQuiet", ((EntityState)this).gameObject);
					}
					else
					{
						Util.PlaySound("Objection", ((EntityState)this).gameObject);
					}
				}
			}
			else if (((EntityState)this).isAuthority)
			{
				EffectManager.SpawnEffect(Assets.presstTakeEffect, new EffectData
				{
					origin = rayPosition,
					scale = 1f,
					rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction)
				}, true);
				if (Config.loweredVolume.Value)
				{
					Util.PlaySound("TakeThatQuiet", ((EntityState)this).gameObject);
				}
				else
				{
					Util.PlaySound("TakeThat", ((EntityState)this).gameObject);
				}
			}
			blastAttack = new BlastAttack();
			blastAttack.radius = 10f;
			blastAttack.procCoefficient = procCoefficient;
			blastAttack.position = rayPosition;
			blastAttack.attacker = ((EntityState)this).gameObject;
			blastAttack.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			blastAttack.baseDamage = ((BaseState)this).damageStat * damageCoefficient;
			blastAttack.falloffModel = (FalloffModel)0;
			blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
			blastAttack.damageType = (DamageType)290;
			blastAttack.attackerFiltering = (AttackerFiltering)0;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= attackStartTime && stopwatch <= attackEndTime)
			{
				FireAttack();
			}
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		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;
		}

		private void FireAttack()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired && ((EntityState)this).isAuthority)
			{
				hasFired = true;
				blastAttack.Fire();
			}
		}
	}
	public class Primary : BaseSkillState
	{
		public static float baseDuration = 0.75f;

		public static float throwForce = 80f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private int currentItem;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.4f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime && !hasFired)
			{
				Fire();
				currentItem = Random.Range(0, 5);
				switch (currentItem)
				{
				case 0:
					Phoenix.primaryThrow.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texPhoneIcon");
					PhoenixController.SetEvidenceType(input: true);
					PlayEvidenceSound();
					break;
				case 1:
					Phoenix.primaryThrow.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texKnifeIcon");
					PhoenixController.SetEvidenceType(input: true);
					PlayEvidenceSound();
					break;
				case 2:
					Phoenix.primaryThrow.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texBottleIcon");
					PhoenixController.SetEvidenceType(input: false);
					break;
				case 3:
					Phoenix.primaryThrow.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texVaseIcon");
					PhoenixController.SetEvidenceType(input: false);
					break;
				case 4:
					Phoenix.primaryThrow.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texServbotIcon");
					PhoenixController.SetEvidenceType(input: false);
					break;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void Fire()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			if (hasFired)
			{
				return;
			}
			hasFired = true;
			if (Config.loweredVolume.Value)
			{
				Util.PlaySound("ThrowVaseQuiet", ((EntityState)this).gameObject);
			}
			else
			{
				Util.PlaySound("ThrowVase", ((EntityState)this).gameObject);
			}
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				((EntityState)this).PlayAnimation("RightArm, Override", "Throw", "ThrowBomb.playbackRate", duration);
				switch (currentItem)
				{
				case 0:
					ProjectileManager.instance.FireProjectile(Projectiles.vasePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 2f * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
					break;
				case 1:
					ProjectileManager.instance.FireProjectile(Projectiles.servbotPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 2f * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
					break;
				case 2:
					ProjectileManager.instance.FireProjectile(Projectiles.bottlePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 2f * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
					break;
				case 3:
					ProjectileManager.instance.FireProjectile(Projectiles.phonePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 4f * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
					break;
				case 4:
					ProjectileManager.instance.FireProjectile(Projectiles.knifePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 4f * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
					break;
				}
			}
		}

		public void PlayEvidenceSound()
		{
			if (Config.loweredVolume.Value)
			{
				Util.PlaySound("EvidenceSoundQuiet", ((EntityState)this).gameObject);
			}
			else
			{
				Util.PlaySound("EvidenceSound", ((EntityState)this).gameObject);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		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)2;
		}
	}
	public class SpawnArm : BaseSkillState
	{
		public static float damageCoefficient = 4f;

		public static float procCoefficient = 2f;

		public static float baseDuration = 1f;

		public static float throwForce = 130f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.4f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			((EntityState)this).PlayAnimation("FullBody, Override", "Point", "ThrowBomb.playbackRate", duration);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		private void Fire()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					ProjectileManager.instance.FireProjectile(Projectiles.armPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime && !hasFired)
			{
				Fire();
				if (Config.loweredVolume.Value)
				{
					Util.PlaySound("ArmSoundQuiet", ((EntityState)this).gameObject);
				}
				else
				{
					Util.PlaySound("ArmSound", ((EntityState)this).gameObject);
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		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)2;
		}
	}
}
namespace PhoenixWright.SkillStates.BaseStates
{
	internal class Death : GenericCharacterDeath
	{
		public override void FixedUpdate()
		{
			((GenericCharacterDeath)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)6;
		}

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Util.PlaySound("PhoenixDying", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("FullBody, Override", "Dying", "Roll.playbackRate", 1000f);
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).OnExit();
		}
	}
}
namespace PhoenixWright.Modules
{
	internal static class Assets
	{
		internal static AssetBundle mainAssetBundle;

		internal static GameObject pressEffect;

		internal static GameObject pressobjectEffect;

		internal static GameObject presstTakeEffect;

		internal static GameObject gavelEffect;

		internal static GameObject paperEffect;

		internal static GameObject paperStrongEffect;

		internal static GameObject dustEffect;

		internal static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();

		internal static List<EffectDef> effectDefs = new List<EffectDef>();

		internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard");

		internal static Material commandoMat;

		private static string[] assetNames = new string[0];

		private const string assetbundleName = "phoenixassets";

		internal static void Initialize()
		{
			LoadAssetBundle();
			LoadSoundbank();
			PopulateAssets();
		}

		internal static void LoadAssetBundle()
		{
			if ((Object)(object)mainAssetBundle == (Object)null)
			{
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PhoenixWright.phoenixassets");
				mainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
			assetNames = mainAssetBundle.GetAllAssetNames();
		}

		internal static void LoadSoundbank()
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PhoenixWright.PhoenixBank.bnk");
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			SoundBanks.Add(array);
		}

		internal static void PopulateAssets()
		{
			if (!Object.op_Implicit((Object)(object)mainAssetBundle))
			{
				Debug.LogError((object)"There is no AssetBundle to load assets from.");
				return;
			}
			pressEffect = LoadEffect("SecondaryEffect");
			gavelEffect = LoadEffect("SpecialEffect");
			pressobjectEffect = LoadEffect("SecondaryObjectEffect");
			presstTakeEffect = LoadEffect("SecondaryTakeEffect");
			paperEffect = LoadEffect("PaperParticle");
			paperStrongEffect = LoadEffect("PaperParticleStrong");
			dustEffect = LoadEffect("DustEffect");
		}

		private static GameObject CreateTracer(string originalTracerName, string newTracerName)
		{
			if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null)
			{
				return null;
			}
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true, "D:\\_Projects\\PhoenixMod_Nerfed\\PhoenixMod\\Modules\\Assets.cs", "CreateTracer", 90);
			if (!Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>()))
			{
				val.AddComponent<EffectComponent>();
			}
			if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>()))
			{
				val.AddComponent<VFXAttributes>();
			}
			if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>()))
			{
				val.AddComponent<NetworkIdentity>();
			}
			val.GetComponent<Tracer>().speed = 250f;
			val.GetComponent<Tracer>().length = 50f;
			AddNewEffectDef(val);
			return val;
		}

		internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName)
		{
			NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			val.akId = AkSoundEngine.GetIDFromString(eventName);
			val.eventName = eventName;
			networkSoundEventDefs.Add(val);
			return val;
		}

		internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert)
		{
			if (!Object.op_Implicit((Object)(object)objectToConvert))
			{
				return;
			}
			MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).material))
				{
					((Renderer)val).material.shader = hotpoo;
				}
			}
			SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val2 in componentsInChildren2)
			{
				if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material))
				{
					((Renderer)val2).material.shader = hotpoo;
				}
			}
		}

		internal static RendererInfo[] SetupRendererInfos(GameObject obj)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length];
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				array[i] = new RendererInfo
				{
					defaultMaterial = ((Renderer)componentsInChildren[i]).material,
					renderer = (Renderer)(object)componentsInChildren[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		internal static Texture LoadCharacterIcon(string characterName)
		{
			return mainAssetBundle.LoadAsset<Texture>("tex" + characterName + "Icon");
		}

		internal static GameObject LoadCrosshair(string crosshairName)
		{
			if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair") == (Object)null)
			{
				return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair");
			}
			return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair");
		}

		private static GameObject LoadEffect(string resourceName)
		{
			return LoadEffect(resourceName, "", parentToTransform: false);
		}

		private static GameObject LoadEffect(string resourceName, string soundName)
		{
			return LoadEffect(resourceName, soundName, parentToTransform: false);
		}

		private static GameObject LoadEffect(string resourceName, bool parentToTransform)
		{
			return LoadEffect(resourceName, "", parentToTransform);
		}

		private static GameObject LoadEffect(string resourceName, string soundName, bool parentToTransform)
		{
			//IL_0091: 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)
			bool flag = false;
			for (int i = 0; i < assetNames.Length; i++)
			{
				if (assetNames[i].Contains(resourceName.ToLower()))
				{
					flag = true;
					i = assetNames.Length;
				}
			}
			if (!flag)
			{
				Debug.LogError((object)("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle"));
				return null;
			}
			GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName);
			val.AddComponent<DestroyOnTimer>().duration = 12f;
			val.AddComponent<NetworkIdentity>();
			val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			EffectComponent val2 = val.AddComponent<EffectComponent>();
			val2.applyScale = false;
			val2.effectIndex = (EffectIndex)(-1);
			val2.parentToReferencedTransform = parentToTransform;
			val2.positionAtReferencedTransform = true;
			val2.soundName = soundName;
			AddNewEffectDef(val, soundName);
			return val;
		}

		private static void AddNewEffectDef(GameObject effectPrefab)
		{
			AddNewEffectDef(effectPrefab, "");
		}

		private static void AddNewEffectDef(GameObject effectPrefab, string soundName)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			EffectDef val = new EffectDef();
			val.prefab = effectPrefab;
			val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>();
			val.prefabName = ((Object)effectPrefab).name;
			val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>();
			val.spawnSoundEventName = soundName;
			effectDefs.Add(val);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength)
		{
			//IL_008e: 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)
			if (!Object.op_Implicit((Object)(object)commandoMat))
			{
				commandoMat = LegacyResourcesAPI.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))
			{
				Debug.LogError((object)("Failed to load material: " + materialName + " - Check to see that the name in your Unity project matches the one in this code"));
				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"));
			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.white);
		}

		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);
		}
	}
	public static class Buffs
	{
		internal static BuffDef armorBuff;

		internal static BuffDef turnaboutBuff;

		internal static List<BuffDef> buffDefs = new List<BuffDef>();

		internal static void RegisterBuffs()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			armorBuff = AddNewBuff("Armor Buff", Assets.mainAssetBundle.LoadAsset<Sprite>("texArmourBuff"), Color.white, canStack: false, isDebuff: false);
			turnaboutBuff = AddNewBuff("Turnabout", Assets.mainAssetBundle.LoadAsset<Sprite>("texBuffIconNoBackground"), Color.white, canStack: true, isDebuff: false);
		}

		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff)
		{
			//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;
			buffDefs.Add(val);
			return val;
		}
	}
	public static class Config
	{
		public static ConfigEntry<bool> loweredVolume;

		public static ConfigEntry<bool> gainTurnaboutOnHit;

		public static ConfigEntry<int> necessaryStacksTurnabout;

		public static ConfigEntry<float> TurnaboutMusic;

		public static void ReadConfig()
		{
			//IL_0015: 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_0034: Expected O, but got Unknown
			//IL_0034: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_0078: Expected O, but got Unknown
			//IL_0091: 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)
			//IL_00ac: Expected O, but got Unknown
			//IL_00ac: Expected O, but got Unknown
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00e1: Expected O, but got Unknown
			TurnaboutMusic = ((BaseUnityPlugin)PhoenixPlugin.instance).Config.Bind<float>(new ConfigDefinition("Turnabout Music", ""), 75f, new ConfigDescription("Set Turnabout Mode Theme Volume", (AcceptableValueBase)null, Array.Empty<object>()));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(TurnaboutMusic));
			loweredVolume = ((BaseUnityPlugin)PhoenixPlugin.instance).Config.Bind<bool>(new ConfigDefinition("Sound settings", "SFX"), false, new ConfigDescription("Set to true to lower SFX", (AcceptableValueBase)null, Array.Empty<object>()));
			gainTurnaboutOnHit = ((BaseUnityPlugin)PhoenixPlugin.instance).Config.Bind<bool>(new ConfigDefinition("Turnabout stacks", "Limit turnabout stacks"), false, new ConfigDescription("Set to true to gain max of one turnabout per hit", (AcceptableValueBase)null, Array.Empty<object>()));
			necessaryStacksTurnabout = ((BaseUnityPlugin)PhoenixPlugin.instance).Config.Bind<int>(new ConfigDefinition("Turnabout stacks", "Necessary Stacks for Turnabout Mode"), 50, new ConfigDescription("Set to 0 to start game with turnabout mode active", (AcceptableValueBase)null, Array.Empty<object>()));
		}

		internal static ConfigEntry<bool> CharacterEnableConfig(string characterName)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_002c: Expected O, but got Unknown
			return ((BaseUnityPlugin)PhoenixPlugin.instance).Config.Bind<bool>(new ConfigDefinition(characterName, "Enabled"), true, new ConfigDescription("Set to false to disable this character", (AcceptableValueBase)null, Array.Empty<object>()));
		}

		internal static ConfigEntry<bool> EnemyEnableConfig(string characterName)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_002c: Expected O, but got Unknown
			return ((BaseUnityPlugin)PhoenixPlugin.instance).Config.Bind<bool>(new ConfigDefinition(characterName, "Enabled"), true, new ConfigDescription("Set to false to disable this enemy", (AcceptableValueBase)null, Array.Empty<object>()));
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public string identifier => "com.Zhank.PWNerf";

		public void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)this);
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.bodyPrefabs.Add(Prefabs.bodyPrefabs.ToArray());
			contentPack.buffDefs.Add(Buffs.buffDefs.ToArray());
			contentPack.effectDefs.Add(Assets.effectDefs.ToArray());
			contentPack.entityStateTypes.Add(States.entityStates.ToArray());
			contentPack.masterPrefabs.Add(Prefabs.masterPrefabs.ToArray());
			contentPack.networkSoundEventDefs.Add(Assets.networkSoundEventDefs.ToArray());
			contentPack.projectilePrefabs.Add(Prefabs.projectilePrefabs.ToArray());
			contentPack.skillDefs.Add(Skills.skillDefs.ToArray());
			contentPack.skillFamilies.Add(Skills.skillFamilies.ToArray());
			contentPack.survivorDefs.Add(Prefabs.survivorDefinitions.ToArray());
			contentPack.unlockableDefs.Add(Unlockables.unlockableDefs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
	internal static class Helpers
	{
		internal const string agilePrefix = "<style=cIsUtility>Agile.</style> ";

		internal const string stunningPrefix = "<style=cIsDamage>Stunning.</style> ";

		internal const string freezingPrefix = "<style=cIsDamage>Freezing.</style> ";

		internal const string weakenPrefix = "<style=cIsDamage>Weaken.</style> ";

		internal const string turnaboutPrefix = "<style=cIsUtility>turnabout.</style> ";

		internal const string decisivePrefix = "<style=cIsUtility>decisive evidence</style> ";

		internal static string ScepterDescription(string desc)
		{
			return "\n<color=#d299ff>SCEPTER: " + desc + "</color>";
		}

		public static T[] Append<T>(ref T[] array, List<T> list)
		{
			int num = array.Length;
			int count = list.Count;
			Array.Resize(ref array, num + count);
			list.CopyTo(array, num);
			return array;
		}

		public static Func<T[], T[]> AppendDel<T>(List<T> list)
		{
			return (T[] r) => Append(ref r, list);
		}
	}
	internal static class ArrayHelper
	{
		public static T[] Append<T>(ref T[] array, List<T> list)
		{
			int num = array.Length;
			int count = list.Count;
			Array.Resize(ref array, num + count);
			list.CopyTo(array, num);
			return array;
		}

		public static Func<T[], T[]> AppendDel<T>(List<T> list)
		{
			return (T[] r) => Append(ref r, list);
		}
	}
	internal static class ItemDisplays
	{
		private static Dictionary<string, GameObject> itemDisplayPrefabs = new Dictionary<string, GameObject>();

		internal static void PopulateDisplays()
		{
			PopulateFromBody("Commando");
			PopulateFromBody("Croco");
			PopulateFromBody("Mage");
		}

		private static void PopulateFromBody(string bodyName)
		{
			ItemDisplayRuleSet itemDisplayRuleSet = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyName + "Body").GetComponent<ModelLocator>().modelTransform).GetComponent<CharacterModel>().itemDisplayRuleSet;
			KeyAssetRuleGroup[] keyAssetRuleGroups = itemDisplayRuleSet.keyAssetRuleGroups;
			for (int i = 0; i < keyAssetRuleGroups.Length; i++)
			{
				ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules;
				for (int j = 0; j < rules.Length; j++)
				{
					GameObject followerPrefab = rules[j].followerPrefab;
					if (Object.op_Implicit((Object)(object)followerPrefab))
					{
						string key = ((Object)followerPrefab).name?.ToLower();
						if (!itemDisplayPrefabs.ContainsKey(key))
						{
							itemDisplayPrefabs[key] = followerPrefab;
						}
					}
				}
			}
		}

		internal static GameObject LoadDisplay(string name)
		{
			if (itemDisplayPrefabs.ContainsKey(name.ToLower()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLower()]))
			{
				return itemDisplayPrefabs[name.ToLower()];
			}
			return null;
		}
	}
	internal static class Prefabs
	{
		private static PhysicMaterial ragdollMaterial;

		internal static List<SurvivorDef> survivorDefinitions = new List<SurvivorDef>();

		internal static List<GameObject> bodyPrefabs = new List<GameObject>();

		internal static List<GameObject> masterPrefabs = new List<GameObject>();

		internal static List<GameObject> projectilePrefabs = new List<GameObject>();

		internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix, UnlockableDef unlockableDef, float sortPosition)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			string displayNameToken = "BOK_" + namePrefix + "_BODY_NAME";
			string descriptionToken = "BOK_" + namePrefix + "_BODY_DESCRIPTION";
			string outroFlavorToken = "BOK_" + namePrefix + "_BODY_OUTRO_FLAVOR";
			string mainEndingEscapeFailureFlavorToken = "BOK_" + namePrefix + "_BODY_OUTRO_FAILURE";
			SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
			val.bodyPrefab = bodyPrefab;
			val.displayPrefab = displayPrefab;
			val.primaryColor = charColor;
			val.displayNameToken = displayNameToken;
			val.descriptionToken = descriptionToken;
			val.outroFlavorToken = outroFlavorToken;
			val.mainEndingEscapeFailureFlavorToken = mainEndingEscapeFailureFlavorToken;
			val.desiredSortPosition = sortPosition;
			val.unlockableDef = unlockableDef;
			survivorDefinitions.Add(val);
		}

		internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, namePrefix, null, 100f);
		}

		internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix, float sortPosition)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, namePrefix, null, sortPosition);
		}

		internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix, UnlockableDef unlockableDef)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, namePrefix, unlockableDef, 100f);
		}

		internal static GameObject CreateDisplayPrefab(string modelName, GameObject prefab, BodyInfo bodyInfo)
		{
			if (!Object.op_Implicit((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body")))
			{
				Debug.LogError((object)(bodyInfo.bodyNameToClone + "Body is not a valid body, character creation failed"));
				return null;
			}
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"), modelName + "Prefab", true, "D:\\_Projects\\PhoenixMod_Nerfed\\PhoenixMod\\Modules\\Prefabs.cs", "CreateDisplayPrefab", 59);
			GameObject val2 = CreateModel(val, modelName);
			Transform val3 = SetupModel(val, val2.transform, bodyInfo);
			val2.AddComponent<CharacterModel>().baseRendererInfos = prefab.GetComponentInChildren<CharacterModel>().baseRendererInfos;
			Assets.ConvertAllRenderersToHopooShader(val2);
			return val2.gameObject;
		}

		internal static GameObject CreatePrefab(string bodyName, string modelName, BodyInfo bodyInfo)
		{
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body")))
			{
				Debug.LogError((object)(bodyInfo.bodyNameToClone + "Body is not a valid body, character creation failed"));
				return null;
			}
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"), bodyName, true, "D:\\_Projects\\PhoenixMod_Nerfed\\PhoenixMod\\Modules\\Prefabs.cs", "CreatePrefab", 79);
			Transform val2 = null;
			GameObject val3 = null;
			if (modelName != "mdl")
			{
				val3 = CreateModel(val, modelName);
				if ((Object)(object)val3 == (Object)null)
				{
					val3 = ((Component)val.GetComponentInChildren<CharacterModel>()).gameObject;
				}
				val2 = SetupModel(val, val3.transform, bodyInfo);
			}
			CharacterBody component = val.GetComponent<CharacterBody>();
			((Object)component).name = bodyInfo.bodyName;
			component.baseNameToken = bodyInfo.bodyNameToken;
			component.subtitleNameToken = bodyInfo.subtitleNameToken;
			component.portraitIcon = bodyInfo.characterPortrait;
			component._defaultCrosshairPrefab = bodyInfo.crosshair;
			component.bodyFlags = (BodyFlags)16;
			component.rootMotionInMainState = false;
			component.baseMaxHealth = bodyInfo.maxHealth;
			component.levelMaxHealth = bodyInfo.healthGrowth;
			component.baseRegen = bodyInfo.healthRegen;
			component.levelRegen = component.baseRegen * 0.2f;
			component.baseMaxShield = bodyInfo.shield;
			component.levelMaxShield = bodyInfo.shieldGrowth;
			component.baseMoveSpeed = bodyInfo.moveSpeed;
			component.levelMoveSpeed = bodyInfo.moveSpeedGrowth;
			component.baseAcceleration = bodyInfo.acceleration;
			component.baseJumpPower = bodyInfo.jumpPower;
			component.levelJumpPower = bodyInfo.jumpPowerGrowth;
			component.baseDamage = bodyInfo.damage;
			component.levelDamage = component.baseDamage * 0.2f;
			component.baseAttackSpeed = bodyInfo.attackSpeed;
			component.levelAttackSpeed = bodyInfo.attackSpeedGrowth;
			component.baseArmor = bodyInfo.armor;
			component.levelArmor = bodyInfo.armorGrowth;
			component.baseCrit = bodyInfo.crit;
			component.levelCrit = bodyInfo.critGrowth;
			component.baseJumpCount = bodyInfo.jumpCount;
			component.sprintingSpeedMultiplier = 1.45f;
			component.hideCrosshair = false;
			component.aimOriginTransform = val2.Find("AimOrigin");
			component.hullClassification = (HullClassification)0;
			component.preferredPodPrefab = bodyInfo.podPrefab;
			component.isChampion = false;
			component.bodyColor = bodyInfo.bodyColor;
			if ((Object)(object)val2 != (Object)null)
			{
				SetupCharacterDirection(val, val2, val3.transform);
			}
			SetupCameraTargetParams(val);
			if ((Object)(object)val2 != (Object)null)
			{
				SetupModelLocator(val, val2, val3.transform);
			}
			SetupRigidbody(val);
			SetupCapsuleCollider(val);
			SetupMainHurtbox(val, val3);
			SetupFootstepController(val3);
			SetupRagdoll(val3);
			SetupAimAnimator(val, val3);
			CharacterDeathBehavior component2 = val.GetComponent<CharacterDeathBehavior>();
			component2.deathState = new SerializableEntityStateType(typeof(Death));
			bodyPrefabs.Add(val);
			return val;
		}

		internal static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy)
		{
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true, "D:\\_Projects\\PhoenixMod_Nerfed\\PhoenixMod\\Modules\\Prefabs.cs", "CreateGenericDoppelganger", 166);
			val.GetComponent<CharacterMaster>().bodyPrefab = bodyPrefab;
			masterPrefabs.Add(val);
		}

		private static Transform SetupModel(GameObject prefab, Transform modelTransform, BodyInfo bodyInfo)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ModelBase");
			val.transform.parent = prefab.transform;
			val.transform.localPosition = bodyInfo.modelBasePosition;
			val.transform.localRotation = Quaternion.identity;
			val.transform.localScale = new Vector3(1f, 1f, 1f);
			GameObject val2 = new GameObject("CameraPivot");
			val2.transform.parent = val.transform;
			val2.transform.localPosition = bodyInfo.cameraPivotPosition;
			val2.transform.localRotation = Quaternion.identity;
			val2.transform.localScale = Vector3.one;
			GameObject val3 = new GameObject("AimOrigin");
			val3.transform.parent = val.transform;
			val3.transform.localPosition = bodyInfo.aimOriginPosition;
			val3.transform.localRotation = Quaternion.identity;
			val3.transform.localScale = Vector3.one;
			prefab.GetComponent<CharacterBody>().aimOriginTransform = val3.transform;
			modelTransform.parent = val.transform;
			modelTransform.localPosition = Vector3.zero;
			modelTransform.localRotation = Quaternion.identity;
			return val.transform;
		}

		private static GameObject CreateModel(GameObject main, string modelName)
		{
			Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("ModelBase")).gameObject);
			Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("CameraPivot")).gameObject);
			Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("AimOrigin")).gameObject);
			if ((Object)(object)Assets.mainAssetBundle.LoadAsset<GameObject>(modelName) == (Object)null)
			{
				Debug.LogError((object)"Trying to load a null model- check to see if the name in your code matches the name of the object in Unity");
				return null;
			}
			return Object.Instantiate<GameObject>(Assets.mainAssetBundle.LoadAsset<GameObject>(modelName));
		}

		internal static void SetupCharacterModel(GameObject prefab, CustomRendererInfo[] rendererInfo, int mainRendererIndex)
		{
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			CharacterModel val = ((Component)prefab.GetComponent<ModelLocator>().modelTransform).gameObject.AddComponent<CharacterModel>();
			ChildLocator component = ((Component)val).GetComponent<ChildLocator>();
			val.body = prefab.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				Debug.LogError((object)"Failed CharacterModel setup: ChildLocator component does not exist on the model");
				return;
			}
			List<RendererInfo> list = new List<RendererInfo>();
			for (int i = 0; i < rendererInfo.Length; i++)
			{
				if (!Object.op_Implicit((Object)(object)component.FindChild(rendererInfo[i].childName)))
				{
					Debug.LogError((object)("Trying to add a RendererInfo for a renderer that does not exist: " + rendererInfo[i].childName));
					continue;
				}
				Renderer component2 = ((Component)component.FindChild(rendererInfo[i].childName)).GetComponent<Renderer>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					list.Add(new RendererInfo
					{
						renderer = ((Component)component.FindChild(rendererInfo[i].childName)).GetComponent<Renderer>(),
						defaultMaterial = rendererInfo[i].material,
						ignoreOverlays = rendererInfo[i].ignoreOverlays,
						defaultShadowCastingMode = (ShadowCastingMode)1
					});
				}
			}
			val.baseRendererInfos = list.ToArray();
			val.autoPopulateLightInfos = true;
			val.invisibilityCount = 0;
			val.temporaryOverlays = new List<TemporaryOverlay>();
			if (mainRendererIndex > val.baseRendererInfos.Length)
			{
				Debug.LogError((object)("mainRendererIndex out of range: not setting mainSkinnedMeshRenderer for " + ((Object)prefab).name));
			}
			else
			{
				val.mainSkinnedMeshRenderer = ((Component)val.baseRendererInfos[mainRendererIndex].renderer).GetComponent<SkinnedMeshRenderer>();
			}
		}

		private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform)
		{
			CharacterDirection component = prefab.GetComponent<CharacterDirection>();
			component.targetTransform = modelBaseTransform;
			component.overrideAnimatorForwardTransform = null;
			component.rootMotionAccumulator = null;
			component.modelAnimator = ((Component)modelTransform).GetComponent<Animator>();
			component.driveFromRootRotation = false;
			component.turnSpeed = 720f;
		}

		private static void SetupCameraTargetParams(GameObject prefab)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			CameraTargetParams component = prefab.GetComponent<CameraTargetParams>();
			component.cameraParams = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/MercBody").GetComponent<CameraTargetParams>().cameraParams;
			component.cameraPivotTransform = prefab.transform.Find("ModelBase").Find("CameraPivot");
			component.RequestAimType((AimType)0);
			component.recoil = Vector2.zero;
			component.dontRaycastToPivot = false;
		}

		private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform)
		{
			ModelLocator component = prefab.GetComponent<ModelLocator>();
			component.modelTransform = modelTransform;
			component.modelBaseTransform = modelBaseTransform;
		}

		private static void SetupRigidbody(GameObject prefab)
		{
			Rigidbody component = prefab.GetComponent<Rigidbody>();
			component.mass = 100f;
		}

		private static void SetupCapsuleCollider(GameObject prefab)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			CapsuleCollider component = prefab.GetComponent<CapsuleCollider>();
			component.center = new Vector3(0f, 0f, 0f);
			component.radius = 0.5f;
			component.height = 1.82f;
			component.direction = 1;
		}

		private static void SetupMainHurtbox(GameObject prefab, GameObject model)
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			ChildLocator component = model.GetComponent<ChildLocator>();
			if (!Object.op_Implicit((Object)(object)component.FindChild("MainHurtbox")))
			{
				Debug.LogError((object)"Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator component called 'MainHurtbox'");
				return;
			}
			HurtBoxGroup val = model.AddComponent<HurtBoxGroup>();
			HurtBox val2 = ((Component)component.FindChild("MainHurtbox")).gameObject.AddComponent<HurtBox>();
			((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val2.healthComponent = prefab.GetComponent<HealthComponent>();
			val2.isBullseye = true;
			val2.damageModifier = (DamageModifier)0;
			val2.hurtBoxGroup = val;
			val2.indexInGroup = 0;
			val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val2 };
			val.mainHurtBox = val2;
			val.bullseyeCount = 1;
		}

		private static void SetupFootstepController(GameObject model)
		{
			FootstepHandler val = model.AddComponent<FootstepHandler>();
			val.baseFootstepString = "Play_player_footstep";
			val.sprintFootstepOverrideString = "";
			val.enableFootstepDust = true;
			val.footstepDustPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/GenericFootstepDust");
		}

		private static void SetupRagdoll(GameObject model)
		{
			RagdollController component = model.GetComponent<RagdollController>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			if ((Object)(object)ragdollMaterial == (Object)null)
			{
				ragdollMaterial = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<RagdollController>().bones[1]).GetComponent<Collider>().material;
			}
			Transform[] bones = component.bones;
			foreach (Transform val in bones)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal;
					Collider component2 = ((Component)val).GetComponent<Collider>();
					if (Object.op_Implicit((Object)(object)component2))
					{
						component2.material = ragdollMaterial;
						component2.sharedMaterial = ragdollMaterial;
					}
				}
			}
		}

		private static void SetupAimAnimator(GameObject prefab, GameObject model)
		{
			AimAnimator val = model.AddComponent<AimAnimator>();
			val.directionComponent = prefab.GetComponent<CharacterDirection>();
			val.pitchRangeMax = 60f;
			val.pitchRangeMin = -60f;
			val.yawRangeMin = -80f;
			val.yawRangeMax = 80f;
			val.pitchGiveupRange = 30f;
			val.yawGiveupRange = 10f;
			val.giveupDuration = 3f;
			val.inputBank = prefab.GetComponent<InputBankTest>();
		}

		internal static void SetupHitbox(GameObject prefab, Transform hitboxTransform, string hitboxName)
		{
			HitBoxGroup val = prefab.AddComponent<HitBoxGroup>();
			HitBox val2 = ((Component)hitboxTransform).gameObject.AddComponent<HitBox>();
			((Component)hitboxTransform).gameObject.layer = LayerIndex.projectile.intVal;
			val.hitBoxes = (HitBox[])(object)new HitBox[1] { val2 };
			val.groupName = hitboxName;
		}

		internal static void SetupHitbox(GameObject prefab, string hitboxName, params Transform[] hitboxTransforms)
		{
			HitBoxGroup val = prefab.AddComponent<HitBoxGroup>();
			List<HitBox> list = new List<HitBox>();
			foreach (Transform val2 in hitboxTransforms)
			{
				HitBox item = ((Component)val2).gameObject.AddComponent<HitBox>();
				((Component)val2).gameObject.layer = LayerIndex.projectile.intVal;
				list.Add(item);
			}
			val.hitBoxes = list.ToArray();
			val.groupName = hitboxName;
		}
	}
	internal static class Projectiles
	{
		internal static GameObject vasePrefab;

		internal static GameObject knifePrefab;

		internal static GameObject phonePrefab;

		internal static GameObject bottlePrefab;

		internal static GameObject servbotPrefab;

		internal static GameObject armPrefab;

		private static Vector3 scaleUp = new Vector3(2f, 2f, 2f);

		internal static void RegisterProjectiles()
		{
			Createvase();
			Createknife();
			Createphone();
			Createbottle();
			Createservbot();
			CreateArm();
			AddProjectile(vasePrefab);
			AddProjectile(knifePrefab);
			AddProjectile(phonePrefab);
			AddProjectile(servbotPrefab);
			AddProjectile(bottlePrefab);
			AddProjectile(armPrefab);
		}

		internal static void AddProjectile(GameObject projectileToAdd)
		{
			Prefabs.projectilePrefabs.Add(projectileToAdd);
		}

		private static void Createvase()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			vasePrefab = CloneProjectilePrefab("CommandoGrenadeProjectile", "VaseProjectile");
			vasePrefab.transform.localScale = scaleUp;
			ProjectileImpactExplosion component = vasePrefab.GetComponent<ProjectileImpactExplosion>();
			InitializeImpactExplosion(component);
			((ProjectileExplosion)component).blastRadius = 5f;
			component.destroyOnEnemy = true;
			component.lifetime = 12f;
			co