Decompiled source of RWBY Yang v1.0.0

Yang.dll

Decompiled 5 days ago
using System;
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 EntityStates;
using EntityStates.FlyingVermin.Mode;
using EntityStates.Merc;
using IL.RoR2;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Navigation;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
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.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Yang")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Yang")]
[assembly: AssemblyTitle("Yang")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Yang;

internal class Assets
{
	public static AssetBundle MainAssetBundle;

	public static T Load<T>(string name) where T : Object
	{
		return MainAssetBundle.LoadAsset<T>(name);
	}

	public static void PopulateAssets()
	{
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using Stream stream = executingAssembly.GetManifestResourceStream("Yang.AssetBundle.yangassets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Yang.RWBY_Yang.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class Behaviour : MonoBehaviour
{
	private CharacterBody body;

	private CharacterModel model;

	private bool init;

	public Material hairMat;

	private float stopwatch;

	private int buffCount;

	public float lerpSpeed = 2f;

	public float baseEmPower = 1f;

	public float maxEmPower = 2.5f;

	public float emPowerPerStack = 0.1f;

	public float dodgeSpeed = 55f;

	public float rootSpeed = 10f;

	public float rootSpeedFast = 18f;

	public float uppercutSpeed = 30f;

	public float attackDur = 0.6f;

	public float fastAttackDur = 0.7f;

	public float finisherDur = 1f;

	public float upForce = 1000f;

	public float uppercutForce = 23f;

	public float crossfadeDuration = 0.15f;

	public float upSpeed = 70f;

	public float speedPenalty = 0.7f;

	public float slamDuration = 0.65f;

	public Vector3 bonusForce = Vector3.up * 10f;

	private ParticleSystem idleEffect;

	public float spinDur = 0.7f;

	public float emPower => (buffCount == 0) ? 0f : ((buffCount >= 5) ? maxEmPower : baseEmPower);

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
		model = ((Component)body.modelLocator.modelTransform).GetComponent<CharacterModel>();
		idleEffect = ((Component)((Component)model).GetComponent<ChildLocator>().FindChild("IdleEffect")).GetComponent<ParticleSystem>();
	}

	private void Start()
	{
	}

	private void FixedUpdate()
	{
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		if (!init && model.baseRendererInfos.Length != 0)
		{
			init = true;
			hairMat = new Material(model.baseRendererInfos[1].defaultMaterial);
			model.baseRendererInfos[1].defaultMaterial = hairMat;
		}
		if (init && (Object)(object)model.baseRendererInfos[1].defaultMaterial != (Object)(object)hairMat)
		{
			model.baseRendererInfos[1].defaultMaterial = hairMat;
		}
		if (!Object.op_Implicit((Object)(object)hairMat))
		{
			return;
		}
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= 0.1f)
		{
			stopwatch = 0f;
			buffCount = body.GetBuffCount(Prefabs.passiveBuff);
			if (buffCount == 0)
			{
				int num = body.GetBuffCount(Prefabs.shellBuff);
				if (num > 0)
				{
					for (int i = 0; i < num; i++)
					{
						body.RemoveBuff(Prefabs.shellBuff);
					}
				}
			}
		}
		if (buffCount > 0)
		{
			if (!idleEffect.isPlaying)
			{
				idleEffect.Play();
			}
		}
		else if (idleEffect.isPlaying)
		{
			idleEffect.Stop();
		}
		hairMat.SetFloat("_EmPower", Mathf.Lerp(hairMat.GetFloat("_EmPower"), emPower, Time.fixedDeltaTime * lerpSpeed));
	}

	private void OnDisable()
	{
		if (Object.op_Implicit((Object)(object)hairMat))
		{
			Object.Destroy((Object)(object)hairMat);
		}
	}
}
internal class ModelBehaviour : MonoBehaviour
{
	private ChildLocator childLocator;

	private CharacterModel model;

	private Material hairMat;

	public float effectRadius = 1f;

	private uint ID;

	private void Awake()
	{
		childLocator = ((Component)this).GetComponent<ChildLocator>();
		model = ((Component)this).GetComponent<CharacterModel>();
	}

	private void OnEnable()
	{
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Expected O, but got Unknown
		TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)model).gameObject);
		val.originalMaterial = Prefabs.outlineOverlay;
		val.AddToCharacterModel(model);
		if (!Object.op_Implicit((Object)(object)Run.instance))
		{
			ID = AkSoundEngine.PostEvent("Play_RWBY_Yang_Theme", ((Component)this).gameObject);
			MusicController.LateUpdate += new Manipulator(MusicController_LateUpdate);
		}
	}

	private void MusicController_LateUpdate(ILContext il)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		ILCursor val = new ILCursor(il);
		int num = default(int);
		val.GotoNext(new Func<Instruction, bool>[1]
		{
			(Instruction i) => ILPatternMatchingExt.MatchStloc(i, ref num)
		});
		val.EmitDelegate<Func<bool, bool>>((Func<bool, bool>)((bool b) => true));
	}

	private void Update()
	{
	}

	public void Effect()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0063: 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_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Expected O, but got Unknown
		((Behaviour)model).enabled = false;
		Renderer renderer = model.baseRendererInfos[1].renderer;
		hairMat = new Material(renderer.material);
		renderer.material = hairMat;
		hairMat.SetFloat("_EmPower", 1f);
		EffectManager.SpawnEffect(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab"), new EffectData
		{
			origin = childLocator.FindChild("handMuzzleL").position,
			scale = effectRadius
		}, false);
		AkSoundEngine.PostEvent("Play_RWBY_Yang_Shotgun_DualFire", ((Component)this).gameObject);
	}

	private void OnDisable()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)(object)Run.instance))
		{
			MusicController.LateUpdate -= new Manipulator(MusicController_LateUpdate);
		}
		if (Object.op_Implicit((Object)(object)hairMat))
		{
			Object.Destroy((Object)(object)hairMat);
		}
	}
}
internal class ParticleCount : MonoBehaviour
{
	public ParticleSystem particle;

	public short particleCount;

	public void OnEnable()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
		particle.Stop();
		EmissionModule emission = particle.emission;
		Burst val = default(Burst);
		((Burst)(ref val)).count = MinMaxCurve.op_Implicit(1f);
		((Burst)(ref val)).minCount = particleCount;
		((Burst)(ref val)).maxCount = particleCount;
		((EmissionModule)(ref emission)).SetBurst(0, val);
		emission = particle.emission;
		Burst burst = ((EmissionModule)(ref emission)).GetBurst(0);
		Debug.LogWarning((object)((Burst)(ref burst)).maxCount);
		((Burst)(ref burst)).minCount = particleCount;
		((Burst)(ref burst)).maxCount = particleCount;
		emission = particle.emission;
		((EmissionModule)(ref emission)).SetBurst(0, burst);
		emission = particle.emission;
		val = ((EmissionModule)(ref emission)).GetBurst(0);
		Debug.LogWarning((object)((Burst)(ref val)).maxCount);
		particle.Play();
	}
}
internal class CharacterBodySetup
{
	internal const bool melee = true;

	internal static GameObject baseBody = Prefabs.Load<GameObject>("RoR2/Base/Merc/MercBody.prefab");

	internal static GameObject baseMaster;

	internal const string SURVIVORNAME = "Yang";

	internal const string SURVIVORNAMEKEY = "RWBYYANG_";

	internal static void CreateCharacterBodies()
	{
		RegisterStates();
		CreateSurvivorPrefab();
	}

	internal static void CreateSurvivorPrefab()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = CreateBodyPrefab("Yang", Color32.op_Implicit(new Color32((byte)253, (byte)232, (byte)122, byte.MaxValue)), 100f);
		val.AddComponent<Behaviour>();
		CharacterBody component = val.GetComponent<CharacterBody>();
		component.mainRootSpeed = 0f;
		component.baseMaxHealth = 160f;
		component.levelMaxHealth = 48f;
		component.baseRegen = 2.5f;
		component.levelRegen = 0.5f;
		component.baseMaxShield = 0f;
		component.levelMaxShield = 0f;
		component.baseMoveSpeed = 7f;
		component.levelMoveSpeed = 0f;
		component.baseAcceleration = 110f;
		component.baseJumpPower = 15f;
		component.levelJumpPower = 0f;
		component.baseDamage = 12f;
		component.levelDamage = 2.4f;
		component.baseAttackSpeed = 1f;
		component.levelAttackSpeed = 0f;
		component.baseCrit = 1f;
		component.levelCrit = 0f;
		component.baseArmor = 20f;
		component.levelArmor = 0f;
		component.baseJumpCount = 1;
		component.sprintingSpeedMultiplier = 1.45f;
		val.GetComponent<HealthComponent>().health = component.baseMaxHealth;
		CreateSurvivorDef(val);
		PassiveSetup(val);
		PrimarySetup(val);
		SecondarySetup(val);
		UtilitySetup(val);
		SpecialSetup(val);
	}

	internal static void CreateSurvivorDef(GameObject characterPrefab)
	{
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		CharacterBody component = characterPrefab.GetComponent<CharacterBody>();
		string text = ((Object)characterPrefab).name.Replace("Body", "");
		string text2 = text.Replace(" ", "").ToUpper();
		string text3 = " <style=cSub>\r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n";
		string text4 = "..and so she left.";
		string text5 = "..and so she vanished.";
		string text6 = "";
		LanguageAPI.Add("RWBYYANG_" + text2 + "_DESCRIPTION", text3);
		LanguageAPI.Add("RWBYYANG_" + text2 + "_SUBTITLE", "Small Dragon of the Sunshine");
		LanguageAPI.Add("RWBYYANG_" + text2 + "_OUTRO", text4);
		LanguageAPI.Add("RWBYYANG_" + text2 + "_FAIL", text5);
		GameObject val = PrefabAPI.InstantiateClone(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, text + "Display", false);
		Animator componentInChildren = val.GetComponentInChildren<Animator>();
		componentInChildren.runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator");
		Object.Destroy((Object)(object)((Component)componentInChildren).GetComponent<HurtBoxGroup>());
		SurvivorDef val2 = ScriptableObject.CreateInstance<SurvivorDef>();
		val2.cachedName = "RWBYYANG_" + text2 + "_NAME";
		val2.unlockableDef = null;
		val2.descriptionToken = "RWBYYANG_" + text2 + "_DESCRIPTION";
		val2.primaryColor = component.bodyColor;
		val2.bodyPrefab = characterPrefab;
		val2.displayPrefab = val;
		val2.outroFlavorToken = "RWBYYANG_" + text2 + "_OUTRO";
		val2.desiredSortPosition = 22f;
		val2.mainEndingEscapeFailureFlavorToken = "RWBYYANG_" + text2 + "_FAIL";
		ContentAddition.AddSurvivorDef(val2);
		GameObject val3 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Merc/MercMonsterMaster.prefab"), text + "Master", true);
		ContentAddition.AddMaster(val3);
		CharacterMaster component2 = val3.GetComponent<CharacterMaster>();
		component2.bodyPrefab = characterPrefab;
	}

	internal static void RegisterStates()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<SpecialFire>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BaseYangState>(ref flag);
	}

	internal static void PassiveSetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("RWBYYANG__PASSIVE_NAME", "Semblance: Burn");
		LanguageAPI.Add("RWBYYANG__PASSIVE_DESCRIPTION", "Gain a stacking buff when receiving damage that grants <style=cIsDamage>25% damage</style> and <style=cIsHealing>regen</style> equal to <style=cIsHealing>2% health</style> per stack.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "RWBYYANG__PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "RWBYYANG__PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
	}

	internal static void PrimarySetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_M1";
		LanguageAPI.Add("RWBYYANG_" + text, "Ember Celica");
		LanguageAPI.Add("RWBYYANG_" + text + "_DESCRIPTION", "Perform a punch combo for <style=cIsDamage>4x250% damage</style>, finishing with a double punch for <style=cIsDamage>350% damage</style>. Semblance stacks grant <style=cIsDamage>Blast Wave</style>, which fires a blast of pellets on every attack that deal <style=cIsDamage>4x</style> <style=cStack>(+1 per stack)</style> <style=cIsDamage>25% damage</style>, for up to <style=cIsDamage>5</style> shots. Reloads on finisher attacks.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "RWBYYANG_" + text, "RWBYYANG_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	internal static void SecondarySetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_M2";
		LanguageAPI.Add("RWBYYANG_" + text, "Sunbreak");
		LanguageAPI.Add("RWBYYANG_" + text + "_DESCRIPTION", "Perform a spin attack upwards, dealing <style=cIsDamage>400% damage</style>, knocking enemies upwards. If you hit an enemy, perform an overhead hammerfist in front, <style=cIsDamage>knocking down</style> enemies for <style=cIsDamage>300% damage</style> and <style=cIsHealth>negating</style> their <style=cIsDamage>armor</style>, <style=cIsHealing>shield</style> and <style=cIsHealing>barrier</style> for <style=cIsUtility>3s</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "RWBYYANG_" + text, "RWBYYANG_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	internal static void UtilitySetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_UTIL";
		LanguageAPI.Add("RWBYYANG_" + text, "Dodge");
		LanguageAPI.Add("RWBYYANG_" + text + "_DESCRIPTION", "Quickly dash forward, becoming <style=cIsHealing>untargetable</style> for the duration.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Dash", 2, 3f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "RWBYYANG_" + text, "RWBYYANG_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	internal static void SpecialSetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_SPEC";
		LanguageAPI.Add("RWBYYANG_" + text, "Quake");
		LanguageAPI.Add("RWBYYANG_" + text + "_DESCRIPTION", "<style=cIsDamage>Stunning</style>. Slam the ground, dealing <style=cIsDamage>1000% damage</style> to nearby enemies, gaining <style=cIsDamage>Semblance</style> stacks <style=cIsDamage>on kill</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Body", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "RWBYYANG_" + text, "RWBYYANG_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}

	internal static GameObject CreateBodyPrefab(string characterName, Color bodyColor, float mass, bool large = false, bool flying = false)
	{
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Expected O, but got Unknown
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: 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_0142: Expected O, but got Unknown
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: 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_0331: 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_0363: Unknown result type (might be due to invalid IL or missing references)
		//IL_0368: Unknown result type (might be due to invalid IL or missing references)
		//IL_0409: Unknown result type (might be due to invalid IL or missing references)
		//IL_0429: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0538: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0609: Unknown result type (might be due to invalid IL or missing references)
		//IL_060e: Unknown result type (might be due to invalid IL or missing references)
		//IL_077e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0783: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
		string text = characterName.Replace(" ", "");
		string text2 = text.ToUpper();
		LanguageAPI.Add("RWBYYANG_" + text2 + "_NAME", "Yang Xiao Long");
		GameObject val = PrefabAPI.InstantiateClone(baseBody, text + "Body", true);
		val.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		Object.Destroy((Object)(object)((Component)val.transform.Find("ModelBase")).gameObject);
		Object.Destroy((Object)(object)((Component)val.transform.Find("CameraPivot")).gameObject);
		Object.Destroy((Object)(object)((Component)val.transform.Find("AimOrigin")).gameObject);
		GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>(text + "Mdl");
		val2.AddComponent<AnimationEvents>().soundCenter = val2;
		val2.AddComponent<ModelBehaviour>();
		GameObject val3 = new GameObject("ModelBase");
		val3.transform.parent = val.transform;
		val3.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = Vector3.one;
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val3.transform;
		val4.transform.localPosition = new Vector3(0f, 1.4f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val3.transform;
		transform.localPosition = Vector3.zero;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = val.GetComponent<CharacterDirection>();
		component.targetTransform = val3.transform;
		component.modelAnimator = val2.GetComponentInChildren<Animator>();
		component.turnSpeed = 720f;
		CharacterBody component2 = val.GetComponent<CharacterBody>();
		((Object)component2).name = text + "Body";
		component2.baseNameToken = "RWBYYANG_" + text2 + "_NAME";
		component2.subtitleNameToken = "RWBYYANG_" + text2 + "_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.aimOriginTransform = val4.transform;
		component2.hullClassification = (HullClassification)(large ? 1 : 0);
		Sprite val5 = Assets.MainAssetBundle.LoadAsset<Sprite>(text);
		component2.portraitIcon = (Texture)(object)(Object.op_Implicit((Object)(object)val5) ? val5.texture : null);
		component2.isChampion = false;
		component2.currentVehicle = null;
		component2.skinIndex = 0u;
		component2.bodyColor = bodyColor;
		HealthComponent component3 = val.GetComponent<HealthComponent>();
		component3.health = component2.baseMaxHealth;
		component3.shield = 0f;
		component3.barrier = 0f;
		CharacterMotor component4 = val.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component;
		component4.muteWalkMotion = false;
		component4.mass = mass;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = val.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		CameraTargetParams component6 = val.GetComponent<CameraTargetParams>();
		component6.cameraParams = baseBody.GetComponent<CameraTargetParams>().cameraParams;
		component6.cameraPivotTransform = null;
		component6.recoil = Vector2.zero;
		component6.dontRaycastToPivot = false;
		ModelLocator component7 = val.GetComponent<ModelLocator>();
		component7.modelTransform = transform;
		component7.modelBaseTransform = val3.transform;
		component7.dontReleaseModelOnDeath = false;
		component7.autoUpdateModelTransform = true;
		component7.dontDetatchFromParent = false;
		component7.noCorpse = false;
		component7.normalizeToFloor = false;
		component7.preserveModel = false;
		ChildLocator component8 = val2.GetComponent<ChildLocator>();
		CharacterModel val6 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val7 in componentsInChildren)
		{
			((Renderer)val7).material = Prefabs.InstantiateDefaultSurvivorMaterial(((Renderer)val7).material);
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val7,
				defaultMaterial = ((Renderer)val7).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
		}
		RendererInfo[] array = list.ToArray();
		val6.body = component2;
		val6.baseRendererInfos = array;
		val6.autoPopulateLightInfos = true;
		val6.temporaryOverlays = new List<TemporaryOverlayInstance>();
		val6.mainSkinnedMeshRenderer = componentsInChildren[0];
		LanguageAPI.Add(text2 + "BODY_DEFAULT_SKIN_NAME", "Default");
		ModelSkinController val8 = val2.AddComponent<ModelSkinController>();
		val8.skins = (SkinDef[])(object)new SkinDef[1] { Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_DEFAULT_SKIN_NAME", array)) };
		Collider[] componentsInChildren2 = val2.GetComponentsInChildren<Collider>();
		HurtBoxGroup val9 = val2.AddComponent<HurtBoxGroup>();
		List<HurtBox> list2 = new List<HurtBox>();
		Collider[] array2 = componentsInChildren2;
		foreach (Collider val10 in array2)
		{
			HurtBox val11 = ((Component)val10).gameObject.AddComponent<HurtBox>();
			((Component)val11).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val11.healthComponent = component3;
			val11.isBullseye = true;
			val11.damageModifier = (DamageModifier)0;
			val11.hurtBoxGroup = val9;
			val11.indexInGroup = 0;
			val9.mainHurtBox = val11;
			val9.bullseyeCount = 1;
			list2.Add(val11);
		}
		val9.hurtBoxes = list2.ToArray();
		Utils.CreateHitbox("Punch", val2.transform, new Vector3(5f, 5.5f, 8f), new Vector3(0f, 1f, 3f));
		Utils.CreateHitbox("Uppercut", val2.transform, new Vector3(6.5f, 8.5f, 6.5f), new Vector3(0f, 1f, 0f)).transform.localRotation = Quaternion.Euler(Vector3.up * 45f);
		KinematicCharacterMotor component9 = val.GetComponent<KinematicCharacterMotor>();
		component9.CharacterController = (ICharacterController)(object)component4;
		component9.playerCharacter = true;
		val.GetComponent<Interactor>().maxInteractionDistance = 3f;
		val.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component10 = val.GetComponent<SfxLocator>();
		component10.deathSound = "Play_ui_player_death";
		component10.barkSound = "";
		component10.openSound = "";
		component10.landingSound = (large ? "Play_gravekeeper_land" : "Play_char_land");
		component10.fallDamageSound = "Play_char_land_fall_damage";
		component10.aliveLoopStart = "";
		component10.aliveLoopStop = "";
		val.GetComponent<Rigidbody>().mass = mass;
		FootstepHandler val12 = val2.AddComponent<FootstepHandler>();
		val12.baseFootstepString = (large ? "Play_beetle_queen_step" : "Play_player_footstep");
		val12.sprintFootstepOverrideString = "";
		val12.enableFootstepDust = true;
		val12.footstepDustPrefab = Prefabs.Load<GameObject>(large ? "RoR2/Base/Common/VFX/GenericHugeFootstepDust.prefab" : "RoR2/Base/Common/VFX/GenericFootstepDust.prefab");
		GenericSkill[] componentsInChildren3 = val.GetComponentsInChildren<GenericSkill>();
		foreach (GenericSkill val13 in componentsInChildren3)
		{
			Object.DestroyImmediate((Object)(object)val13);
		}
		if (flying)
		{
			Utils.NewStateMachine<GrantFlight>(val, "Flight");
			component10.landingSound = "";
			component10.fallDamageSound = "";
		}
		EntityStateMachine component11 = ((Component)component2).GetComponent<EntityStateMachine>();
		component11.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component12 = val.GetComponent<CharacterDeathBehavior>();
		component12.deathStateMachine = val.GetComponent<EntityStateMachine>();
		component12.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath));
		Utils.NewStateMachine<Idle>(val, "Dash");
		NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component13.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(val);
		return val;
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
		HealthComponent.AddBarrier += new hook_AddBarrier(HealthComponent_AddBarrier);
	}

	private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Invalid comparison between Unknown and I4
		if ((int)damageReport.damageInfo.damageType.damageSource != 8 || !Object.op_Implicit((Object)(object)damageReport.attackerBody) || !Object.op_Implicit((Object)(object)((Component)damageReport.attackerBody).GetComponent<Behaviour>()))
		{
			return;
		}
		if (!damageReport.attackerBody.HasBuff(Prefabs.passiveBuff) && damageReport.attackerBody.GetBuffCount(Prefabs.shellBuff) == 0)
		{
			for (int i = 0; i < 10; i++)
			{
				damageReport.attackerBody.AddBuff(Prefabs.shellBuff);
			}
		}
		damageReport.attackerBody.AddTimedBuff(Prefabs.passiveBuff, 12f);
	}

	private static void HealthComponent_AddBarrier(orig_AddBarrier orig, HealthComponent self, float value)
	{
		if (self.body.HasBuff(Prefabs.armorBreak))
		{
			value = 0f;
		}
		orig.Invoke(self, value);
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		int buffCount = sender.GetBuffCount(Prefabs.passiveBuff);
		if (buffCount > 0)
		{
			args.damageMultAdd += 0.25f * (float)buffCount;
			args.baseRegenAdd += sender.healthComponent.fullHealth * 0.02f * (float)buffCount;
		}
		if (sender.HasBuff(Prefabs.armorBreak))
		{
			args.armorAdd -= sender.armor;
			args.baseShieldAdd -= sender.healthComponent.fullShield;
		}
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_0099: 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_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)damageReport.victimBody))
		{
			return;
		}
		if (Object.op_Implicit((Object)(object)((Component)damageReport.victimBody).GetComponent<Behaviour>()))
		{
			if (!damageReport.victimBody.HasBuff(Prefabs.passiveBuff) && damageReport.victimBody.GetBuffCount(Prefabs.shellBuff) == 0)
			{
				for (int i = 0; i < 5; i++)
				{
					damageReport.victimBody.AddBuff(Prefabs.shellBuff);
				}
			}
			damageReport.victimBody.AddTimedBuff(Prefabs.passiveBuff, 12f);
		}
		if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.armorBreakDMG))
		{
			damageReport.victimBody.AddTimedBuff(Prefabs.armorBreak, 3f);
			damageReport.victimBody.healthComponent.SetBarrier(0f);
			damageReport.victimBody.healthComponent.Networkshield = 0f;
		}
		if (!DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.uppercut))
		{
			return;
		}
		float num = 0f;
		if (Object.op_Implicit((Object)(object)damageReport.victimBody.characterMotor))
		{
			num = damageReport.victimBody.characterMotor.mass;
		}
		else
		{
			RigidbodyMotor component = ((Component)damageReport.victimBody).GetComponent<RigidbodyMotor>();
			if (Object.op_Implicit((Object)(object)component))
			{
				num = component.mass;
			}
		}
		if (num > 0f)
		{
			damageReport.victimBody.healthComponent.TakeDamageForce(Vector3.up * damageReport.attacker.GetComponent<Behaviour>().uppercutForce * num, true, true);
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.RWBYYang", "RWBYYang", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.RWBYYang";

	public const string MODNAME = "RWBYYang";

	public const string VERSION = "1.0.0";

	internal const string MODKEY = "RWBYYANG_";

	private void Awake()
	{
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		CharacterBodySetup.CreateCharacterBodies();
		Hook.Hooks();
	}
}
internal class Prefabs
{
	internal static GameObject punchHit;

	internal static GameObject punchHitHeavy;

	internal static GameObject punchHitFiery;

	internal static GameObject shotgunMuzzle;

	internal static GameObject shotgunTracer;

	internal static GameObject swingEffect;

	internal static GameObject swingEffectEmp;

	internal static GameObject spinEffect;

	internal static GameObject dashEffect;

	internal static BuffDef passiveBuff;

	internal static BuffDef shellBuff;

	internal static BuffDef armorBreak;

	internal static ModdedDamageType uppercut;

	internal static ModdedDamageType armorBreakDMG;

	internal static Material outlineOverlay;

	internal static Material baseMaterial = Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat");

	internal static void CreatePrefabs()
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Expected O, but got Unknown
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Expected O, but got Unknown
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0285: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Expected O, but got Unknown
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Expected O, but got Unknown
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_034d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_0372: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		Texture2D val = Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampDefault.png");
		swingEffect = Instantiate("RoR2/Base/Loader/LoaderSwingBasic.prefab", "SwingEffect");
		ParticleSystemRenderer componentInChildren = swingEffect.GetComponentInChildren<ParticleSystemRenderer>();
		((Renderer)componentInChildren).material = new Material(((Renderer)componentInChildren).material);
		((Renderer)componentInChildren).material.SetTexture("_RemapTex", (Texture)(object)val);
		swingEffectEmp = Instantiate(swingEffect, "SwingEffectEmpowered");
		componentInChildren = swingEffectEmp.GetComponentInChildren<ParticleSystemRenderer>();
		((Renderer)componentInChildren).material = new Material(((Renderer)componentInChildren).material);
		((Renderer)componentInChildren).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampCaptainAirstrike.png"));
		shotgunMuzzle = Instantiate(Assets.Load<GameObject>("ShotgunMuzzleflash"), "ShotgunMuzzleflash");
		Utils.RegisterEffect(shotgunMuzzle, 0.5f);
		spinEffect = Instantiate(Assets.Load<GameObject>("SpinEffect"), "SpinEffect");
		Utils.RegisterEffect(spinEffect, 1f);
		dashEffect = Instantiate(Assets.Load<GameObject>("DashEffect"), "DashEffect");
		Utils.RegisterEffect(dashEffect, 0.65f);
		punchHit = Instantiate("RoR2/Base/Loader/OmniImpactVFXLoader.prefab", "PunchHit");
		ParticleSystemRenderer[] componentsInChildren = punchHit.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val2 in componentsInChildren)
		{
			Material val4 = (((Renderer)val2).material = new Material(((Renderer)val2).material));
			val4.SetColor("_TintColor", Color.white);
			val4.DisableKeyword("VERTEXCOLOR");
			val4.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampGenericBluetint.png"));
		}
		Utils.RegisterEffect(punchHit, -1f, "Play_RWBY_Yang_Hit");
		punchHitHeavy = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFXMedium.prefab", "PunchHitHeavy");
		Utils.RegisterEffect(punchHitHeavy, -1f, "Play_RWBY_Yang_Hit_Special");
		punchHitFiery = Instantiate("RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab", "PunchHitFiery");
		Utils.RegisterEffect(punchHitFiery, -1f, "Play_RWBY_Yang_Hit_Fire");
		shotgunTracer = Instantiate("RoR2/Base/Commando/TracerCommandoShotgun.prefab", "ShotgunTracer");
		Tracer component = shotgunTracer.GetComponent<Tracer>();
		component.speed = 120f;
		component.beamDensity = 7f;
		component.length = 6f;
		LineRenderer component2 = shotgunTracer.GetComponent<LineRenderer>();
		((Renderer)component2).material = new Material(((Renderer)component2).material);
		((Renderer)component2).material.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)122, (byte)0, byte.MaxValue)));
		ContentAddition.AddEffect(shotgunTracer);
		outlineOverlay = new Material(Load<Material>("RoR2/Base/Common/matEnergyShield.mat"));
		outlineOverlay.SetColor("_TintColor", Color.black);
		outlineOverlay.SetFloat("_SrcBlend", 0f);
		outlineOverlay.SetFloat("_DstBlend", 0f);
		outlineOverlay.SetFloat("_OffsetAmount", 0.006f);
		passiveBuff = Utils.NewBuffDef("Semblance", stack: true, hidden: false, Assets.Load<Sprite>("passiveBuff"), Color32.op_Implicit(new Color32((byte)253, (byte)232, (byte)122, byte.MaxValue)));
		shellBuff = Utils.NewBuffDef("Shell", stack: true, hidden: false, Assets.Load<Sprite>("shellBuff"), Color.white);
		armorBreak = Utils.NewBuffDef("Shell", stack: false, hidden: false, Assets.Load<Sprite>("armorBreakBuff"), Color.white);
		armorBreak.isDebuff = true;
		uppercut = DamageAPI.ReserveDamageType();
		armorBreakDMG = DamageAPI.ReserveDamageType();
	}

	internal static T Load<T>(string path)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
	}

	internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
	}

	public static Material InstantiateDefaultSurvivorMaterial(Material material)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_0020: 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)
		Material val = new Material(baseMaterial);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", Color.white);
			val.SetTexture("_MainTex", material.mainTexture);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", (Texture)null);
			val.SetColor("_EmColor", Color.white);
			val.SetFloat("_EmPower", 0f);
			val.SetTexture("_EmTex", material.HasTexture("_EmissionMap") ? material.GetTexture("_EmissionMap") : null);
			val.SetFloat("_Cull ", 0f);
			return val;
		}
		return val;
	}

	public static Material InstantiateDefaultSurvivorMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		Material val = new Material(baseMaterial);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", color);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", emColor);
			val.SetFloat("_EmPower", emPower);
			val.SetTexture("_EmTex", emTex);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", normTex);
			return val;
		}
		return val;
	}
}
internal class BasicMeleeSkillState : BaseSkillState
{
	private float duration = 0.2f;

	private Vector3 dir;

	private OverlapAttack attack;

	private float damageCoefficient = 4.2f;

	private GameObject hitEffectPrefab = null;

	private bool parried;

	public Animator animator;

	private uint ID;

	private string hitboxGroupName = "";

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		animator = ((EntityState)this).GetModelAnimator();
		if (!animator.GetBool("slide"))
		{
			((BaseState)this).StartAimMode(1f, true);
		}
		((EntityState)this).PlayAnimation("LeftArm, Override", "MeleeAttack");
		AkSoundEngine.PostEvent(ID, ((EntityState)this).gameObject);
		attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			attack.Fire((List<HurtBox>)null);
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class CharacterMain : GenericCharacterMain
{
}
internal class BaseYangState : BaseSkillState
{
	public Behaviour behaviour;

	public Animator animator;

	private bool hasFired;

	private AimRequest request;

	public bool fire => animator.GetFloat("Curve") >= 0.11f;

	public void ZoomOut()
	{
		request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
	}

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
		animator = ((EntityState)this).GetModelAnimator();
	}

	public virtual void OnFire()
	{
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (!hasFired && fire)
		{
			hasFired = true;
			OnFire();
		}
	}

	public override void OnExit()
	{
		if (!hasFired)
		{
			OnFire();
		}
		if (request != null)
		{
			request.Dispose();
		}
		((EntityState)this).OnExit();
	}
}
internal class MeleeSkillState : BaseYangState
{
	public float attackDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public new Animator animator;

	public int attackIndex = 1;

	private GameObject swingEffectInstance;

	public virtual float baseAttackDuration => 0f;

	public virtual float earlyExitDurationPercentage => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

	public virtual string layerName => "Gesture, Override";

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => "";

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => "";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual string swingSound => "";

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public virtual bool crossfade => false;

	public virtual bool scaleSwingEffectSpeed => false;

	public virtual bool finisher => attackIndex == 2;

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

	public override void OnDeserialize(NetworkReader reader)
	{
		((BaseSkillState)this).OnDeserialize(reader);
		attackIndex = reader.ReadInt32();
	}

	public override void OnEnter()
	{
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f);
		attackDuration = baseAttackDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		overlapAttack.damageType = DamageTypeCombo.op_Implicit(damageType);
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			if (crossfade)
			{
				((EntityState)this).PlayAnimation("Additive, Override", animationStateName, animParameter, attackDuration, 0f);
				((EntityState)this).PlayCrossfade(layerName, animationStateName, animParameter, attackDuration, behaviour.crossfadeDuration);
			}
			else
			{
				((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f);
			}
		}
	}

	public virtual Vector3 rootMotionDirection()
	{
		//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 ((EntityState)this).characterDirection.forward;
	}

	public override void FixedUpdate()
	{
		//IL_0030: 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_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit = flag || hasHit;
			if (hasHit)
			{
				if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
					hopped = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause)
			{
				Vector3 val = rootMotionDirection();
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val * rootMotionSpeed * Time.fixedDeltaTime;
			}
			if (hitPauseTimer >= hitPauseDuration && isInHitPause)
			{
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration * earlyExitDurationPercentage)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val2 = StateOverride();
					if (val2 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val2);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (!base.fire || hasSwung)
		{
			return;
		}
		hasSwung = true;
		AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
		if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
		{
			if (scaleSwingEffectSpeed)
			{
				SpawnSwingEffect(swingMuzzle);
			}
			else
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
		}
		float num = 4.2f;
		((BaseState)this).AddRecoil(-0.1f * num, 0.1f * num, -1f * num, 1f * num);
	}

	public void SpawnSwingEffect(string muzzle)
	{
		//IL_0011: 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)
		Transform val = ((BaseState)this).FindModelChild(muzzle);
		swingEffectInstance = Object.Instantiate<GameObject>(swingEffectPrefab, val.position, val.rotation, val);
		ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>();
		component.initialDuration = attackDuration;
		component._newDuration = attackDuration;
	}

	public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
	{
		//IL_0042: 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_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: 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)
		bool result = false;
		if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f)
		{
			attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward) * forceMagnitude + bonusForce;
			result = attack.Fire((List<HurtBox>)null);
		}
		return result;
	}

	public override void OnExit()
	{
		if (Object.op_Implicit((Object)(object)swingEffectInstance))
		{
			EntityState.Destroy((Object)(object)swingEffectInstance);
		}
		base.OnExit();
	}

	public virtual void SetState()
	{
	}

	public virtual BaseSkillState StateOverride()
	{
		return null;
	}

	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;
	}
}
internal class Primary : MeleeSkillState
{
	private GameObject muzzlePrefab = Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab");

	private int buffCount;

	public override float baseAttackDuration => finisher ? behaviour.finisherDur : ((attackIndex >= 3) ? behaviour.fastAttackDur : behaviour.attackDur);

	public override float earlyExitDurationPercentage => 0.9f;

	public override string layerName => "FullBody, Override";

	public override string animationStateName => "Attack" + attackIndex + ((!((BaseState)this).isGrounded) ? "Air" : "");

	public override string animParameter => "M1";

	public override string hitBoxGroupName => "Punch";

	public override float forceMagnitude => 1000f;

	public override float damageCoefficient => finisher ? 3.5f : 2.8f;

	public override string swingSound => finisher ? "Play_RWBY_Yang_Big_Swing" : "Play_RWBY_Yang_Swing";

	public override float baseHopVelocity => 6f;

	public override GameObject hitEffectPrefab => ((EntityState)this).characterBody.HasBuff(Prefabs.passiveBuff) ? Prefabs.punchHitFiery : (finisher ? Prefabs.punchHitHeavy : Prefabs.punchHit);

	public override string swingMuzzle => (attackIndex % 2 == 0) ? "swingMuzzleL" : "swingMuzzleR";

	public override bool crossfade => true;

	public override GameObject swingEffectPrefab => (buffCount > 0) ? Prefabs.swingEffectEmp : Prefabs.swingEffect;

	public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary);

	public override bool rootMotion => true;

	public override float rootMotionSpeed => (attackIndex >= 3) ? behaviour.rootSpeedFast : behaviour.rootSpeed;

	public override bool rootMotionWhileHitting => true;

	public override bool finisher => attackIndex == 5;

	public override bool scaleSwingEffectSpeed => true;

	public override Vector3 rootMotionDirection()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		Ray aimRay = ((BaseState)this).GetAimRay();
		return ((Ray)(ref aimRay)).direction;
	}

	public override void OnEnter()
	{
		base.OnEnter();
		((BaseState)this).StartAimMode(attackDuration, false);
		((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = behaviour.speedPenalty;
		buffCount = ((EntityState)this).characterBody.GetBuffCount(Prefabs.passiveBuff);
	}

	public override void OnFire()
	{
		buffCount = ((EntityState)this).characterBody.GetBuffCount(Prefabs.passiveBuff);
		if (buffCount > 0)
		{
			if (finisher)
			{
				FireBlast("hand.r", buffCount);
				FireBlast("hand.l", buffCount);
			}
			else
			{
				string muzzle = ((attackIndex % 2 == 0) ? "hand.l" : "hand.r");
				FireBlast(muzzle, buffCount);
			}
		}
		if (finisher)
		{
			SpawnSwingEffect("swingMuzzleL");
		}
	}

	private void FireBlast(string muzzle, int bulletCount)
	{
		//IL_0063: 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_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		AkSoundEngine.PostEvent(finisher ? "Play_RWBY_Yang_Shotgun_DualFire" : "Play_RWBY_Yang_Shotgun_Fire", ((EntityState)this).gameObject);
		int bulletCount2 = 4 + bulletCount;
		EffectManager.SimpleMuzzleFlash(Prefabs.shotgunMuzzle, ((EntityState)this).gameObject, muzzle, false);
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.RemoveBuff(Prefabs.shellBuff);
		}
		if (((EntityState)this).isAuthority)
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			new BulletAttack
			{
				owner = ((EntityState)this).gameObject,
				muzzleName = muzzle,
				damage = ((BaseState)this).damageStat * 0.25f,
				bulletCount = (uint)bulletCount2,
				falloffModel = (FalloffModel)0,
				maxDistance = 13f,
				origin = ((BaseState)this).FindModelChild(muzzle).position,
				aimVector = ((Ray)(ref aimRay)).direction,
				isCrit = ((BaseState)this).RollCrit(),
				minSpread = 6f,
				maxSpread = 12f,
				smartCollision = false,
				radius = 0.12f,
				procCoefficient = 0.1f,
				procChainMask = default(ProcChainMask),
				hitEffectPrefab = null,
				tracerEffectPrefab = Prefabs.shotgunTracer
			}.Fire();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f;
		if (finisher && ((EntityState)this).characterBody.HasBuff(Prefabs.passiveBuff))
		{
			AkSoundEngine.PostEvent("Play_RWBY_Yang_Shotgun_Reload", ((EntityState)this).gameObject);
			for (int i = ((EntityState)this).characterBody.GetBuffCount(Prefabs.shellBuff); i < 6; i++)
			{
				((EntityState)this).characterBody.AddBuff(Prefabs.shellBuff);
			}
		}
		base.OnExit();
	}

	public override void SetState()
	{
		if (!finisher)
		{
			Primary primary = new Primary();
			primary.attackIndex = attackIndex + 1;
			((EntityState)this).outer.SetNextState((EntityState)(object)primary);
		}
	}

	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;
	}
}
internal class Secondary : MeleeSkillState
{
	public override float baseAttackDuration => behaviour.spinDur;

	public override string layerName => "FullBody, Override";

	public override string animationStateName => (attackIndex == 1) ? "Uppercut" : "Plunge";

	public override string animParameter => "M1";

	public override string hitBoxGroupName => "Uppercut";

	public override float forceMagnitude => 1f;

	public override float damageCoefficient => (attackIndex == 1) ? 4f : 3f;

	public override string swingSound => (attackIndex == 1) ? "Play_RWBY_Yang_Spin" : "";

	public override float baseHopVelocity => 6f;

	public override GameObject hitEffectPrefab => Prefabs.punchHitHeavy;

	public override string swingMuzzle => (attackIndex == 2) ? "plungeMuzzle" : "base";

	public override bool crossfade => true;

	public override GameObject swingEffectPrefab => (attackIndex == 2) ? Prefabs.swingEffectEmp : Prefabs.spinEffect;

	public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericSecondary);

	public override bool rootMotion => attackIndex == 1;

	public override float rootMotionSpeed => behaviour.uppercutSpeed;

	public override bool rootMotionWhileHitting => true;

	public override bool scaleSwingEffectSpeed => attackIndex == 2;

	public override Vector3 rootMotionDirection()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		return Vector3.up;
	}

	public override void OnEnter()
	{
		//IL_002c: 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)
		base.OnEnter();
		((BaseState)this).StartAimMode(attackDuration, false);
		DamageAPI.AddModdedDamageType(overlapAttack, (attackIndex == 2) ? Prefabs.armorBreakDMG : Prefabs.uppercut);
		if (attackIndex == 2)
		{
			AkSoundEngine.PostEvent("Play_RWBY_Yang_Big_Swing", ((EntityState)this).gameObject);
		}
	}

	public override void FixedUpdate()
	{
		base.FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			if (((EntityState)this).inputBank.skill4.down)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
		}
	}

	public override BaseSkillState StateOverride()
	{
		if (attackIndex == 1 && hasHit)
		{
			return (BaseSkillState)(object)new Secondary
			{
				attackIndex = 2
			};
		}
		return null;
	}

	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;
	}
}
internal class Special : BaseYangState
{
	private float duration = 0.6f;

	private AnimationCurve curve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);

	public override void OnEnter()
	{
		base.OnEnter();
		if (((EntityState)this).isAuthority && ((BaseState)this).isGrounded)
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new SpecialFire
			{
				grounded = true
			});
		}
		else
		{
			((EntityState)this).PlayAnimation("FullBody, Override", "Special", "Special", duration, 0f);
			AkSoundEngine.PostEvent("Play_RWBY_Yang_Descend", ((EntityState)this).gameObject);
		}
	}

	public override void FixedUpdate()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: 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_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_006e: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			if (!((BaseState)this).isGrounded)
			{
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += Vector3.down * behaviour.upSpeed * curve.Evaluate(((EntityState)this).fixedAge / duration) * Time.fixedDeltaTime;
			}
			else
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new SpecialFire());
			}
		}
	}

	public override void OnExit()
	{
		animator.SetTrigger("trigger");
		base.OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)5;
	}
}
internal class SpecialFire : BaseYangState
{
	public bool grounded;

	private float duration = 0.65f;

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

	public override void OnDeserialize(NetworkReader reader)
	{
		((BaseSkillState)this).OnDeserialize(reader);
		grounded = reader.ReadBoolean();
	}

	public override void OnEnter()
	{
		base.OnEnter();
		duration = behaviour.slamDuration;
		duration /= ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("FullBody, Override", grounded ? "SpecialLandGrounded" : "SpecialLand", "Special", duration, 0f);
		ZoomOut();
		AkSoundEngine.PostEvent("Play_RWBY_Yang_Jump", ((EntityState)this).gameObject);
	}

	public override void OnFire()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: 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_00cf: Expected O, but got Unknown
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: 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_0072: 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_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		float num = 12f;
		Vector3 position = ((BaseState)this).FindModelChild("base").position;
		if (((EntityState)this).isAuthority)
		{
			new BlastAttack
			{
				position = position,
				radius = num,
				attacker = ((EntityState)this).gameObject,
				attackerFiltering = (AttackerFiltering)2,
				baseDamage = 10f * ((BaseState)this).damageStat,
				crit = ((BaseState)this).RollCrit(),
				damageType = (DamageTypeCombo.GenericSpecial | DamageTypeCombo.op_Implicit((DamageType)32)),
				falloffModel = (FalloffModel)0,
				teamIndex = ((EntityState)this).teamComponent.teamIndex,
				procCoefficient = 1f
			}.Fire();
		}
		EffectManager.SpawnEffect(Prefabs.Load<GameObject>("RoR2/Base/Parent/ParentSlamEffect.prefab"), new EffectData
		{
			origin = position,
			scale = num
		}, false);
		AkSoundEngine.PostEvent("Play_RWBY_Yang_Impact", ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		base.FixedUpdate();
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)9;
	}
}
internal class Utility : BaseYangState
{
	private float duration = 0.45f;

	private Vector3 direction;

	private AnimationCurve curve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);

	private GameObject effectInstance;

	private float speedMult => Math.Max(1f, ((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed);

	public override void OnEnter()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterBody.isSprinting = true;
		}
		direction = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
		if (((EntityState)this).isAuthority)
		{
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
		}
		bool isGrounded = ((BaseState)this).isGrounded;
		((EntityState)this).PlayAnimation("FullBody, Override", isGrounded ? "DodgeLand" : "DodgeAir", "Utility", duration, 0f);
		AkSoundEngine.PostEvent("Play_RWBY_Yang_Dash", ((EntityState)this).gameObject);
		string text = (isGrounded ? "dashMuzzleGround" : "dashMuzzlerAir");
		EffectManager.SimpleMuzzleFlash(Prefabs.dashEffect, ((EntityState)this).gameObject, text, false);
	}

	public override void FixedUpdate()
	{
		//IL_001a: 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_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.rootMotion += direction * behaviour.dodgeSpeed * speedMult * curve.Evaluate(((EntityState)this).fixedAge / duration) * Time.fixedDeltaTime;
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)2;
	}
}
internal static class Extensions
{
	public static GameObject NewSyringe(this GameObject g, params Material[] m)
	{
		((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
		((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
		((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
		return g;
	}

	public static Material SwapTexture(this Material m, Texture2D t)
	{
		m.mainTexture = (Texture)(object)t;
		return m;
	}

	public static GameObject SwapMaterials(this GameObject g, Material[] m)
	{
		Renderer[] componentsInChildren = g.GetComponentsInChildren<Renderer>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			if (Object.op_Implicit((Object)(object)m[i]))
			{
				componentsInChildren[i].material = m[i];
			}
		}
		return g;
	}

	public static float Mult(this float f, float mult = 100f)
	{
		return f * mult;
	}

	public static Color ToRGB255(this Color c, string title, string body)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		return new Color(c.r / 255f, c.g / 255f, c.b / 255f);
	}

	public static void SetStrings(this TooltipProvider t, string title, string body)
	{
		t.overrideTitleText = title;
		t.overrideBodyText = body;
	}
}
internal class Utils
{
	internal static void RecolorEffect(GameObject obj, Color color)
	{
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)obj))
		{
			return;
		}
		OmniEffect component = obj.GetComponent<OmniEffect>();
		if (Object.op_Implicit((Object)(object)component))
		{
			Object.DestroyImmediate((Object)(object)obj.GetComponent<OmniEffect>());
		}
		Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(Object.op_Implicit((Object)(object)component));
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			((Component)componentsInChildren[i]).gameObject.SetActive(true);
			if (Object.op_Implicit((Object)(object)componentsInChildren[i].material) && componentsInChildren[i].material.HasProperty("_TintColor"))
			{
				componentsInChildren[i].material.SetColor("_TintColor", color);
			}
		}
	}

	public static Vector3 FindNearestNodePosition(Vector3 targetPosition, GraphType nodeGraphType)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: 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_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
		val.hullSize = (HullClassification)1;
		val.nodeGraphType = nodeGraphType;
		val.prefab = Prefabs.Load<GameObject>("RoR2/Base/Common/DirectorSpawnProbeHelperPrefab.prefab");
		Vector3 result = targetPosition;
		GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
		{
			placementMode = (PlacementMode)3,
			position = targetPosition
		}, RoR2Application.rng));
		if (Object.op_Implicit((Object)(object)val2))
		{
			result = val2.transform.position;
		}
		if (Object.op_Implicit((Object)(object)val2))
		{
			Object.Destroy((Object)(object)val2);
		}
		Object.Destroy((Object)(object)val);
		return result;
	}

	public static Vector3 GetForwardDirection(Vector3 dir)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = Util.Vector3XZToVector2XY(dir);
		if (val != Vector2.zero)
		{
			((Vector2)(ref val)).Normalize();
			Vector3 val2 = new Vector3(val.x, 0f, val.y);
			return ((Vector3)(ref val2)).normalized;
		}
		return dir;
	}

	public static void PlayAnimation(GameObject g, string layerName, string animationStateName)
	{
		Animator component = g.GetComponent<Animator>();
		if (Object.op_Implicit((Object)(object)component))
		{
			int layerIndex = component.GetLayerIndex(layerName);
			component.speed = 1f;
			component.Update(0f);
			component.PlayInFixedTime(animationStateName, layerIndex, 0f);
		}
	}

	public static void PlayAnimation(GameObject g, string layerName, string animationStateName, string playbackRateParam, float duration)
	{
		//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)
		Animator component = g.GetComponent<Animator>();
		if (Object.op_Implicit((Object)(object)component))
		{
			component.speed = 1f;
			component.Update(0f);
			int layerIndex = component.GetLayerIndex(layerName);
			component.SetFloat(playbackRateParam, 1f);
			component.PlayInFixedTime(animationStateName, layerIndex, 0f);
			component.Update(0f);
			AnimatorStateInfo currentAnimatorStateInfo = component.GetCurrentAnimatorStateInfo(layerIndex);
			float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
			component.SetFloat(playbackRateParam, length / duration);
		}
	}

	public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName)
	{
		int layerIndex = modelAnimator.GetLayerIndex(layerName);
		modelAnimator.speed = 1f;
		modelAnimator.Update(0f);
		modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
	}

	public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName, string playbackRateParam, float duration)
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		modelAnimator.speed = 1f;
		modelAnimator.Update(0f);
		int layerIndex = modelAnimator.GetLayerIndex(layerName);
		modelAnimator.SetFloat(playbackRateParam, 1f);
		modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
		modelAnimator.Update(0f);
		AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
		float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
		modelAnimator.SetFloat(playbackRateParam, length / duration);
	}

	public static SkillDef NewSkillDef<T>(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillName, string skillDescriptionToken, params string[] keywordTokens) where T : SkillDef
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: 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)
		T val = ScriptableObject.CreateInstance<T>();
		((SkillDef)val).activationState = new SerializableEntityStateType(activationState);
		((SkillDef)val).activationStateMachineName = activationStateMachineName;
		((SkillDef)val).baseMaxStock = baseMaxStock;
		((SkillDef)val).baseRechargeInterval = baseRechargeInterval;
		((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
		((SkillDef)val).canceledFromSprinting = canceledFromSprinting;
		((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign;
		((SkillDef)val).interruptPriority = interruptPriority;
		((SkillDef)val).isCombatSkill = isCombatSkill;
		((SkillDef)val).mustKeyPress = mustKeyPress;
		((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation;
		((SkillDef)val).rechargeStock = rechargeStock;
		((SkillDef)val).requiredStock = requiredStock;
		((SkillDef)val).stockToConsume = stockToConsume;
		((SkillDef)val).icon = icon;
		((SkillDef)val).skillDescriptionToken = skillDescriptionToken;
		((SkillDef)val).skillName = skillName;
		((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
		((SkillDef)val).keywordTokens = keywordTokens;
		ContentAddition.AddSkillDef((SkillDef)(object)val);
		return (SkillDef)(object)val;
	}

	public static Color HexTo10(string hexColor)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		char[] array = hexColor.ToCharArray();
		return new Color((float)(array[0] + array[1]), (float)(array[2] + array[3]), (float)(array[4] + array[5]), 255f) / 255f;
	}

	public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		SerializableEntityStateType val = default(SerializableEntityStateType);
		((SerializableEntityStateType)(ref val))..ctor(typeof(T));
		EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>();
		val2.customName = customName;
		val2.initialStateType = val;
		val2.mainStateType = val;
		return val2;
	}

	public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill)
	{
		//IL_0031: 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)
		GenericSkill val = obj.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		val._skillFamily = val2;
		SkillFamily skillFamily = val.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = skill
		};
		((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
		return val;
	}

	public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		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
		};
		((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
		variants[num] = val;
	}

	public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
		((Object)val).name = name;
		val.canStack = stack;
		val.isHidden = hidden;
		val.iconSprite = sprite;
		val.buffColor = color;
		ContentAddition.AddBuffDef(val);
		return val;
	}

	public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax)
	{
		ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
		val.useOverallCurveOnly = true;
		val.timeMax = timeMax;
		val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
		return val;
	}

	public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		RotateAroundAxis val = target.AddComponent<RotateAroundAxis>();
		val.speed = (Speed)2;
		val.fastRotationSpeed = speed;
		val.rotateAroundAxis = axis;
		return val;
	}

	public static AnimateShaderAlpha AddShaderAlphaComponent(GameObject target, float timeMax, AnimationCurve curve, bool destroyOnEnd = true, bool disableOnEnd = false)
	{
		AnimateShaderAlpha val = target.AddComponent<AnimateShaderAlpha>();
		val.timeMax = timeMax;
		val.alphaCurve = curve;
		val.destroyOnEnd = destroyOnEnd;
		val.disableOnEnd = disableOnEnd;
		return val;
	}

	internal static Sprite CreateSprite(Texture2D tex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
	}

	internal static SkinDefInfo CreateNewSkinDefInfo(SkinnedMeshRenderer[] childList, GameObject rootObject, string skinName, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		SkinDefInfo result = default(SkinDefInfo);
		result.BaseSkins = Array.Empty<SkinDef>();
		result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		List<GameObjectActivation> list = new List<GameObjectActivation>();
		foreach (SkinnedMeshRenderer val in childList)
		{
			GameObjectActivation val2 = default(GameObjectActivation);
			val2.gameObject = ((Component)val).gameObject;
			val2.shouldActivate = true;
			GameObjectActivation item = val2;
			list.Add(item);
		}
		result.GameObjectActivations = list.ToArray();
		result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>("skinIcon");
		result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
		result.Name = skinName;
		result.NameToken = skinName;
		result.RendererInfos = rendererInfos;
		result.RootObject = rootObject;
		result.UnlockableDef = unlockableDef;
		return result;
	}

	internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
	{
		Type type = ((object)original).GetType();
		Component val = destination.AddComponent(type);
		FieldInfo[] fields = type.GetFields();
		FieldInfo[] array = fields;
		foreach (FieldInfo fieldInfo in array)
		{
			fieldInfo.SetValue(val, fieldInfo.GetValue(original));
		}
		return (T)(object)((val is T) ? val : null);
	}

	public static Sprite CreateSpriteFromTexture(Texture2D texture)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)texture))
		{
			return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
		}
		return null;
	}

	public static GameObject FindInActiveObjectByName(string name)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Invalid comparison between Unknown and I4
		Transform[] array = Resources.FindObjectsOfTypeAll<Transform>();
		for (int i = 0; i < array.Length; i++)
		{
			if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
			{
				return ((Component)array[i]).gameObject;
			}
		}
		return null;
	}

	public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		HitBoxGroup val = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		val.groupName = name;
		List<HitBox> list = new List<HitBox>();
		for (int i = 0; i < sizes.Length; i++)
		{
			GameObject val2 = new GameObject(name + (i + 1));
			val2.transform.SetParent(parent);
			val2.transform.localPosition = positions[i];
			val2.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
			val2.transform.localScale = sizes[i];
			HitBox item = val2.AddComponent<HitBox>();
			val2.layer = LayerIndex.projectile.intVal;
			list.Add(item);
		}
		val.hitBoxes = list.ToArray();
	}

	public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale, Vector3 localPosition)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject(name);
		val.transform.SetParent(parent);
		val.transform.localPosition = localPosition;
		val.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
		val.transform.localScale = scale;
		HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		HitBox val3 = val.AddComponent<HitBox>();
		val.layer = LayerIndex.projectile.intVal;
		val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 };
		val2.groupName = name;
		return val;
	}

	internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		EffectComponent val = effect.GetComponent<EffectComponent>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			val = effect.AddComponent<EffectComponent>();
		}
		if (duration != -1f)
		{
			DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				effect.AddComponent<DestroyOnTimer>().duration = duration;
			}
			else
			{
				component.duration = duration;
			}
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
		{
			effect.AddComponent<NetworkIdentity>();
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
		{
			effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
		}
		val.applyScale = applyScale;
		val.effectIndex = (EffectIndex)(-1);
		val.parentToReferencedTransform = parentToReferencedTransform;
		val.positionAtReferencedTransform = positionAtReferencedTransform;
		val.soundName = soundName;
		ContentAddition.AddEffect(effect);
		return val;
	}

	public static Material FindMaterial(string name)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Invalid comparison between Unknown and I4
		Material[] array = Resources.FindObjectsOfTypeAll<Material>();
		for (int i = 0; i < array.Length; i++)
		{
			if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
			{
				return array[i];
			}
		}
		return null;
	}
}