Decompiled source of OpmMod2 v1.0.0

OpmMod.dll

Decompiled 6 months 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 BepInEx.Logging;
using EntityStates;
using EntityStates.Commando;
using HG;
using HG.BlendableTypes;
using KinematicCharacterController;
using On.RoR2;
using OpmMod.Modules;
using OpmMod.Modules.Characters;
using OpmMod.Modules.Survivors;
using OpmMod.SkillStates;
using OpmMod.SkillStates.BaseStates;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.ContentManagement;
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("OpmMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("OpmMod")]
[assembly: AssemblyTitle("OpmMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace OpmMod
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.LRDPOOB.OpmMod", "OpmMod", "1.0.0")]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "UnlockableAPI" })]
	public class OpmPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.LRDPOOB.OpmMod";

		public const string MODNAME = "OpmMod";

		public const string MODVERSION = "1.0.0";

		public const string DEVELOPER_PREFIX = "LRDPOOB";

		public static OpmPlugin instance;

		private void Awake()
		{
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Assets.Initialize();
			Config.ReadConfig();
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			new MyCharacter().Initialize();
			new ContentPacks().Initialize();
		}
	}
}
namespace OpmMod.SkillStates
{
	public class Jump : BaseSkillState
	{
		public static float duration = 2f;

		private bool hasFired;

		public static float finalSpeedCoefficient = 2.5f;

		public static float initialSpeedCoefficient = 5f;

		private float baseMaxFlySpeed = 3f;

		private float baseTurnSpeed = 0.6f;

		private float turnSpeed;

		public static float dodgeFOV = DodgeState.dodgeFOV;

		private float jumpSpeed;

		private Vector3 forwardDirection;

		private Animator animator;

		private Vector3 previousPosition;

		private float maxFlySpeed;

		private float baseAccel = 0.1f;

		private float baseUpwardAccelFalling = 0.1f;

		private float baseUpwardsAccel = 0.08f;

		private float forwardAccel;

		private float upwardsAccel;

		private float upwardsAccelFalling;

		private Vector3 steerDirection;

		private Vector3 currVel;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			StartFlight();
		}

		private void StartFlight()
		{
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_0077: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			if (hasFired)
			{
				return;
			}
			hasFired = true;
			if (((EntityState)this).isAuthority)
			{
				if (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;
				}
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
				forwardAccel = baseAccel * ((BaseState)this).moveSpeedStat;
				upwardsAccel = baseUpwardsAccel * ((BaseState)this).moveSpeedStat;
				upwardsAccelFalling = baseUpwardAccelFalling * ((BaseState)this).moveSpeedStat;
				maxFlySpeed = baseMaxFlySpeed * ((BaseState)this).moveSpeedStat;
				currVel = ((EntityState)this).characterMotor.velocity;
				steerDirection = forwardDirection;
				float num = baseTurnSpeed * ((BaseState)this).moveSpeedStat;
				turnSpeed = ((num > 1f) ? 1f : num);
			}
		}

		private void RecalculateJumpSpeed()
		{
			jumpSpeed = ((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();
			RecalculateJumpSpeed();
			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 * jumpSpeed;
				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).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();
		}
	}
	public class Punch : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Punch";
			damageType = (DamageType)0;
			damageCoefficient = 2.8f;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0f;
			hitHopVelocity = 4f;
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			base.OnEnter();
		}

		protected override void PlayAttackAnimation()
		{
			base.PlayAttackAnimation();
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class SeriousPunch : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Punch";
			damageType = (DamageType)0;
			damageCoefficient = 2.8f;
			procCoefficient = 1f;
			pushForce = 450f;
			bonusForce = Vector3.zero;
			baseDuration = 3.33f;
			attackStartTime = 1.6f;
			attackEndTime = 3.33f;
			baseEarlyExitTime = 3.33f;
			hitStopDuration = 0.012f;
			attackRecoil = 0f;
			hitHopVelocity = 0f;
			base.OnEnter();
		}

		protected override void PlayAttackAnimation()
		{
			base.PlayAttackAnimation();
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class Stun : BaseMeleeAttack
	{
		public new static float damageCoefficient = 0f;

		public new static float procCoefficient = 1f;

		public new static float baseDuration = 0.6f;

		public static float force = 800f;

		public static float recoil = 0f;

		public static float range = 20f;

		private new float duration;

		public override void OnEnter()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Punch";
			damageType = (DamageType)32;
			pushForce = 0f;
			bonusForce = Vector3.zero;
			duration = 3f;
			attackStartTime = 0.5f;
			attackEndTime = 3f;
			baseEarlyExitTime = 1f;
			hitStopDuration = 0.012f;
			attackRecoil = 0f;
			hitHopVelocity = 0f;
			base.OnEnter();
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			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 OpmMod.SkillStates.BaseStates
{
	public class BaseMeleeAttack : BaseSkillState
	{
		public int swingIndex;

		protected string hitboxName = "Punch";

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 3.5f;

		protected float procCoefficient = 1f;

		protected float pushForce = 300f;

		protected Vector3 bonusForce = Vector3.zero;

		protected float baseDuration = 1f;

		protected float attackStartTime = 0.2f;

		protected float attackEndTime = 0.4f;

		protected float baseEarlyExitTime = 0.4f;

		protected float hitStopDuration = 0.012f;

		protected float attackRecoil = 0.75f;

		protected float hitHopVelocity = 4f;

		protected bool cancelled = false;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		protected string muzzleString = "SwingCenter";

		protected GameObject swingEffectPrefab;

		protected GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		private float earlyExitTime;

		public float duration;

		private bool hasFired;

		private float hitPauseTimer;

		private OverlapAttack attack;

		protected bool inHitPause;

		private bool hasHopped;

		protected float stopwatch;

		protected Animator animator;

		private HitStopCachedState hitStopCachedState;

		private Vector3 storedVelocity;

		public override void OnEnter()
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			//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_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat;
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			animator.SetBool("attacking", true);
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			PlayAttackAnimation();
			attack = new OverlapAttack();
			attack.damageType = damageType;
			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.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		protected virtual void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f);
		}

		public override void OnExit()
		{
			if (!hasFired && !cancelled)
			{
				FireAttack();
			}
			((EntityState)this).OnExit();
			animator.SetBool("attacking", false);
		}

		protected virtual void PlaySwingEffect()
		{
			EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
		}

		protected virtual void OnHitEnemyAuthority()
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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)
			Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
			if (!hasHopped)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity);
				}
				hasHopped = true;
			}
			if (!inHitPause && hitStopDuration > 0f)
			{
				storedVelocity = ((EntityState)this).characterMotor.velocity;
				hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate");
				hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat;
				inHitPause = true;
			}
		}

		private void FireAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				OnHitEnemyAuthority();
			}
		}

		protected virtual void SetNextState()
		{
			int num = ((swingIndex == 0) ? 1 : 0);
			((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttack
			{
				swingIndex = num
			});
		}

		public override void FixedUpdate()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			hitPauseTimer -= Time.fixedDeltaTime;
			if (hitPauseTimer <= 0f && inHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				inHitPause = false;
				((EntityState)this).characterMotor.velocity = storedVelocity;
			}
			if (!inHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
				}
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetFloat("Swing.playbackRate", 0f);
				}
			}
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration - earlyExitTime && ((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill1.down)
			{
				if (!hasFired)
				{
					FireAttack();
				}
				SetNextState();
			}
			else if (stopwatch >= 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)1;
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(swingIndex);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			swingIndex = reader.ReadInt32();
		}
	}
	public class BaseTimedSkillState : BaseSkillState
	{
		public static float TimedBaseDuration;

		public static float TimedBaseCastStartTime;

		public static float TimedBaseCastEndTime;

		protected float duration;

		protected float castStartTime;

		protected float castEndTime;

		protected bool hasFired;

		protected bool isFiring;

		protected bool hasExited;

		protected virtual void InitDurationValues(float baseDuration, float baseCastStartTime, float baseCastEndTime = 1f)
		{
			TimedBaseDuration = baseDuration;
			TimedBaseCastStartTime = baseCastStartTime;
			TimedBaseCastEndTime = baseCastEndTime;
			duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat;
			castStartTime = baseCastStartTime * duration;
			castEndTime = baseCastEndTime * duration;
		}

		protected virtual void OnCastEnter()
		{
		}

		protected virtual void OnCastFixedUpdate()
		{
		}

		protected virtual void OnCastUpdate()
		{
		}

		protected virtual void OnCastExit()
		{
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!hasFired && ((EntityState)this).fixedAge > castStartTime)
			{
				hasFired = true;
				OnCastEnter();
			}
			bool flag = ((EntityState)this).fixedAge >= castStartTime;
			bool flag2 = ((EntityState)this).fixedAge >= castEndTime;
			isFiring = false;
			if ((flag && !flag2) || (flag && flag2 && !hasFired))
			{
				isFiring = true;
				OnCastFixedUpdate();
			}
			if (flag2 && !hasExited)
			{
				hasExited = true;
				OnCastExit();
			}
			if (((EntityState)this).fixedAge > duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			if (isFiring)
			{
				OnCastUpdate();
			}
		}
	}
	public class ExampleTimedSkillState : BaseTimedSkillState
	{
		public static float SkillBaseDuration = 1.5f;

		public static float SkillStartTime = 0.2f;

		public static float SkillEndTime = 0.9f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			InitDurationValues(SkillBaseDuration, SkillStartTime, SkillEndTime);
		}

		protected override void OnCastEnter()
		{
		}

		protected override void OnCastFixedUpdate()
		{
		}

		protected override void OnCastExit()
		{
		}
	}
	public class ExampleDelayedSkillState : BaseTimedSkillState
	{
		public static float SkillBaseDuration = 1.5f;

		public static float SkillStartTime = 0.2f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			InitDurationValues(SkillBaseDuration, SkillStartTime);
		}

		protected override void OnCastEnter()
		{
		}
	}
}
namespace OpmMod.Modules
{
	internal static class Assets
	{
		internal static AssetBundle mainAssetBundle;

		private const string assetbundleName = "saitamaassetbundle";

		private const string csProjName = "OpmMod";

		internal static void Initialize()
		{
			bool flag = false;
			LoadAssetBundle();
			LoadSoundbank();
			PopulateAssets();
		}

		internal static void LoadAssetBundle()
		{
			try
			{
				if ((Object)(object)mainAssetBundle == (Object)null)
				{
					using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("OpmMod.saitamaassetbundle"))
					{
						mainAssetBundle = AssetBundle.LoadFromStream(stream);
						return;
					}
				}
			}
			catch (Exception ex)
			{
				Log.Error("Failed to load assetbundle. Make sure your assetbundle name is setup correctly\n" + ex);
			}
		}

		internal static void LoadSoundbank()
		{
		}

		internal static void PopulateAssets()
		{
			if (!Object.op_Implicit((Object)(object)mainAssetBundle))
			{
				Log.Error("There is no AssetBundle to load assets from.");
			}
		}

		internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert)
		{
			if (!Object.op_Implicit((Object)(object)objectToConvert))
			{
				return;
			}
			Renderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				if (val != null)
				{
					val.material?.SetHopooMaterial();
				}
			}
		}

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

		public static GameObject LoadSurvivorModel(string modelName)
		{
			GameObject val = mainAssetBundle.LoadAsset<GameObject>(modelName);
			if ((Object)(object)val == (Object)null)
			{
				Log.Error("Trying to load a null model- check to see if the BodyName in your code matches the prefab name of the object in Unity\nFor Example, if your prefab in unity is 'mdlHenry', then your BodyName must be 'Henry'");
				return null;
			}
			return PrefabAPI.InstantiateClone(val, ((Object)val).name, false);
		}

		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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Log.Error("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle");
				return null;
			}
			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;
			Content.AddEffectDef(val);
		}
	}
	public static class Buffs
	{
		internal static BuffDef noFallBuff;

		internal static void RegisterBuffs()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			noFallBuff = AddNewBuff("SaitamaNoFallBuff", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/HiddenInvincibility").iconSprite, Color.white, canStack: false, 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;
			Content.AddBuffDef(val);
			return val;
		}
	}
	public static class Config
	{
		public static void ReadConfig()
		{
		}

		public static ConfigEntry<bool> CharacterEnableConfig(string characterName, string description = "Set to false to disable this character", bool enabledDefault = true)
		{
			return ((BaseUnityPlugin)OpmPlugin.instance).Config.Bind<bool>("General", "Enable " + characterName, enabledDefault, description);
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

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

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

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

		public static List<SurvivorDef> survivorDefs = new List<SurvivorDef>();

		public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>();

		public static List<SkillFamily> skillFamilies = new List<SkillFamily>();

		public static List<SkillDef> skillDefs = new List<SkillDef>();

		public static List<Type> entityStates = new List<Type>();

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

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

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

		public string identifier => "com.LRDPOOB.OpmMod";

		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(bodyPrefabs.ToArray());
			contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
			contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
			contentPack.survivorDefs.Add(survivorDefs.ToArray());
			contentPack.unlockableDefs.Add(unlockableDefs.ToArray());
			contentPack.skillDefs.Add(skillDefs.ToArray());
			contentPack.skillFamilies.Add(skillFamilies.ToArray());
			contentPack.entityStateTypes.Add(entityStates.ToArray());
			contentPack.buffDefs.Add(buffDefs.ToArray());
			contentPack.effectDefs.Add(effectDefs.ToArray());
			contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.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 class Content
	{
		public static void AddCharacterBodyPrefab(GameObject bprefab)
		{
			ContentPacks.bodyPrefabs.Add(bprefab);
		}

		public static void AddMasterPrefab(GameObject prefab)
		{
			ContentPacks.masterPrefabs.Add(prefab);
		}

		public static void AddProjectilePrefab(GameObject prefab)
		{
			ContentPacks.projectilePrefabs.Add(prefab);
		}

		public static void AddSurvivorDef(SurvivorDef survivorDef)
		{
			ContentPacks.survivorDefs.Add(survivorDef);
		}

		public static void AddUnlockableDef(UnlockableDef unlockableDef)
		{
			ContentPacks.unlockableDefs.Add(unlockableDef);
		}

		public static void AddSkillDef(SkillDef skillDef)
		{
			ContentPacks.skillDefs.Add(skillDef);
		}

		public static void AddSkillFamily(SkillFamily skillFamily)
		{
			ContentPacks.skillFamilies.Add(skillFamily);
		}

		public static void AddEntityState(Type entityState)
		{
			ContentPacks.entityStates.Add(entityState);
		}

		public static void AddBuffDef(BuffDef buffDef)
		{
			ContentPacks.buffDefs.Add(buffDef);
		}

		public static void AddEffectDef(EffectDef effectDef)
		{
			ContentPacks.effectDefs.Add(effectDef);
		}

		public static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef)
		{
			ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef);
		}
	}
	internal static class Helpers
	{
		internal const string agilePrefix = "<style=cIsUtility>Agile.</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 ItemDisplays
	{
		private static Dictionary<string, GameObject> itemDisplayPrefabs = new Dictionary<string, GameObject>();

		internal static void PopulateDisplays()
		{
			PopulateFromBody("MageBody");
			PopulateFromBody("LunarExploderBody");
			PopulateCustomLightningArm();
		}

		private static void PopulateFromBody(string bodyName)
		{
			ItemDisplayRuleSet itemDisplayRuleSet = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyName).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?.ToLowerInvariant();
						if (!itemDisplayPrefabs.ContainsKey(key))
						{
							itemDisplayPrefabs[key] = followerPrefab;
						}
					}
				}
			}
		}

		private static void PopulateCustomLightningArm()
		{
			GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["displaylightningarmright"], "DisplayLightningCustom", false);
			LimbMatcher component = val.GetComponent<LimbMatcher>();
			component.limbPairs[0].targetChildLimb = "LightningArm1";
			component.limbPairs[1].targetChildLimb = "LightningArm2";
			component.limbPairs[2].targetChildLimb = "LightningArmEnd";
			itemDisplayPrefabs["displaylightningarmcustom"] = val;
		}

		public static GameObject LoadDisplay(string name)
		{
			if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()]))
			{
				return itemDisplayPrefabs[name.ToLowerInvariant()];
			}
			Log.Error("item display " + name + " returned null");
			return null;
		}
	}
	internal static class Materials
	{
		private static List<Material> cachedMaterials = new List<Material>();

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

		public static Material CreateHopooMaterial(string materialName)
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			Material val = cachedMaterials.Find(delegate(Material mat)
			{
				materialName.Replace(" (Instance)", "");
				return ((Object)mat).name.Contains(materialName);
			});
			if (Object.op_Implicit((Object)(object)val))
			{
				return val;
			}
			val = Assets.mainAssetBundle.LoadAsset<Material>(materialName);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Log.Error("Failed to load material: " + materialName + " - Check to see that the material in your Unity project matches this name");
				return new Material(hotpoo);
			}
			return val.SetHopooMaterial();
		}

		public static Material SetHopooMaterial(this Material tempMat)
		{
			//IL_0089: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			if (cachedMaterials.Contains(tempMat))
			{
				return tempMat;
			}
			float? num = null;
			Color? val = null;
			if (tempMat.IsKeywordEnabled("_NORMALMAP"))
			{
				num = tempMat.GetFloat("_BumpScale");
			}
			if (tempMat.IsKeywordEnabled("_EMISSION"))
			{
				val = tempMat.GetColor("_EmissionColor");
			}
			tempMat.shader = hotpoo;
			tempMat.SetColor("_Color", tempMat.GetColor("_Color"));
			tempMat.SetTexture("_MainTex", tempMat.GetTexture("_MainTex"));
			tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap"));
			tempMat.EnableKeyword("DITHER");
			if (num.HasValue)
			{
				tempMat.SetFloat("_NormalStrength", num.Value);
			}
			if (val.HasValue)
			{
				tempMat.SetColor("_EmColor", val.Value);
				tempMat.SetFloat("_EmPower", 1f);
			}
			if (tempMat.IsKeywordEnabled("NOCULL"))
			{
				tempMat.SetInt("_Cull", 0);
			}
			if (tempMat.IsKeywordEnabled("LIMBREMOVAL"))
			{
				tempMat.SetInt("_LimbRemovalOn", 1);
			}
			cachedMaterials.Add(tempMat);
			return tempMat;
		}

		public static Material MakeUnique(this Material material)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			if (cachedMaterials.Contains(material))
			{
				return new Material(material);
			}
			return material;
		}

		public static Material SetColor(this Material material, Color color)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			material.SetColor("_Color", color);
			return material;
		}

		public static Material SetNormal(this Material material, float normalStrength = 1f)
		{
			material.SetFloat("_NormalStrength", normalStrength);
			return material;
		}

		public static Material SetEmission(this Material material)
		{
			return material.SetEmission(1f);
		}

		public static Material SetEmission(this Material material, float emission)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return material.SetEmission(emission, Color.white);
		}

		public static Material SetEmission(this Material material, float emission, Color emissionColor)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			material.SetFloat("_EmPower", emission);
			material.SetColor("_EmColor", emissionColor);
			return material;
		}

		public static Material SetCull(this Material material, bool cull = false)
		{
			material.SetInt("_Cull", cull ? 1 : 0);
			return material;
		}
	}
	internal static class Prefabs
	{
		private static PhysicMaterial ragdollMaterial;

		public static GameObject CreateDisplayPrefab(string displayModelName, GameObject prefab, BodyInfo bodyInfo)
		{
			GameObject val = Assets.LoadSurvivorModel(displayModelName);
			CharacterModel val2 = val.GetComponent<CharacterModel>();
			if (!Object.op_Implicit((Object)(object)val2))
			{
				val2 = val.AddComponent<CharacterModel>();
			}
			val2.baseRendererInfos = prefab.GetComponentInChildren<CharacterModel>().baseRendererInfos;
			Assets.ConvertAllRenderersToHopooShader(val);
			return val.gameObject;
		}

		public static GameObject CreateBodyPrefab(string bodyName, string modelName, BodyInfo bodyInfo)
		{
			//IL_00d7: 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_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body");
			if (!Object.op_Implicit((Object)(object)val))
			{
				Log.Error(bodyInfo.bodyNameToClone + "Body is not a valid body, character creation failed");
				return null;
			}
			GameObject val2 = PrefabAPI.InstantiateClone(val, bodyName);
			Transform val3 = null;
			GameObject val4 = null;
			if (modelName != "mdl")
			{
				val4 = Assets.LoadSurvivorModel(modelName);
				if ((Object)(object)val4 == (Object)null)
				{
					val4 = ((Component)val2.GetComponentInChildren<CharacterModel>()).gameObject;
				}
				val3 = AddCharacterModelToSurvivorBody(val2, val4.transform, bodyInfo);
			}
			CharacterBody component = val2.GetComponent<CharacterBody>();
			((Object)component).name = bodyInfo.bodyName;
			component.baseNameToken = bodyInfo.bodyNameToken;
			component.subtitleNameToken = bodyInfo.subtitleNameToken;
			component.portraitIcon = bodyInfo.characterPortrait;
			component.bodyColor = bodyInfo.bodyColor;
			component._defaultCrosshairPrefab = bodyInfo.crosshair;
			component.hideCrosshair = false;
			component.preferredPodPrefab = bodyInfo.podPrefab;
			component.baseMaxHealth = bodyInfo.maxHealth;
			component.baseRegen = bodyInfo.healthRegen;
			component.baseArmor = bodyInfo.armor;
			component.baseMaxShield = bodyInfo.shield;
			component.baseDamage = bodyInfo.damage;
			component.baseAttackSpeed = bodyInfo.attackSpeed;
			component.baseCrit = bodyInfo.crit;
			component.baseMoveSpeed = bodyInfo.moveSpeed;
			component.baseJumpPower = bodyInfo.jumpPower;
			component.autoCalculateLevelStats = bodyInfo.autoCalculateLevelStats;
			if (bodyInfo.autoCalculateLevelStats)
			{
				component.levelMaxHealth = Mathf.Round(component.baseMaxHealth * 0.3f);
				component.levelMaxShield = Mathf.Round(component.baseMaxShield * 0.3f);
				component.levelRegen = component.baseRegen * 0.2f;
				component.levelMoveSpeed = 0f;
				component.levelJumpPower = 0f;
				component.levelDamage = component.baseDamage * 0.2f;
				component.levelAttackSpeed = 0f;
				component.levelCrit = 0f;
				component.levelArmor = 0f;
			}
			else
			{
				component.levelMaxHealth = bodyInfo.healthGrowth;
				component.levelMaxShield = bodyInfo.shieldGrowth;
				component.levelRegen = bodyInfo.regenGrowth;
				component.levelMoveSpeed = bodyInfo.moveSpeedGrowth;
				component.levelJumpPower = bodyInfo.jumpPowerGrowth;
				component.levelDamage = bodyInfo.damageGrowth;
				component.levelAttackSpeed = bodyInfo.attackSpeedGrowth;
				component.levelCrit = bodyInfo.critGrowth;
				component.levelArmor = bodyInfo.armorGrowth;
			}
			component.baseAcceleration = bodyInfo.acceleration;
			component.baseJumpCount = bodyInfo.jumpCount;
			component.sprintingSpeedMultiplier = 1.45f;
			component.bodyFlags = (BodyFlags)16;
			component.rootMotionInMainState = false;
			component.hullClassification = (HullClassification)0;
			component.isChampion = false;
			SetupCameraTargetParams(val2, bodyInfo);
			SetupModelLocator(val2, val3, val4.transform);
			SetupCapsuleCollider(val2);
			SetupMainHurtbox(val2, val4);
			SetupAimAnimator(val2, val4);
			if ((Object)(object)val3 != (Object)null)
			{
				SetupCharacterDirection(val2, val3, val4.transform);
			}
			SetupFootstepController(val4);
			SetupRagdoll(val4);
			Content.AddCharacterBodyPrefab(val2);
			return val2;
		}

		public static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy)
		{
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true);
			val.GetComponent<CharacterMaster>().bodyPrefab = bodyPrefab;
			Content.AddMasterPrefab(val);
		}

		private static Transform AddCharacterModelToSurvivorBody(GameObject bodyPrefab, Transform modelTransform, BodyInfo bodyInfo)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			for (int num = bodyPrefab.transform.childCount - 1; num >= 0; num--)
			{
				Object.DestroyImmediate((Object)(object)((Component)bodyPrefab.transform.GetChild(num)).gameObject);
			}
			Transform transform = new GameObject("ModelBase").transform;
			transform.parent = bodyPrefab.transform;
			transform.localPosition = bodyInfo.modelBasePosition;
			transform.localRotation = Quaternion.identity;
			modelTransform.parent = ((Component)transform).transform;
			modelTransform.localPosition = Vector3.zero;
			modelTransform.localRotation = Quaternion.identity;
			GameObject val = new GameObject("CameraPivot");
			val.transform.parent = bodyPrefab.transform;
			val.transform.localPosition = bodyInfo.cameraPivotPosition;
			val.transform.localRotation = Quaternion.identity;
			GameObject val2 = new GameObject("AimOrigin");
			val2.transform.parent = bodyPrefab.transform;
			val2.transform.localPosition = bodyInfo.aimOriginPosition;
			val2.transform.localRotation = Quaternion.identity;
			bodyPrefab.GetComponent<CharacterBody>().aimOriginTransform = val2.transform;
			return ((Component)transform).transform;
		}

		public static CharacterModel SetupCharacterModel(GameObject prefab)
		{
			return SetupCharacterModel(prefab, null);
		}

		public static CharacterModel SetupCharacterModel(GameObject prefab, CustomRendererInfo[] customInfos)
		{
			CharacterModel val = ((Component)prefab.GetComponent<ModelLocator>().modelTransform).gameObject.GetComponent<CharacterModel>();
			bool flag = (Object)(object)val != (Object)null;
			if (!flag)
			{
				val = ((Component)prefab.GetComponent<ModelLocator>().modelTransform).gameObject.AddComponent<CharacterModel>();
			}
			val.body = prefab.GetComponent<CharacterBody>();
			val.autoPopulateLightInfos = true;
			val.invisibilityCount = 0;
			val.temporaryOverlays = new List<TemporaryOverlay>();
			if (!flag)
			{
				SetupCustomRendererInfos(val, customInfos);
			}
			else
			{
				SetupPreAttachedRendererInfos(val);
			}
			return val;
		}

		public static void SetupPreAttachedRendererInfos(CharacterModel characterModel)
		{
			for (int i = 0; i < characterModel.baseRendererInfos.Length; i++)
			{
				if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null)
				{
					characterModel.baseRendererInfos[i].defaultMaterial = characterModel.baseRendererInfos[i].renderer.sharedMaterial;
				}
				characterModel.baseRendererInfos[i].defaultMaterial.SetHopooMaterial();
			}
		}

		public static void SetupCustomRendererInfos(CharacterModel characterModel, CustomRendererInfo[] customInfos)
		{
			//IL_00de: 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)
			ChildLocator component = ((Component)characterModel).GetComponent<ChildLocator>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				Log.Error("Failed CharacterModel setup: ChildLocator component does not exist on the model");
				return;
			}
			List<RendererInfo> list = new List<RendererInfo>();
			for (int i = 0; i < customInfos.Length; i++)
			{
				if (!Object.op_Implicit((Object)(object)component.FindChild(customInfos[i].childName)))
				{
					Log.Error("Trying to add a RendererInfo for a renderer that does not exist: " + customInfos[i].childName);
					continue;
				}
				Renderer component2 = ((Component)component.FindChild(customInfos[i].childName)).GetComponent<Renderer>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					Material val = customInfos[i].material;
					if ((Object)(object)val == (Object)null)
					{
						val = ((!customInfos[i].dontHotpoo) ? component2.material.SetHopooMaterial() : component2.material);
					}
					list.Add(new RendererInfo
					{
						renderer = component2,
						defaultMaterial = val,
						ignoreOverlays = customInfos[i].ignoreOverlays,
						defaultShadowCastingMode = (ShadowCastingMode)1
					});
				}
			}
			characterModel.baseRendererInfos = list.ToArray();
		}

		private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform)
		{
			if (Object.op_Implicit((Object)(object)prefab.GetComponent<CharacterDirection>()))
			{
				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, BodyInfo bodyInfo)
		{
			CameraTargetParams component = prefab.GetComponent<CameraTargetParams>();
			component.cameraParams = bodyInfo.cameraParams;
			component.cameraPivotTransform = prefab.transform.Find("CameraPivot");
		}

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

		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.LogWarning((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;
		}

		public static void SetupHurtBoxes(GameObject bodyPrefab)
		{
			HealthComponent component = bodyPrefab.GetComponent<HealthComponent>();
			HurtBoxGroup[] componentsInChildren = bodyPrefab.GetComponentsInChildren<HurtBoxGroup>();
			foreach (HurtBoxGroup val in componentsInChildren)
			{
				val.mainHurtBox.healthComponent = component;
				for (int j = 0; j < val.hurtBoxes.Length; j++)
				{
					val.hurtBoxes[j].healthComponent = component;
				}
			}
		}

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

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

		public 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;
		}
	}
	public class CustomRendererInfo
	{
		public string childName;

		public Material material = null;

		public bool dontHotpoo = false;

		public bool ignoreOverlays = false;
	}
	internal static class Skills
	{
		public static void CreateSkillFamilies(GameObject targetPrefab, bool destroyExisting = true)
		{
			if (destroyExisting)
			{
				GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren<GenericSkill>();
				foreach (GenericSkill val in componentsInChildren)
				{
					Object.DestroyImmediate((Object)(object)val);
				}
			}
			SkillLocator component = targetPrefab.GetComponent<SkillLocator>();
			component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary");
			component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary");
			component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility");
			component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special");
		}

		public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false)
		{
			GenericSkill val = targetPrefab.AddComponent<GenericSkill>();
			val.skillName = familyName;
			val.hideInCharacterSelect = hidden;
			SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val2).name = ((Object)targetPrefab).name + familyName + "Family";
			val2.variants = (Variant[])(object)new Variant[0];
			val._skillFamily = val2;
			Content.AddSkillFamily(val2);
			return val;
		}

		public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null)
		{
			//IL_0029: 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_0053: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val = new Variant
			{
				skillDef = skillDef,
				unlockableDef = unlockableDef
			};
			((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null);
			variants[num] = val;
		}

		public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs)
		{
			foreach (SkillDef skillDef in skillDefs)
			{
				AddSkillToFamily(skillFamily, skillDef);
			}
		}

		public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs)
		{
			AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().primary.skillFamily, skillDefs);
		}

		public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs)
		{
			AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().secondary.skillFamily, skillDefs);
		}

		public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs)
		{
			AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().utility.skillFamily, skillDefs);
		}

		public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs)
		{
			AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().special.skillFamily, skillDefs);
		}

		public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < unlockableDefs.Length; i++)
			{
				Variant val = skillFamily.variants[i];
				val.unlockableDef = unlockableDefs[i];
				skillFamily.variants[i] = val;
			}
		}

		public static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo)
		{
			return Skills.CreateSkillDef<SkillDef>(skillDefInfo);
		}

		public static T CreateSkillDef<T>(SkillDefInfo skillDefInfo) where T : SkillDef
		{
			//IL_0064: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			T val = ScriptableObject.CreateInstance<T>();
			((SkillDef)val).skillName = skillDefInfo.skillName;
			((Object)(object)val).name = skillDefInfo.skillName;
			((SkillDef)val).skillNameToken = skillDefInfo.skillNameToken;
			((SkillDef)val).skillDescriptionToken = skillDefInfo.skillDescriptionToken;
			((SkillDef)val).icon = skillDefInfo.skillIcon;
			((SkillDef)val).activationState = skillDefInfo.activationState;
			((SkillDef)val).activationStateMachineName = skillDefInfo.activationStateMachineName;
			((SkillDef)val).baseMaxStock = skillDefInfo.baseMaxStock;
			((SkillDef)val).baseRechargeInterval = skillDefInfo.baseRechargeInterval;
			((SkillDef)val).beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd;
			((SkillDef)val).canceledFromSprinting = skillDefInfo.canceledFromSprinting;
			((SkillDef)val).forceSprintDuringState = skillDefInfo.forceSprintDuringState;
			((SkillDef)val).fullRestockOnAssign = skillDefInfo.fullRestockOnAssign;
			((SkillDef)val).interruptPriority = skillDefInfo.interruptPriority;
			((SkillDef)val).resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse;
			((SkillDef)val).isCombatSkill = skillDefInfo.isCombatSkill;
			((SkillDef)val).mustKeyPress = skillDefInfo.mustKeyPress;
			((SkillDef)val).cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation;
			((SkillDef)val).rechargeStock = skillDefInfo.rechargeStock;
			((SkillDef)val).requiredStock = skillDefInfo.requiredStock;
			((SkillDef)val).stockToConsume = skillDefInfo.stockToConsume;
			((SkillDef)val).keywordTokens = skillDefInfo.keywordTokens;
			Content.AddSkillDef((SkillDef)(object)val);
			return val;
		}
	}
	internal class SkillDefInfo
	{
		public string skillName;

		public string skillNameToken;

		public string skillDescriptionToken;

		public string[] keywordTokens = new string[0];

		public Sprite skillIcon;

		public SerializableEntityStateType activationState;

		public InterruptPriority interruptPriority;

		public string activationStateMachineName;

		public float baseRechargeInterval;

		public int baseMaxStock = 1;

		public int rechargeStock = 1;

		public int requiredStock = 1;

		public int stockToConsume = 1;

		public bool isCombatSkill = true;

		public bool canceledFromSprinting;

		public bool forceSprintDuringState;

		public bool cancelSprintingOnActivation = true;

		public bool beginSkillCooldownOnSkillEnd;

		public bool fullRestockOnAssign = true;

		public bool resetCooldownTimerOnUse;

		public bool mustKeyPress;

		public SkillDefInfo()
		{
		}

		public SkillDefInfo(string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false)
		{
			//IL_0062: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			skillName = skillNameToken;
			this.skillNameToken = skillNameToken;
			this.skillDescriptionToken = skillDescriptionToken;
			this.skillIcon = skillIcon;
			this.activationState = activationState;
			this.activationStateMachineName = activationStateMachineName;
			interruptPriority = (InterruptPriority)0;
			isCombatSkill = true;
			baseRechargeInterval = 0f;
			requiredStock = 0;
			stockToConsume = 0;
			cancelSprintingOnActivation = !agile;
			if (agile)
			{
				keywordTokens = new string[1] { "KEYWORD_AGILE" };
			}
		}
	}
	internal static class Skins
	{
		internal struct SkinDefInfo
		{
			internal SkinDef[] BaseSkins;

			internal Sprite Icon;

			internal string NameToken;

			internal UnlockableDef UnlockableDef;

			internal GameObject RootObject;

			internal RendererInfo[] RendererInfos;

			internal MeshReplacement[] MeshReplacements;

			internal GameObjectActivation[] GameObjectActivations;

			internal ProjectileGhostReplacement[] ProjectileGhostReplacements;

			internal MinionSkinReplacement[] MinionSkinReplacements;

			internal string Name;
		}

		internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] defaultRendererInfos, GameObject root, UnlockableDef unlockableDef = null)
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Expected O, but got Unknown
			SkinDefInfo skinDefInfo = default(SkinDefInfo);
			skinDefInfo.BaseSkins = Array.Empty<SkinDef>();
			skinDefInfo.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0];
			skinDefInfo.Icon = skinIcon;
			skinDefInfo.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
			skinDefInfo.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
			skinDefInfo.Name = skinName;
			skinDefInfo.NameToken = skinName;
			skinDefInfo.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
			skinDefInfo.RendererInfos = (RendererInfo[])(object)new RendererInfo[defaultRendererInfos.Length];
			skinDefInfo.RootObject = root;
			skinDefInfo.UnlockableDef = unlockableDef;
			SkinDefInfo skinDefInfo2 = skinDefInfo;
			SkinDef.Awake += new hook_Awake(DoNothing);
			SkinDef val = ScriptableObject.CreateInstance<SkinDef>();
			val.baseSkins = skinDefInfo2.BaseSkins;
			val.icon = skinDefInfo2.Icon;
			val.unlockableDef = skinDefInfo2.UnlockableDef;
			val.rootObject = skinDefInfo2.RootObject;
			defaultRendererInfos.CopyTo(skinDefInfo2.RendererInfos, 0);
			val.rendererInfos = skinDefInfo2.RendererInfos;
			val.gameObjectActivations = skinDefInfo2.GameObjectActivations;
			val.meshReplacements = skinDefInfo2.MeshReplacements;
			val.projectileGhostReplacements = skinDefInfo2.ProjectileGhostReplacements;
			val.minionSkinReplacements = skinDefInfo2.MinionSkinReplacements;
			val.nameToken = skinDefInfo2.NameToken;
			((Object)val).name = skinDefInfo2.Name;
			SkinDef.Awake -= new hook_Awake(DoNothing);
			return val;
		}

		private static void DoNothing(orig_Awake orig, SkinDef self)
		{
		}

		private static RendererInfo[] getRendererMaterials(RendererInfo[] defaultRenderers, params Material[] materials)
		{
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length];
			defaultRenderers.CopyTo(array, 0);
			for (int i = 0; i < array.Length; i++)
			{
				try
				{
					array[i].defaultMaterial = materials[i];
				}
				catch
				{
					Log.Error("error adding skin rendererinfo material. make sure you're not passing in too many");
				}
			}
			return array;
		}

		internal static MeshReplacement[] getMeshReplacements(RendererInfo[] defaultRendererInfos, params string[] meshes)
		{
			//IL_001d: 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)
			List<MeshReplacement> list = new List<MeshReplacement>();
			for (int i = 0; i < defaultRendererInfos.Length; i++)
			{
				if (!string.IsNullOrEmpty(meshes[i]))
				{
					list.Add(new MeshReplacement
					{
						renderer = defaultRendererInfos[i].renderer,
						mesh = Assets.mainAssetBundle.LoadAsset<Mesh>(meshes[i])
					});
				}
			}
			return list.ToArray();
		}
	}
	public static class States
	{
		internal static void RegisterStates()
		{
			Content.AddEntityState(typeof(BaseMeleeAttack));
			Content.AddEntityState(typeof(Punch));
			Content.AddEntityState(typeof(Stun));
			Content.AddEntityState(typeof(Jump));
			Content.AddEntityState(typeof(SeriousPunch));
		}
	}
	internal static class StaticValues
	{
		internal static string descriptionText = "ONE PUUUUUUNCH<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine + "< ! > Saitama performs a normal punch every so often." + Environment.NewLine + Environment.NewLine + "< ! > Saitama performs Serious Sideways Jumps, stunning all opponents in a short radius." + Environment.NewLine + Environment.NewLine + "< ! > Saitama jumps in a straight line towards the crosshair and flies for a distance." + Environment.NewLine + Environment.NewLine + "< ! > Saitama performs a Serious Punch." + Environment.NewLine + Environment.NewLine;

		internal const float punchDamageCoefficient = 2.8f;

		internal const float stunDamageCoefficient = 0f;

		internal const float seriousPunchDamageCoefficient = 25f;
	}
	internal static class Tokens
	{
		internal static void AddTokens()
		{
			string text = "LRDPOOB_SAITAMA_BODY_";
			string text2 = "ONE PUUUUUUNCH<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine;
			text2 = text2 + "< ! > Saitama performs a normal punch every so often." + Environment.NewLine + Environment.NewLine;
			text2 = text2 + "< ! > Saitama performs Serious Sideways Jumps, stunning all opponents in a short radius." + Environment.NewLine + Environment.NewLine;
			text2 = text2 + "< ! > Saitama jumps in a straight line towards the crosshair and flies for a distance." + Environment.NewLine + Environment.NewLine;
			text2 = text2 + "< ! > Saitama performs a Serious Punch." + Environment.NewLine + Environment.NewLine;
			string text3 = "..and so he left, searching for his next foe.";
			string text4 = "..and so he vanished, his search for happiness over.";
			LanguageAPI.Add(text + "NAME", "Saitama");
			LanguageAPI.Add(text + "DESCRIPTION", text2);
			LanguageAPI.Add(text + "SUBTITLE", "The Caped Baldy");
			LanguageAPI.Add(text + "LORE", "sample lore");
			LanguageAPI.Add(text + "OUTRO_FLAVOR", text3);
			LanguageAPI.Add(text + "OUTRO_FAILURE", text4);
			LanguageAPI.Add(text + "DEFAULT_SKIN_NAME", "Default");
			LanguageAPI.Add(text + "MASTERY_SKIN_NAME", "Alternate");
			LanguageAPI.Add(text + "PASSIVE_NAME", "Saitama passive");
			LanguageAPI.Add(text + "PASSIVE_DESCRIPTION", "Saitama does not take fall damage.");
			LanguageAPI.Add(text + "PRIMARY_SLASH_NAME", "Punch");
			LanguageAPI.Add(text + "PRIMARY_SLASH_DESCRIPTION", "<style=cIsUtility>Agile.</style> " + $"Perform a Normal Punch for <style=cIsDamage>{280f}% damage</style>.");
			LanguageAPI.Add(text + "SECONDARY_GUN_NAME", "Stun");
			LanguageAPI.Add(text + "SECONDARY_GUN_DESCRIPTION", "<style=cIsUtility>Agile.</style> Perform serious sideways jumps to stun.");
			LanguageAPI.Add(text + "UTILITY_ROLL_NAME", "Jump");
			LanguageAPI.Add(text + "UTILITY_ROLL_DESCRIPTION", "Jump towards the direction you are looking.");
			LanguageAPI.Add(text + "SPECIAL_BOMB_NAME", "SeriousPunch");
			LanguageAPI.Add(text + "SPECIAL_BOMB_DESCRIPTION", $"Perform a Serious Punch for <style=cIsDamage>{2500f}% damage</style>.");
		}
	}
	public abstract class BaseMasteryUnlockable : GenericModdedUnlockable
	{
		public abstract string RequiredCharacterBody { get; }

		public abstract float RequiredDifficultyCoefficient { get; }

		public override void OnBodyRequirementMet()
		{
			((ModdedUnlockable)this).OnBodyRequirementMet();
			Run.onClientGameOverGlobal += OnClientGameOverGlobal;
		}

		public override void OnBodyRequirementBroken()
		{
			Run.onClientGameOverGlobal -= OnClientGameOverGlobal;
			((ModdedUnlockable)this).OnBodyRequirementBroken();
		}

		private void OnClientGameOverGlobal(Run run, RunReport runReport)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Invalid comparison between Unknown and I4
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Invalid comparison between Unknown and I4
			if (Object.op_Implicit((Object)(object)runReport.gameEnding) && runReport.gameEnding.isWin)
			{
				DifficultyIndex val = runReport.ruleBook.FindDifficulty();
				DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(runReport.ruleBook.FindDifficulty());
				if ((difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient) || ((int)val >= 3 && (int)val <= 10) || difficultyDef.nameToken == "INFERNO_NAME")
				{
					((BaseAchievement)this).Grant();
				}
			}
		}

		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex(RequiredCharacterBody);
		}
	}
	public abstract class GenericModdedUnlockable : ModdedUnlockable
	{
		public abstract string AchievementTokenPrefix { get; }

		public abstract string AchievementSpriteName { get; }

		public override string AchievementIdentifier => AchievementTokenPrefix + "UNLOCKABLE_ACHIEVEMENT_ID";

		public override string UnlockableIdentifier => AchievementTokenPrefix + "UNLOCKABLE_REWARD_ID";

		public override string AchievementNameToken => AchievementTokenPrefix + "UNLOCKABLE_ACHIEVEMENT_NAME";

		public override string AchievementDescToken => AchievementTokenPrefix + "UNLOCKABLE_ACHIEVEMENT_DESC";

		public override string UnlockableNameToken => AchievementTokenPrefix + "UNLOCKABLE_UNLOCKABLE_NAME";

		public override Sprite Sprite => Assets.mainAssetBundle.LoadAsset<Sprite>(AchievementSpriteName);

		public override Func<string> GetHowToUnlock => () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2]
		{
			Language.GetString(((ModdedUnlockable)this).AchievementNameToken),
			Language.GetString(((ModdedUnlockable)this).AchievementDescToken)
		});

		public override Func<string> GetUnlocked => () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
		{
			Language.GetString(((ModdedUnlockable)this).AchievementNameToken),
			Language.GetString(((ModdedUnlockable)this).AchievementDescToken)
		});
	}
}
namespace OpmMod.Modules.Survivors
{
	internal class MyCharacter : SurvivorBase
	{
		public const string OPM_PREFIX = "LRDPOOBsaitama_Body";

		private static UnlockableDef masterySkinUnlockableDef;

		public override string prefabBodyName => "Saitama";

		public override string survivorTokenPrefix => "LRDPOOBsaitama_Body";

		public override BodyInfo bodyInfo { get; set; } = new BodyInfo
		{
			bodyName = "Saitama",
			bodyNameToken = "LRDPOOBsaitama_BodyNAME",
			subtitleNameToken = "LRDPOOBsaitama_BodySUBTITLE",
			characterPortrait = Assets.mainAssetBundle.LoadAsset<Texture>("saitamaBody"),
			bodyColor = Color.white,
			crosshair = Assets.LoadCrosshair("Standard"),
			podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"),
			maxHealth = 200f,
			healthRegen = 1.5f,
			armor = 0f,
			jumpCount = 1
		};


		public override CustomRendererInfo[] customRendererInfos { get; set; } = new CustomRendererInfo[2]
		{
			new CustomRendererInfo
			{
				childName = "Cube_Cube_002"
			},
			new CustomRendererInfo
			{
				childName = "Plane_Plane_001"
			}
		};


		public override UnlockableDef characterUnlockableDef => null;

		public override Type characterMainState => typeof(GenericCharacterMain);

		public override ItemDisplaysBase itemDisplays => new OpmItemDisplays();

		public override ConfigEntry<bool> characterEnabledConfig => null;

		public override void InitializeCharacter()
		{
			base.InitializeCharacter();
		}

		public override void InitializeUnlockables()
		{
		}

		public override void InitializeHitboxes()
		{
			ChildLocator componentInChildren = bodyPrefab.GetComponentInChildren<ChildLocator>();
			GameObject gameObject = ((Component)componentInChildren).gameObject;
			Transform hitboxTransform = componentInChildren.FindChild("Skill1Hitbox");
			Prefabs.SetupHitbox(((Component)prefabCharacterModel).gameObject, hitboxTransform, "Skill1");
			Transform hitboxTransform2 = componentInChildren.FindChild("Skill2Hitbox");
			Prefabs.SetupHitbox(((Component)prefabCharacterModel).gameObject, hitboxTransform2, "Skill2");
			Transform hitboxTransform3 = componentInChildren.FindChild("Skill4Hitbox");
			Prefabs.SetupHitbox(((Component)prefabCharacterModel).gameObject, hitboxTransform3, "Skill4");
		}

		public override void InitializeSkills()
		{
			//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_00c0: 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_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			Skills.CreateSkillFamilies(bodyPrefab);
			string text = "LRDPOOB";
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = text + "saitama_Body_Skill_1_Name";
			skillDefInfo.skillNameToken = text + "saitama_Body_Skill_1_Name";
			skillDefInfo.skillDescriptionToken = text + "saitama_Body_Skill_1_Description";
			skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("Skill2Icon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Punch));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 0.6f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = false;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.cancelSprintingOnActivation = true;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.keywordTokens = new string[1] { "KEYWORD_PUNCH" };
			SkillDef val = Skills.CreateSkillDef(skillDefInfo);
			Skills.AddPrimarySkills(bodyPrefab, val);
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = text + "saitama_Body_Skill_2_Name";
			skillDefInfo.skillNameToken = text + "saitama_Body_Skill_2_Name";
			skillDefInfo.skillDescriptionToken = text + "saitama_Body_Skill_2_Description";
			skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("Skill2Icon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Stun));
			skillDefInfo.activationStateMachineName = "Body";
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 7f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.cancelSprintingOnActivation = true;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.keywordTokens = new string[1] { "KEYWORD_STUN" };
			SkillDef val2 = Skills.CreateSkillDef(skillDefInfo);
			Skills.AddSecondarySkills(bodyPrefab, val2);
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = text + "saitama_Body_Skill_3_Name";
			skillDefInfo.skillNameToken = text + "saitama_Body_Skill_3_Name";
			skillDefInfo.skillDescriptionToken = text + "saitama_Body_Skill_3_Description";
			skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("Skill3Icon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Jump));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 10f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = true;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)2;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = false;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			SkillDef val3 = Skills.CreateSkillDef(skillDefInfo);
			Skills.AddUtilitySkills(bodyPrefab, val3);
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = text + "saitama_Body_Skill_4_Name";
			skillDefInfo.skillNameToken = text + "saitama_Body_Skill_4_Name";
			skillDefInfo.skillDescriptionToken = text + "saitama_Body_Skill_4_Description";
			skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("Skill4Icon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(SeriousPunch));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 15f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = false;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.cancelSprintingOnActivation = true;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			SkillDef val4 = Skills.CreateSkillDef(skillDefInfo);
			Skills.AddSpecialSkills(bodyPrefab, val4);
		}

		public override void InitializeSkins()
		{
			ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent<ModelSkinController>();
			ChildLocator component = ((Component)prefabCharacterModel).GetComponent<ChildLocator>();
			RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos;
			List<SkinDef> list = new List<SkinDef>();
			SkinDef val2 = Skins.CreateSkinDef("LRDPOOBsaitama_BodyDEFAULT_SKIN_NAME", Assets.mainAssetBundle.LoadAsset<Sprite>("Saitama"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject);
			val2.meshReplacements = Skins.getMeshReplacements(baseRendererInfos, "Cube_Cube_002", "Plane_Plane_001");
			list.Add(val2);
			val.skins = list.ToArray();
		}
	}
	internal abstract class SurvivorBase : CharacterBase
	{
		public abstract string survivorTokenPrefix { get; }

		public abstract UnlockableDef characterUnlockableDef { get; }

		public virtual ConfigEntry<bool> characterEnabledConfig { get; }

		public virtual GameObject displayPrefab { get; set; }

		public override void InitializeCharacter()
		{
			if (characterEnabledConfig == null || characterEnabledConfig.Value)
			{
				InitializeUnlockables();
				base.InitializeCharacter();
				InitializeSurvivor();
			}
		}

		protected override void InitializeCharacterBodyAndModel()
		{
			base.InitializeCharacterBodyAndModel();
			InitializeDisplayPrefab();
		}

		protected virtual void InitializeSurvivor()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			RegisterNewSurvivor(bodyPrefab, displayPrefab, Color.grey, survivorTokenPrefix, characterUnlockableDef, bodyInfo.sortPosition);
		}

		protected virtual void InitializeDisplayPrefab()
		{
			displayPrefab = Prefabs.CreateDisplayPrefab(prefabBodyName + "Display", bodyPrefab, bodyInfo);
		}

		public virtual void InitializeUnlockables()
		{
		}

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

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

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

		public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition)
		{
			//IL_0016: 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)
			SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
			val.bodyPrefab = bodyPrefab;
			val.displayPrefab = displayPrefab;
			val.primaryColor = charColor;
			val.cachedName = ((Object)bodyPrefab).name.Replace("Body", "");
			val.displayNameToken = tokenPrefix + "NAME";
			val.descriptionToken = tokenPrefix + "DESCRIPTION";
			val.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR";
			val.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE";
			val.desiredSortPosition = sortPosition;
			val.unlockableDef = unlockableDef;
			Content.AddSurvivorDef(val);
		}

		protected virtual void AddCssPreviewSkill(int indexFromEditor, SkillFamily skillFamily, SkillDef skillDef)
		{
			CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				Log.Error("trying to add skillChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor");
				return;
			}
			component.skillChangeResponses[indexFromEditor].triggerSkillFamily = skillFamily;
			component.skillChangeResponses[indexFromEditor].triggerSkill = skillDef;
		}

		protected virtual void AddCssPreviewSkin(int indexFromEditor, SkinDef skinDef)
		{
			CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				Log.Error("trying to add skinChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor");
			}
			else
			{
				component.skinChangeResponses[indexFromEditor].triggerSkin = skinDef;
			}
		}

		protected virtual void FinalizeCSSPreviewDisplayController()
		{
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)displayPrefab))
			{
				return;
			}
			CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			component.bodyPrefab = bodyPrefab;
			List<SkillChangeResponse> list = new List<SkillChangeResponse>();
			for (int i = 0; i < component.skillChangeResponses.Length; i++)
			{
				if ((Object)(object)component.skillChangeResponses[i].triggerSkillFamily != (Object)null)
				{
					list.Add(component.skillChangeResponses[i]);
				}
			}
			component.skillChangeResponses = list.ToArray();
		}
	}
}
namespace OpmMod.Modules.Characters
{
	internal class OpmItemDisplays : ItemDisplaysBase
	{
		protected override void SetItemDisplayRules(List<KeyAssetRuleGroup> itemDisplayRules)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: 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_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: 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)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Unknown result type (might be due to invalid IL or missing references)
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0512: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0532: Unknown result type (might be due to invalid IL or missing references)
			//IL_0548: Unknown result type (might be due to invalid IL or missing references)
			//IL_054d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_055a: Unknown result type (might be due to invalid IL or missing references)
			//IL_055b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_056b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_060f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0614: Unknown result type (might be due to invalid IL or missing references)
			//IL_061c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_0622: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Unknown result type (might be due to invalid IL or missing references)
			//IL_062d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0632: Unknown result type (might be due to invalid IL or missing references)
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_0664: Unknown result type (might be due to invalid IL or missing references)
			//IL_066d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a5: Unknown result type (might be due to inval