Decompiled source of Wooper v1.0.0

Wooper.dll

Decompiled a week 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.Huntress;
using EntityStates.Merc;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Audio;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using ThreeEyedGames;
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("Wooper")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Wooper")]
[assembly: AssemblyTitle("Wooper")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Wooper;

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("Wooper.AssetBundle." + "Wooper".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Wooper.Wooper.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class Behaviour : MonoBehaviour
{
	private CharacterBody body;

	public bool playSound;

	public string soundID = "Play_beetle_queen_impact";

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
	}

	private void FixedUpdate()
	{
		if (playSound)
		{
			playSound = false;
			AkSoundEngine.PostEvent(soundID, ((Component)this).gameObject);
		}
	}
}
internal class DelayedGravity : MonoBehaviour
{
	private Rigidbody rigid;

	public float delay = 0.5f;

	private float stopwatch;

	private void Awake()
	{
		rigid = ((Component)this).GetComponent<Rigidbody>();
	}

	private void FixedUpdate()
	{
		if (!rigid.useGravity)
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= delay)
			{
				rigid.useGravity = true;
			}
		}
	}
}
internal class SoakedOverlayBehaviour : MonoBehaviour
{
	private CharacterBody body;

	private ModelLocator modelLocator;

	private TemporaryOverlayInstance overlay;

	private float stopwatch;

	private void Start()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
		modelLocator = ((Component)this).GetComponent<ModelLocator>();
		if (Object.op_Implicit((Object)(object)modelLocator) && Object.op_Implicit((Object)(object)modelLocator.modelTransform))
		{
			CharacterModel component = ((Component)modelLocator.modelTransform).GetComponent<CharacterModel>();
			if (Object.op_Implicit((Object)(object)component))
			{
				overlay = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
				overlay.originalMaterial = Prefabs.soakedOverlay;
				overlay.destroyComponentOnEnd = true;
				overlay.animateShaderAlpha = true;
				overlay.duration = 999999f;
				overlay.alphaCurve = AnimationCurve.Constant(0f, 1f, 1f);
				overlay.AddToCharacterModel(component);
			}
		}
	}

	private void FixedUpdate()
	{
		stopwatch += Time.fixedDeltaTime;
		if (!(stopwatch < 0.1f))
		{
			stopwatch = 0f;
			if (!body.HasBuff(Prefabs.soakedDebuff))
			{
				Object.Destroy((Object)(object)this);
			}
		}
	}

	private void OnDestroy()
	{
		if (overlay != null)
		{
			overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
			overlay.duration = 0.4f;
			overlay.stopwatch = 0f;
		}
	}
}
internal class SoundLoop : MonoBehaviour
{
	public string soundID;

	private uint ID;

	private void Start()
	{
		ID = AkSoundEngine.PostEvent(soundID, ((Component)this).gameObject);
	}

	private void OnDisable()
	{
		AkSoundEngine.StopPlayingID(ID);
	}
}
internal class SurfProjectileBehaviour : MonoBehaviour
{
	public float maxDistance = 15f;

	private ProjectileImpactExplosion explosion;

	private float stopwatch;

	private void Awake()
	{
		explosion = ((Component)this).GetComponent<ProjectileImpactExplosion>();
	}

	private void FixedUpdate()
	{
		//IL_003c: 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: 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_005b: 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)
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= 0.1f)
		{
			stopwatch = 0f;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)this).transform.position + Vector3.up * 9f, ((Component)this).transform.forward, ref val, maxDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)) && !Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponent<HurtBox>()))
			{
				explosion.stopwatch = 99f;
			}
		}
	}
}
internal class CharacterBodySetup
{
	internal const bool melee = false;

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

	internal static GameObject baseMaster;

	internal const string SURVIVORNAME = "Wooper";

	internal const string SURVIVORNAMEKEY = "WOOPER_";

	internal static Color characterColor = Color32.op_Implicit(new Color32((byte)37, (byte)150, (byte)190, byte.MaxValue));

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

	internal static void CreateSurvivorPrefab()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = CreateBodyPrefab("Wooper", characterColor, 100f);
		val.AddComponent<Behaviour>();
		CharacterBody component = val.GetComponent<CharacterBody>();
		component.mainRootSpeed = 0f;
		component.baseMaxHealth = 130f;
		component.levelMaxHealth = 39f;
		component.baseRegen = 1.5f;
		component.levelRegen = 0.3f;
		component.baseMaxShield = 0f;
		component.levelMaxShield = 0f;
		component.baseMoveSpeed = 7f;
		component.levelMoveSpeed = 0f;
		component.baseAcceleration = 110f;
		component.baseJumpPower = 15f;
		component.levelJumpPower = 0f;
		component.baseDamage = 11f;
		component.levelDamage = 2.2f;
		component.baseAttackSpeed = 1f;
		component.levelAttackSpeed = 0f;
		component.baseCrit = 1f;
		component.levelCrit = 0f;
		component.baseArmor = 15f;
		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_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		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 he left.";
		string text5 = "..and so he vanished.";
		string text6 = "";
		LanguageAPI.Add("WOOPER_" + text2 + "_DESCRIPTION", text3);
		LanguageAPI.Add("WOOPER_" + text2 + "_SUBTITLE", "Smiling Swimmer");
		LanguageAPI.Add("WOOPER_" + text2 + "_OUTRO", text4);
		LanguageAPI.Add("WOOPER_" + 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>());
		((Component)componentInChildren).gameObject.AddComponent<AnimationEvents>().soundCenter = ((Component)componentInChildren).gameObject;
		SurvivorDef val2 = ScriptableObject.CreateInstance<SurvivorDef>();
		val2.cachedName = "WOOPER_" + text2 + "_NAME";
		val2.unlockableDef = null;
		val2.descriptionToken = "WOOPER_" + text2 + "_DESCRIPTION";
		val2.primaryColor = component.bodyColor;
		val2.bodyPrefab = characterPrefab;
		val2.displayPrefab = val;
		val2.outroFlavorToken = "WOOPER_" + text2 + "_OUTRO";
		val2.desiredSortPosition = 22f;
		val2.mainEndingEscapeFailureFlavorToken = "WOOPER_" + text2 + "_FAIL";
		ContentAddition.AddSurvivorDef(val2);
		GameObject val3 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.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)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: 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_008b: 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_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<PrimaryAlt>(ref flag);
		ContentAddition.AddEntityState<PrimaryAlt2>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<SecondaryAlt>(ref flag);
		ContentAddition.AddEntityState<SecondaryAltFire>(ref flag);
		ContentAddition.AddEntityState<SecondaryAlt2>(ref flag);
		ContentAddition.AddEntityState<SecondaryAlt2Fire>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<UtilityAlt>(ref flag);
		ContentAddition.AddEntityState<UtilityAlt2>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<SpecialAlt>(ref flag);
		ContentAddition.AddEntityState<SpecialAlt2>(ref flag);
		ContentAddition.AddEntityState<SpecialAlt2Buff>(ref flag);
		ContentAddition.AddEntityState<SpecialAlt2Heal>(ref flag);
		ContentAddition.AddEntityState<SpecialAlt2Fire>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<WooperState>(ref flag);
		ContentAddition.AddEntityState<SpawnState>(ref flag);
		ContentAddition.AddEntityState<AimAreaIndicatorState>(ref flag);
	}

	internal static void PassiveSetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		component.passiveSkill.enabled = false;
		string text = "_PASSIVE";
		LanguageAPI.Add("WOOPER_" + text, "Water Absorb");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#55b8e2>Water</color> skills inflict <style=cIsUtility>Soaked</style> on-hit for <style=cIsUtility>4s</style>. <color=#9b5f41>Ground</color> skills consume <style=cIsUtility>Soaked</style> on-hit, <style=cIsUtility>slowing</style>, inflicting <style=cIsDamage>120% damage</style> and <style=cIsHealth>healing</style> Wooper for <style=cIsHealth>2% health</style>.");
		LanguageAPI.Add("WOOPER_" + text + "_TOKEN", "Passive");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Idle), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("passive"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		GenericSkill val = Utils.NewGenericSkill(characterPrefab, skill);
		SkillsAPI.SetLoadoutTitleTokenOverride(val, "WOOPER_" + text + "_TOKEN");
	}

	internal static void PrimarySetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_M1";
		LanguageAPI.Add("WOOPER_" + text, "Water Gun");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#55b8e2>Water</color>. The target is blasted with a forceful shot of water, inflicting <style=cIsDamage>80% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
		text = "_M1_ALT";
		LanguageAPI.Add("WOOPER_" + text, "Mud Shot");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#9b5f41>Ground</color>. Wooper attacks by hurling a blob of mud at the target, <style=cIsUtility>slowing</style> and inflicting <style=cIsDamage>170% damage</style>.");
		skill = Utils.NewSkillDef<SkillDef>(typeof(PrimaryAlt), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primaryAlt"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		Utils.AddAlt(component.primary.skillFamily, skill);
	}

	internal static void SecondarySetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_M2";
		LanguageAPI.Add("WOOPER_" + text, "Muddy Water");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#55b8e2>Water</color>. Wooper attacks by shooting muddy water at targets, <style=cIsUtility>slowing</style> and inflicting <style=cIsDamage>260% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 6f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
		text = "_M2_ALT";
		LanguageAPI.Add("WOOPER_" + text, "Earth Power");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#9b5f41>Ground</color>. <style=cIsDamage>Stunning</style>. Wooper makes the ground erupt with power, inflicting <style=cIsDamage>560% damage</style>.");
		skill = Utils.NewSkillDef<GroundedSkillDef>(typeof(SecondaryAlt), "Weapon", 1, 6f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondaryAlt"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", new string[1] { "KEYWORD_STUNNING" });
		Utils.AddAlt(component.secondary.skillFamily, skill);
		text = "_M2_ALT2";
		LanguageAPI.Add("WOOPER_" + text, "Whirlpool");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#55b8e2>Water</color>. Wooper traps the target inside a violent, swirling whirlpool that inflicts <style=cIsDamage>140% damage</style> per second, for up to <style=cIsUtility>6s</style>.");
		skill = Utils.NewSkillDef<SkillDef>(typeof(SecondaryAlt2), "Weapon", 1, 6f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondaryAlt2"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		Utils.AddAlt(component.secondary.skillFamily, skill);
		text = "_M1_ALT2";
		LanguageAPI.Add("WOOPER_" + text, "Aqua Tail");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#55b8e2>Water</color>. Wooper attacks by swinging its tail, inflicting <style=cIsDamage>170% damage</style>. Every 2nd hit inflicts <style=cIsDamage>200% damage</style>. The attack stacks <style=cIsUtility>Soaked</style> up to <style=cIsUtility>3</style> times, and repeats when hitting targets that have less than <style=cIsUtility>3</style> stacks.");
		skill = Utils.NewSkillDef<SkillDef>(typeof(PrimaryAlt2), "Weapon", 1, 6f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("primaryAlt2"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		Utils.AddAlt(component.secondary.skillFamily, skill);
	}

	internal static void UtilitySetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_UTIL";
		LanguageAPI.Add("WOOPER_" + text, "Dig");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#9b5f41>Ground</color>. Wooper burrows into the ground for a short time, gaining <style=cIsHealth>invulnerability</style>, then resurfaces inflicting <style=cIsDamage>280% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<GroundedSkillDef>(typeof(Utility), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
		text = "_UTIL_ALT";
		LanguageAPI.Add("WOOPER_" + text, "Protect");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "Wooper enters a defensive stance to <style=cIsDamage>block</style> all incoming damage. This stance can be held for up to <style=cIsUtility>10s</style>.");
		skill = Utils.NewSkillDef<SkillDef>(typeof(UtilityAlt), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utilityAlt"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		Utils.AddAlt(component.utility.skillFamily, skill);
		text = "_UTIL_ALT2";
		LanguageAPI.Add("WOOPER_" + text, "Waterfall");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#55b8e2>Water</color>. Wooper charges upwards in a torrent of water, inflicting <style=cIsDamage>270% damage</style>, then crashes down inflicting <style=cIsDamage>300% damage</style> on impact.");
		skill = Utils.NewSkillDef<SkillDef>(typeof(UtilityAlt2), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utilityAlt2"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		Utils.AddAlt(component.utility.skillFamily, skill);
	}

	internal static void SpecialSetup(GameObject characterPrefab)
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		string text = "_SPEC";
		LanguageAPI.Add("WOOPER_" + text, "Surf");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#55b8e2>Water</color>. Wooper attacks everything around it by swamping its surroundings with a giant wave, inflicting <style=cIsDamage>700% damage</style>. It leaves a puddle that inflicts <style=cIsDamage>70% damage</style> per second lasting up to <style=cIsUtility>6s</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Weapon", 1, 12f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
		text = "_SPEC_ALT";
		LanguageAPI.Add("WOOPER_" + text, "Earthquake");
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "<color=#9b5f41>Ground</color>. Wooper attacks by setting off an earthquake that strikes a wide area, inflicting <style=cIsDamage>1200% damage</style>.");
		skill = Utils.NewSkillDef<GroundedSkillDef>(typeof(SpecialAlt), "Weapon", 1, 12f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("specialAlt"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", Array.Empty<string>());
		Utils.AddAlt(component.special.skillFamily, skill);
		text = "_SPEC_ALT2";
		LanguageAPI.Add("WOOPER_" + text, "Stockpile / Swallow / Spit Up");
		string text2 = "<style=cKeywordName>【Press】Stockpile</style><style=cSub> Wooper stores power and boosts its <style=cIsDamage>armor</style> by <style=cIsDamage>5</style>. This move can be used up to <style=cIsUtility>3</style> times.\n\n";
		string text3 = "<style=cKeywordName>【Hold】Swallow</style><style=cSub> The power stored using the move Stockpile is absorbed by the user to <style=cIsHealing>heal</style> for <style=cIsHealing>25%-100%</style>.\n\n";
		string text4 = "<style=cKeywordName>【Double Press】Spit Up</style><style=cSub> The power stored using the move Stockpile is released at once in an attack that inflicts <style=cIsDamage>450%-1350%</style>.\n\n";
		LanguageAPI.Add("WOOPER_" + text + "_DESCRIPTION", "Wooper executes an ability based on input conditions.\n\n" + text2 + text3 + text4);
		LanguageAPI.Add("WOOPER_" + text + "_KEYWORD", text2 + text3 + text4);
		skill = Utils.NewSkillDef<SkillDef>(typeof(SpecialAlt2), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("specialAlt2"), "WOOPER_" + text, "WOOPER_" + text + "_DESCRIPTION", new string[1] { "WOOPER_" + text + "_KEYWORD" });
		Utils.AddAlt(component.special.skillFamily, skill);
	}

	internal static GameObject CreateBodyPrefab(string characterName, Color bodyColor, float mass, bool large = false, bool flying = false)
	{
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Expected O, but got Unknown
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Expected O, but got Unknown
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0231: Unknown result type (might be due to invalid IL or missing references)
		//IL_024d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_0294: Unknown result type (might be due to invalid IL or missing references)
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_0327: Unknown result type (might be due to invalid IL or missing references)
		//IL_0354: Unknown result type (might be due to invalid IL or missing references)
		//IL_0359: Unknown result type (might be due to invalid IL or missing references)
		//IL_0402: Unknown result type (might be due to invalid IL or missing references)
		//IL_0422: Unknown result type (might be due to invalid IL or missing references)
		//IL_042f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0533: Unknown result type (might be due to invalid IL or missing references)
		//IL_0556: Unknown result type (might be due to invalid IL or missing references)
		//IL_0579: Unknown result type (might be due to invalid IL or missing references)
		//IL_059c: 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_0679: Unknown result type (might be due to invalid IL or missing references)
		//IL_068d: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06df: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0854: Unknown result type (might be due to invalid IL or missing references)
		//IL_0859: Unknown result type (might be due to invalid IL or missing references)
		//IL_086a: Unknown result type (might be due to invalid IL or missing references)
		//IL_086f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0895: Unknown result type (might be due to invalid IL or missing references)
		//IL_089a: Unknown result type (might be due to invalid IL or missing references)
		string text = characterName.Replace(" ", "");
		string text2 = text.ToUpper();
		LanguageAPI.Add("WOOPER_" + text2 + "_NAME", characterName);
		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");
		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, 1f, 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 = "WOOPER_" + text2 + "_NAME";
		component2.subtitleNameToken = "WOOPER_" + 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;
		component2.preferredPodPrefab = null;
		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.mainTexture);
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val7,
				defaultMaterial = ((Renderer)val7).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = true
			});
			if (!((Object)val7).name.Contains("base"))
			{
				((Component)val7).gameObject.SetActive(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");
		LanguageAPI.Add(text2 + "BODY_SKIN01_NAME", "Shiny");
		LanguageAPI.Add(text2 + "BODY_SKIN02_NAME", "Paldean");
		LanguageAPI.Add(text2 + "BODY_SKIN03_NAME", "Shiny Paldean");
		ModelSkinController val8 = val2.AddComponent<ModelSkinController>();
		val8.skins = (SkinDef[])(object)new SkinDef[4]
		{
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_DEFAULT_SKIN_NAME", "base", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_SKIN01_NAME", "shiny", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_SKIN02_NAME", "paldean", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_SKIN03_NAME", "paldean_shiny", 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("Tail", val2.transform, new Vector3(4f, 4f, 5f), new Vector3(0f, 0.5f, 2f));
		Utils.CreateHitbox("Waterfall", val2.transform, new Vector3(5f, 8f, 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.initialStateType = new SerializableEntityStateType(typeof(SpawnState));
		component11.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component12 = val.GetComponent<CharacterDeathBehavior>();
		component12.deathStateMachine = val.GetComponent<EntityStateMachine>();
		component12.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath));
		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_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
	}

	private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Prefabs.protect))
		{
			damageInfo.damage = 0f;
			damageInfo.rejected = true;
		}
		orig.Invoke(self, damageInfo);
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		int buffCount = sender.GetBuffCount(Prefabs.stockpile);
		if (buffCount > 0)
		{
			args.armorAdd += (float)(buffCount * 5);
		}
		if (sender.HasBuff(Prefabs.soakedDebuff) && !Object.op_Implicit((Object)(object)((Component)sender).GetComponent<SoakedOverlayBehaviour>()))
		{
			((Component)sender).gameObject.AddComponent<SoakedOverlayBehaviour>();
		}
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Expected O, but got Unknown
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: Expected O, but got Unknown
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Expected O, but got Unknown
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)damageReport.attackerBody) || !Object.op_Implicit((Object)(object)damageReport.victimBody))
		{
			return;
		}
		if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.waterDMG))
		{
			int buffCount = damageReport.victimBody.GetBuffCount(Prefabs.soakedDebuff);
			bool flag = DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.aquaTail);
			if (buffCount > 0)
			{
				damageReport.victimBody.SetTimedBuffDurationIfPresent(Prefabs.soakedDebuff, 4f, flag);
			}
			if ((buffCount == 0 && !flag) || (flag && buffCount < 3))
			{
				damageReport.victimBody.AddTimedBuff(Prefabs.soakedDebuff, 4f);
			}
		}
		if (!DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.groundDMG) || !damageReport.victimBody.HasBuff(Prefabs.soakedDebuff) || damageReport.attackerBody.HasBuff(Prefabs.soakedCooldown))
		{
			return;
		}
		damageReport.victimBody.AddTimedBuff(Buffs.Slow60, 1f);
		int buffCount2 = damageReport.victimBody.GetBuffCount(Prefabs.soakedDebuff);
		DamageInfo val = new DamageInfo
		{
			attacker = damageReport.attacker,
			crit = damageReport.damageInfo.crit,
			procCoefficient = 1f,
			damage = damageReport.attackerBody.damage * 1.2f * (float)buffCount2,
			position = damageReport.victimBody.corePosition
		};
		EffectManager.SimpleEffect(Prefabs.groundHitSmall, val.position, Quaternion.identity, true);
		SphereSearch val2 = new SphereSearch
		{
			origin = val.position,
			mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
			radius = 4f
		};
		HurtBox[] hurtBoxes = val2.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(damageReport.attackerBody.teamComponent.teamIndex)).FilterCandidatesByDistinctHurtBoxEntities()
			.GetHurtBoxes();
		HurtBox[] array = hurtBoxes;
		foreach (HurtBox val3 in array)
		{
			if (val3.healthComponent.alive)
			{
				val.position = ((Component)val3).transform.position;
				val3.healthComponent.TakeDamage(val);
				EffectManager.SimpleEffect(Prefabs.groundHitSmall, val.position, Quaternion.identity, true);
			}
		}
		damageReport.victimBody.ClearTimedBuffs(Prefabs.soakedDebuff);
		damageReport.attackerBody.AddTimedBuff(Prefabs.soakedCooldown, 0.5f);
		HealthComponent healthComponent = damageReport.attackerBody.healthComponent;
		HealOrb val4 = new HealOrb();
		((Orb)val4).origin = damageReport.damageInfo.position;
		((Orb)val4).target = damageReport.attackerBody.mainHurtBox;
		val4.healValue = healthComponent.fullHealth * 0.02f;
		val4.overrideDuration = 0.3f;
		OrbManager.instance.AddOrb((Orb)(object)val4);
	}
}
[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.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Wooper", "Wooper", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Wooper";

	public const string MODNAME = "Wooper";

	public const string VERSION = "1.0.0";

	internal const string MODKEY = "WOOPER_";

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

	internal static GameObject waterGunProjectile;

	internal static GameObject surfProjectileExplosion;

	internal static GameObject surfProjectile;

	internal static GameObject surfProjectileGhost;

	internal static GameObject shieldEffect;

	internal static GameObject digEffect;

	internal static GameObject emergeEffect;

	internal static GameObject groundHit;

	internal static GameObject groundHitSmall;

	internal static GameObject waterHit;

	internal static GameObject waterHitSmall;

	internal static GameObject mudProjectileGhost;

	internal static GameObject mudProjectile;

	internal static GameObject mudProjectileImpact;

	internal static GameObject mudPuddleProjectile;

	internal static GameObject mudPuddleProjectileDotZoneGhost;

	internal static GameObject mudPuddleProjectileDotZone;

	internal static GameObject waterPuddleProjectileDotZone;

	internal static GameObject groundSmokeImpact;

	internal static GameObject earthQuakeImpact;

	internal static GameObject whirlpoolProjectileGhost;

	internal static GameObject whirlpoolProjectile;

	internal static GameObject mudSpurtEffect;

	internal static GameObject mudPuddleProjectileImpact;

	internal static GameObject mudHit;

	internal static GameObject waterfallExplosion;

	internal static GameObject waterfallMuzzleEffect;

	internal static GameObject waterfallDownwardMuzzleEffect;

	internal static GameObject spitUpMuzzleEffect;

	internal static GameObject spitUpHit;

	internal static GameObject stockpileEffect;

	internal static GameObject swallowEffect;

	internal static GameObject spitUpProjectile;

	internal static GameObject spitUpProjectileGhost;

	internal static GameObject pokeball;

	internal static GameObject spawnEffect;

	internal static GameObject spawnEffectShiny;

	internal static GameObject waterMuzzleEffect;

	internal static GameObject mudMuzzleEffect;

	internal static Material soakedOverlay;

	internal static BuffDef soakedDebuff;

	internal static BuffDef soakedCooldown;

	internal static BuffDef protect;

	internal static BuffDef stockpile;

	internal static ModdedDamageType groundDMG;

	internal static ModdedDamageType waterDMG;

	internal static ModdedDamageType aquaTail;

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

	internal static void CreatePrefabs()
	{
		//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_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: 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_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Expected O, but got Unknown
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_022c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04be: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_0518: Unknown result type (might be due to invalid IL or missing references)
		//IL_0533: 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_0557: Unknown result type (might be due to invalid IL or missing references)
		//IL_055c: Unknown result type (might be due to invalid IL or missing references)
		//IL_058c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0596: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_085d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0862: Unknown result type (might be due to invalid IL or missing references)
		//IL_094b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0973: Unknown result type (might be due to invalid IL or missing references)
		//IL_0978: Unknown result type (might be due to invalid IL or missing references)
		//IL_098b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0995: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a28: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a89: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a93: Unknown result type (might be due to invalid IL or missing references)
		//IL_08fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0abb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0acd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ad2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b58: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bbc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bfb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c3b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d06: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d0b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d0f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d26: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e58: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5f: Expected O, but got Unknown
		//IL_0e91: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e96: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f9e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fa8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fcd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fe6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fe8: Unknown result type (might be due to invalid IL or missing references)
		//IL_105e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1199: Unknown result type (might be due to invalid IL or missing references)
		//IL_119e: Unknown result type (might be due to invalid IL or missing references)
		//IL_12af: Unknown result type (might be due to invalid IL or missing references)
		//IL_1361: Unknown result type (might be due to invalid IL or missing references)
		//IL_1367: Unknown result type (might be due to invalid IL or missing references)
		//IL_136c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1371: Unknown result type (might be due to invalid IL or missing references)
		//IL_1375: Unknown result type (might be due to invalid IL or missing references)
		//IL_138a: Unknown result type (might be due to invalid IL or missing references)
		//IL_138c: Unknown result type (might be due to invalid IL or missing references)
		//IL_143a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1441: Expected O, but got Unknown
		//IL_1451: Unknown result type (might be due to invalid IL or missing references)
		//IL_1456: Unknown result type (might be due to invalid IL or missing references)
		//IL_1310: Unknown result type (might be due to invalid IL or missing references)
		//IL_1315: Unknown result type (might be due to invalid IL or missing references)
		//IL_1328: Unknown result type (might be due to invalid IL or missing references)
		//IL_1332: Unknown result type (might be due to invalid IL or missing references)
		//IL_14c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_14cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_151d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1524: Expected O, but got Unknown
		//IL_152b: Unknown result type (might be due to invalid IL or missing references)
		//IL_15cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_15d6: Expected O, but got Unknown
		//IL_15e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_15eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_1647: Unknown result type (might be due to invalid IL or missing references)
		//IL_1651: Unknown result type (might be due to invalid IL or missing references)
		//IL_1673: Unknown result type (might be due to invalid IL or missing references)
		//IL_1678: Unknown result type (might be due to invalid IL or missing references)
		//IL_167c: Unknown result type (might be due to invalid IL or missing references)
		//IL_169b: Unknown result type (might be due to invalid IL or missing references)
		//IL_16a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_16a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_16b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_16bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_17f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_1828: Unknown result type (might be due to invalid IL or missing references)
		//IL_182d: Unknown result type (might be due to invalid IL or missing references)
		//IL_18c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_18e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_18e9: Expected O, but got Unknown
		//IL_1942: Unknown result type (might be due to invalid IL or missing references)
		//IL_1960: Unknown result type (might be due to invalid IL or missing references)
		//IL_1967: Expected O, but got Unknown
		//IL_1a33: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a38: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a3c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a51: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a53: Unknown result type (might be due to invalid IL or missing references)
		groundDMG = DamageAPI.ReserveDamageType();
		waterDMG = DamageAPI.ReserveDamageType();
		aquaTail = DamageAPI.ReserveDamageType();
		protect = Utils.NewBuffDef("Protect", stack: false, hidden: false, isDebuff: false, isCooldown: false, Assets.Load<Sprite>("reflectBuff"), Color32.op_Implicit(new Color32((byte)0, (byte)151, byte.MaxValue, byte.MaxValue)));
		soakedOverlay = new Material(Load<Material>("RoR2/DLC2/Chef/Buffs/matChefOiledDebuffOverlay.mat"));
		soakedOverlay.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)58, (byte)153, byte.MaxValue, (byte)105)));
		soakedOverlay.SetFloat("_AlphaBoost", 10f);
		soakedOverlay.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampHuntressSoft.png"));
		Sprite sprite = Load<Sprite>("RoR2/Base/Common/texBuffBleedingIcon.tif");
		soakedDebuff = Utils.NewBuffDef("Soaked", stack: true, hidden: false, isDebuff: true, isCooldown: false, sprite, Color32.op_Implicit(new Color32((byte)186, (byte)231, (byte)236, byte.MaxValue)));
		soakedCooldown = Utils.NewBuffDef("Soaked Cooldown", stack: false, hidden: false, isDebuff: false, isCooldown: true, sprite, Color32.op_Implicit(new Color32((byte)186, (byte)20, (byte)83, byte.MaxValue)));
		stockpile = Utils.NewBuffDef("Stockpile", stack: true, hidden: false, isDebuff: false, isCooldown: true, Assets.Load<Sprite>("stockpileBuff"), Color32.op_Implicit(new Color32((byte)139, (byte)147, (byte)228, byte.MaxValue)));
		surfProjectileExplosion = Instantiate(Assets.Load<GameObject>("WaveExplosion"), "SurfProjectileExplosion");
		Utils.RegisterEffect(surfProjectileExplosion, 1.5f, "Play_Wooper_Water_Explosion");
		swallowEffect = Instantiate(Assets.Load<GameObject>("SwallowEffect"), "SwallowEffect");
		Utils.RegisterEffect(swallowEffect, 1f);
		stockpileEffect = Instantiate(Assets.Load<GameObject>("StockpileEffect"), "StockpileEffect");
		Utils.RegisterEffect(stockpileEffect, 1.5f);
		GameObject obj = Assets.Load<GameObject>("WaterHit");
		waterMuzzleEffect = Instantiate(obj, "WaterHit");
		((Component)waterMuzzleEffect.transform.GetChild(0)).transform.localScale = Vector3.one * 0.75f;
		Utils.RegisterEffect(waterMuzzleEffect, 1f);
		spawnEffect = Instantiate(Assets.Load<GameObject>("SpawnEffect"), "SpawnEffect");
		Utils.RegisterEffect(spawnEffect, 1f);
		spawnEffectShiny = Instantiate(Assets.Load<GameObject>("SpawnEffectShiny"), "SpawnEffectShiny");
		Utils.RegisterEffect(spawnEffectShiny, 1f);
		pokeball = Instantiate(Assets.Load<GameObject>("pokeballMdl"), "Pokeball");
		Utils.RegisterEffect(pokeball, 0.62f);
		groundHit = Instantiate(Assets.Load<GameObject>("RockHit"), "GroundHit");
		Utils.RegisterEffect(groundHit, 1f);
		groundHitSmall = Instantiate(Assets.Load<GameObject>("RockHitSmall"), "GroundHitSmall");
		Utils.RegisterEffect(groundHitSmall, 1f);
		waterHit = Instantiate(obj, "WaterHit");
		Utils.RegisterEffect(waterHit, 1f, "Play_clayGrenadier_attack2_explode");
		waterHitSmall = Instantiate(obj, "WaterHitSmall");
		Utils.RegisterEffect(waterHitSmall, 1f, "Play_Wooper_Water_Hit_Small");
		waterfallExplosion = Instantiate(Assets.Load<GameObject>("WaterfallExplosion"), "WaterfallExplosion");
		Utils.RegisterEffect(waterfallExplosion, 1f, "Play_Wooper_Water_Explosion");
		spitUpHit = Instantiate(Assets.Load<GameObject>("SpitUpHitEffect"), "SpitUpHitEffect");
		Utils.RegisterEffect(spitUpHit, 1f, "Play_Wooper_SpitUp_Impact");
		spitUpMuzzleEffect = Instantiate(Assets.Load<GameObject>("SpitUpMuzzleEffect"), "SpitUpMuzzleEffect");
		Utils.RegisterEffect(spitUpMuzzleEffect, 1f);
		waterfallMuzzleEffect = Instantiate(Assets.Load<GameObject>("WaterfallMuzzleEffect"), "WaterfallMuzzleEffect");
		DestroyOnTimer val = waterfallMuzzleEffect.AddComponent<DestroyOnTimer>();
		val.duration = 1f;
		((Behaviour)val).enabled = false;
		waterfallDownwardMuzzleEffect = Instantiate(Assets.Load<GameObject>("WaterfallDownwardMuzzleEffect"), "WaterfallDownwardMuzzleEffect");
		val = waterfallDownwardMuzzleEffect.AddComponent<DestroyOnTimer>();
		val.duration = 1f;
		((Behaviour)val).enabled = false;
		Color val2 = Color32.op_Implicit(new Color32((byte)9, (byte)4, (byte)3, byte.MaxValue));
		Texture2D val3 = Load<Texture2D>("RoR2/Base/blackbeach/texBbDecalMask1.png");
		Material material = Utils.CreateClayMat("RoR2/Base/ClayBoss/matGooTrail.mat", val2);
		Material material2 = Utils.CreateClayMat("RoR2/Base/Common/VFX/matBloodClayLarge.mat", val2);
		Material material3 = Utils.CreateClayMat("RoR2/Base/Common/VFX/matBloodClaySingle.mat", val2);
		Material material4 = Utils.CreateClayMat("RoR2/DLC1/ClayGrenadier/matClayGrenadierShockwave.mat", val2);
		Material material5 = Utils.CreateClayMat("RoR2/Base/Clay/matClayGooFizzle.mat", val2);
		Material material6 = Utils.CreateClayMat("RoR2/Base/ClayBoss/matGooTrailLegs.mat", Color32.op_Implicit(new Color32((byte)9, (byte)5, (byte)0, byte.MaxValue)));
		Material material7 = Utils.CreateClayMat("RoR2/DLC1/ClayGrenadier/matClayGooDecalMediumSplat.mat", Color32.op_Implicit(new Color32((byte)19, (byte)7, (byte)4, byte.MaxValue)), "_Color");
		mudMuzzleEffect = Instantiate("RoR2/Base/ClayBoss/MuzzleflashClayBoss.prefab", "MudMuzzleEffect");
		mudMuzzleEffect.transform.localScale = Vector3.one * 0.15f;
		ParticleSystemRenderer[] componentsInChildren = mudMuzzleEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val4 in componentsInChildren)
		{
			MainModule main = ((Component)val4).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0;
			switch (((Object)val4).name)
			{
			case "Goo":
				((Renderer)val4).material = material2;
				break;
			case "Donut":
				((Renderer)val4).material = material;
				break;
			case "Tube":
				((Renderer)val4).material = material6;
				break;
			}
		}
		ContentAddition.AddEffect(mudMuzzleEffect);
		mudHit = Instantiate("RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelExplosion.prefab", "MudHit");
		mudHit.GetComponentInChildren<Decal>().Material = material7;
		ParticleSystemRenderer[] componentsInChildren2 = mudHit.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val5 in componentsInChildren2)
		{
			switch (((Object)val5).name)
			{
			case "Goo":
				((Renderer)val5).material = material2;
				break;
			case "Ring":
				((Renderer)val5).material = material6;
				break;
			case "Goo, Billboard":
				((Renderer)val5).material = material5;
				break;
			}
		}
		ContentAddition.AddEffect(mudHit);
		mudPuddleProjectileImpact = Instantiate("RoR2/DLC1/ClayGrenadier/ClayGrenadierMortarExplosion.prefab", "MudPuddleProjectileImpact");
		((Component)mudPuddleProjectileImpact.GetComponentInChildren<Light>()).gameObject.SetActive(false);
		((Component)mudPuddleProjectileImpact.GetComponentInChildren<Decal>()).gameObject.SetActive(false);
		ParticleSystemRenderer[] componentsInChildren3 = mudPuddleProjectileImpact.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val6 in componentsInChildren3)
		{
			switch (((Object)val6).name)
			{
			case "Omni, Directional":
				((Renderer)val6).material = material5;
				break;
			case "Billboard, Big Splash":
			case "Billboard, Splash":
				((Renderer)val6).material = material2;
				break;
			case "Ring":
			case "Ring, Out":
				((Renderer)val6).material = material4;
				break;
			case "Dust,Edge":
				((Component)val6).gameObject.SetActive(false);
				break;
			}
		}
		ContentAddition.AddEffect(mudPuddleProjectileImpact);
		mudSpurtEffect = Instantiate("RoR2/Base/ClayBruiser/ClayShockwaveEffect.prefab", "MudSpurtEffect");
		ParticleSystemRenderer[] componentsInChildren4 = mudSpurtEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val7 in componentsInChildren4)
		{
			MainModule main2 = ((Component)val7).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main2)).scalingMode = (ParticleSystemScalingMode)0;
			switch (((Object)val7).name)
			{
			case "Pollen, Single":
				((Renderer)val7).material = material3;
				break;
			case "Pollen, Dust":
				((Renderer)val7).material = material2;
				break;
			case "Pollen, Radial":
				((Renderer)val7).material = material6;
				break;
			case "Pollen, Single (1)":
				((Renderer)val7).material = material3;
				((Component)val7).transform.localScale = new Vector3(3f, 1f, 3f);
				break;
			}
		}
		ContentAddition.AddEffect(mudSpurtEffect);
		earthQuakeImpact = Instantiate("RoR2/Base/Parent/ParentSlamEffect.prefab", "EarthQuakeImpact");
		earthQuakeImpact.transform.GetChild(0).localPosition = Vector3.zero;
		ParticleSystem[] componentsInChildren5 = earthQuakeImpact.GetComponentsInChildren<ParticleSystem>(true);
		foreach (ParticleSystem val8 in componentsInChildren5)
		{
			MainModule main3 = val8.main;
			((MainModule)(ref main3)).scalingMode = (ParticleSystemScalingMode)0;
			Transform transform = ((Component)val8).transform;
			transform.localScale /= 6f;
		}
		Utils.RegisterEffect(earthQuakeImpact, 1.2f, "Play_parent_attack1_slam", applyScale: true);
		groundSmokeImpact = Instantiate("RoR2/Base/Toolbot/TracerToolbotRebar.prefab", "GroundSmokeImpact");
		Object.Destroy((Object)(object)groundSmokeImpact.GetComponent<Tracer>());
		((Component)groundSmokeImpact.GetComponentInChildren<MeshRenderer>()).gameObject.SetActive(false);
		((Component)groundSmokeImpact.GetComponentInChildren<Light>()).gameObject.SetActive(false);
		groundSmokeImpact.transform.GetChild(0).localRotation = Quaternion.identity;
		Utils.RegisterEffect(groundSmokeImpact, -1f, "Play_grandParent_attack1_boulderSmall_impact");
		string path = "RoR2/Base/BeetleGuard/SunderGhost.prefab";
		digEffect = Instantiate(path, "DigEffect");
		Object.Destroy((Object)(object)digEffect.GetComponent<ProjectileGhostController>());
		digEffect.AddComponent<ScaleParticleSystemDuration>();
		digEffect.transform.localScale = Vector3.one * 0.15f;
		ParticleSystem[] componentsInChildren6 = digEffect.GetComponentsInChildren<ParticleSystem>(true);
		foreach (ParticleSystem val9 in componentsInChildren6)
		{
			MainModule main4 = val9.main;
			((MainModule)(ref main4)).scalingMode = (ParticleSystemScalingMode)0;
			EmissionModule emission = val9.emission;
			((EmissionModule)(ref emission)).rateOverTimeMultiplier = 200f;
		}
		emergeEffect = Instantiate(path, "DigEmergeEffect");
		Object.Destroy((Object)(object)emergeEffect.GetComponent<ProjectileGhostController>());
		emergeEffect.transform.localScale = Vector3.one;
		emergeEffect.GetComponent<ShakeEmitter>().duration = 0.6f;
		ParticleSystem[] componentsInChildren7 = emergeEffect.GetComponentsInChildren<ParticleSystem>(true);
		foreach (ParticleSystem val10 in componentsInChildren7)
		{
			MainModule main5 = val10.main;
			((MainModule)(ref main5)).loop = false;
			((MainModule)(ref main5)).scalingMode = (ParticleSystemScalingMode)0;
		}
		Utils.RegisterEffect(emergeEffect, 1.2f, "Play_grandParent_attack1_boulderLarge_impact");
		shieldEffect = Instantiate(Assets.Load<GameObject>("ReflectShield"), "ReflectShield");
		shieldEffect.transform.localScale = Vector3.one * 0.5f;
		Material val11 = Object.Instantiate<Material>(Load<Material>("RoR2/Base/Engi/matDefenseMatrix.mat"));
		val11.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)0, (byte)89, byte.MaxValue, byte.MaxValue)));
		val11.SetTexture("_RemapTex", (Texture)(object)Assets.Load<Texture2D>("shieldRamp"));
		val11.SetTexture("_Cloud1Tex", (Texture)(object)Assets.Load<Texture2D>("shieldTex"));
		val11.SetTextureScale("_Cloud1Tex", Vector2.one * 10f);
		val11.SetFloat("_SoftPower", 0f);
		val11.SetFloat("_Boost", 0.6f);
		val11.SetFloat("_RimPower", 2.4f);
		((Renderer)shieldEffect.GetComponentInChildren<ParticleSystemRenderer>()).material = val11;
		waterGunProjectileGhost = Instantiate(Assets.Load<GameObject>("WaterProjectile"), "WaterGunProjectileGhost");
		waterGunProjectileGhost.AddComponent<ProjectileGhostController>();
		Utils.AddScaleComponent(waterGunProjectileGhost, 0.1f);
		waterGunProjectile = Instantiate("RoR2/Base/Mage/MageIceBombProjectile.prefab", "WaterGunProjectile", registerNetwork: true);
		Object.Destroy((Object)(object)waterGunProjectile.GetComponent<ProjectileSingleTargetImpact>());
		waterGunProjectile.GetComponent<ProjectileController>().ghostPrefab = waterGunProjectileGhost;
		DamageTypeCombo genericPrimary = DamageTypeCombo.GenericPrimary;
		DamageAPI.AddModdedDamageType(ref genericPrimary, waterDMG);
		waterGunProjectile.GetComponent<ProjectileDamage>().damageType = genericPrimary;
		waterGunProjectile.AddComponent<SphereCollider>().radius = 0.5f;
		ProjectileSimple component = waterGunProjectile.GetComponent<ProjectileSimple>();
		component.lifetime = 1.5f;
		ProjectileImpactExplosion val12 = waterGunProjectile.AddComponent<ProjectileImpactExplosion>();
		val12.destroyOnWorld = true;
		val12.impactOnWorld = true;
		val12.lifetime = component.lifetime;
		((ProjectileExplosion)val12).blastRadius = 0f;
		((ProjectileExplosion)val12).blastDamageCoefficient = 0f;
		val12.impactEffect = waterHitSmall;
		((ProjectileExplosion)val12).blastProcCoefficient = 0.9f;
		waterGunProjectile.AddComponent<DelayedGravity>();
		waterGunProjectile.GetComponent<ProjectileOverlapAttack>().impactEffect = waterHitSmall;
		waterGunProjectile.AddComponent<SoundLoop>().soundID = "Play_Wooper_Water_Projectile_Small";
		ContentAddition.AddProjectile(waterGunProjectile);
		Material val13 = Load<Material>("RoR2/Base/LunarExploder/matLunarExploderDeathDecal.mat");
		GameObject obj2 = Load<GameObject>("RoR2/Base/LunarExploder/LunarExploderProjectileDotZone.prefab");
		waterPuddleProjectileDotZone = Instantiate(obj2, "WaterPuddleProjectileDotZone", registerNetwork: true);
		ProjectileDotZone component2 = waterPuddleProjectileDotZone.GetComponent<ProjectileDotZone>();
		component2.damageCoefficient = 1f;
		component2.fireFrequency = 1f;
		component2.resetFrequency = 1f;
		component2.lifetime = 6f;
		Material val14 = new Material(val13);
		val14.SetTexture("_MaskTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/VFX/ParticleMasks/texGlowPaintMask.png"));
		val14.SetColor("_Color", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)165)));
		val14.SetTexture("_Cloud1Tex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/TiledTextures/texCloudWaterRipples.png"));
		val14.SetTexture("_Cloud2Tex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/TiledTextures/texCloudOrganic1.png"));
		val14.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampHuntress.png"));
		val14.SetFloat("_AlphaBoost", 3f);
		waterPuddleProjectileDotZone.GetComponentInChildren<Decal>().Material = val14;
		waterPuddleProjectileDotZone.GetComponentInChildren<Light>().range = 18f;
		((Component)waterPuddleProjectileDotZone.GetComponentInChildren<TeamAreaIndicator>()).gameObject.SetActive(false);
		EnumerableExtensions.ForEachTry<ParticleSystem>((IEnumerable<ParticleSystem>)waterPuddleProjectileDotZone.GetComponentsInChildren<ParticleSystem>(), (Action<ParticleSystem>)delegate(ParticleSystem x)
		{
			((Component)x).gameObject.SetActive(false);
		}, (IDictionary<ParticleSystem, Exception>)null);
		ContentAddition.AddProjectile(waterPuddleProjectileDotZone);
		surfProjectileGhost = Instantiate(Assets.Load<GameObject>("WaveProjectile"), "SurfProjectileGhost");
		surfProjectileGhost.AddComponent<ProjectileGhostController>();
		surfProjectileGhost.transform.localScale = Vector3.one * 2f;
		surfProjectile = Instantiate("RoR2/Base/Brother/BrotherSunderWave.prefab", "SurfProjectile", registerNetwork: true);
		genericPrimary = DamageTypeCombo.GenericPrimary;
		DamageAPI.AddModdedDamageType(ref genericPrimary, waterDMG);
		surfProjectile.GetComponent<ProjectileDamage>().damageType = genericPrimary;
		surfProjectile.GetComponent<ProjectileController>().ghostPrefab = surfProjectileGhost;
		surfProjectile.GetComponent<CharacterController>().radius = 0f;
		ProjectileCharacterController component3 = surfProjectile.GetComponent<ProjectileCharacterController>();
		component3.velocity = 20f;
		component3.lifetime = 8f;
		((Component)surfProjectile.transform.GetChild(0)).transform.localScale = new Vector3(45f, 30f, 20f);
		ProjectileOverlapAttack component4 = surfProjectile.GetComponent<ProjectileOverlapAttack>();
		component4.impactEffect = waterHit;
		component4.resetInterval = 2f;
		component4.pushAwayForce = 2400f;
		ProjectileImpactExplosion val15 = surfProjectile.AddComponent<ProjectileImpactExplosion>();
		val15.destroyOnWorld = false;
		val15.impactOnWorld = false;
		val15.destroyOnEnemy = false;
		val15.detonateOnEnemy = false;
		val15.lifetime = 4f;
		((ProjectileExplosion)val15).fireChildren = true;
		((ProjectileExplosion)val15).childrenCount = 1;
		((ProjectileExplosion)val15).childrenInheritDamageType = true;
		((ProjectileExplosion)val15).childrenProjectilePrefab = waterPuddleProjectileDotZone;
		((ProjectileExplosion)val15).childrenDamageCoefficient = 0.1f;
		val15.impactEffect = surfProjectileExplosion;
		val15.explodeOnLifeTimeExpiration = false;
		surfProjectile.AddComponent<SurfProjectileBehaviour>();
		surfProjectile.AddComponent<SoundLoop>().soundID = "Play_Wooper_Water_Projectile_Low";
		ContentAddition.AddProjectile(surfProjectile);
		mudProjectileImpact = Instantiate("RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelExplosion.prefab", "MudProjectileImpact");
		Object.Destroy((Object)(object)mudProjectileImpact.GetComponent<ShakeEmitter>());
		((Component)mudProjectileImpact.GetComponentInChildren<Decal>()).gameObject.SetActive(false);
		ParticleSystem[] componentsInChildren8 = mudProjectileImpact.GetComponentsInChildren<ParticleSystem>();
		foreach (ParticleSystem val16 in componentsInChildren8)
		{
			MainModule main6 = val16.main;
			((MainModule)(ref main6)).loop = false;
			ParticleSystemRenderer component5 = ((Component)val16).GetComponent<ParticleSystemRenderer>();
			switch (((Object)val16).name)
			{
			case "Flash":
				((Component)val16).gameObject.SetActive(false);
				break;
			case "Goo":
				((Renderer)component5).material = material2;
				break;
			case "Ring":
				((Renderer)component5).material = material6;
				break;
			case "Goo, Billboard":
				((Renderer)component5).material = material5;
				break;
			}
		}
		ContentAddition.AddEffect(mudProjectileImpact);
		mudProjectileGhost = Instantiate("RoR2/Base/ClayBoss/TarballGhost.prefab", "MudProjectileGhost");
		TrailRenderer componentInChildren = mudProjectileGhost.GetComponentInChildren<TrailRenderer>();
		componentInChildren.widthMultiplier = 0.7f;
		componentInChildren.time = 0.35f;
		((Renderer)componentInChildren).material = material;
		MeshRenderer componentInChildren2 = mudProjectileGhost.GetComponentInChildren<MeshRenderer>();
		((Renderer)componentInChildren2).enabled = false;
		((Component)componentInChildren2).transform.localPosition = Vector3.zero;
		ParticleSystemRenderer[] componentsInChildren9 = mudProjectileGhost.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val17 in componentsInChildren9)
		{
			string name = ((Object)val17).name;
			if (name == "Goo")
			{
				((Renderer)val17).material = material2;
			}
			else
			{
				((Renderer)val17).material = material;
			}
			MainModule main7 = ((Component)val17).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main7)).loop = true;
			Transform transform2 = ((Component)val17).transform;
			transform2.localScale *= 0.35f;
		}
		mudProjectile = Instantiate("RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelProjectile.prefab", "MudProjectile", registerNetwork: true);
		genericPrimary = DamageTypeCombo.GenericPrimary | DamageTypeCombo.op_Implicit((DamageType)8);
		DamageAPI.AddModdedDamageType(ref genericPrimary, groundDMG);
		mudProjectile.GetComponent<ProjectileDamage>().damageType = genericPrimary;
		mudProjectile.GetComponent<ProjectileController>().ghostPrefab = mudProjectileGhost;
		mudProjectile.GetComponent<ProjectileImpactExplosion>().impactEffect = mudProjectileImpact;
		mudProjectile.GetComponent<Rigidbody>().useGravity = false;
		mudProjectile.AddComponent<DelayedGravity>();
		ContentAddition.AddProjectile(mudProjectile);
		Texture2D val18 = Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampAreaIndicator.png");
		mudPuddleProjectileDotZoneGhost = Instantiate("RoR2/Base/ClayBoss/ClayBossSpawnEffect.prefab", "MudPuddleProjectileDotZoneGhost");
		Object.Destroy((Object)(object)mudPuddleProjectileDotZoneGhost.GetComponent<AnimateShaderAlpha>());
		mudPuddleProjectileDotZoneGhost.AddComponent<ProjectileGhostController>();
		mudPuddleProjectileDotZoneGhost.GetComponent<AlignToNormal>().maxDistance = 10f;
		Material val19 = new Material(Load<Material>("RoR2/Base/Clay/matClayBossGooDecal.mat"));
		val19.SetColor("_Color", Color32.op_Implicit(new Color32((byte)19, (byte)7, (byte)4, byte.MaxValue)));
		val19.SetFloat("_DecalSrcBlend", 5f);
		val19.SetFloat("_DecalDstBlend", 12f);
		val19.SetTexture("_RemapTex", (Texture)(object)val18);
		mudPuddleProjectileDotZoneGhost.GetComponentInChildren<Decal>(true).Material = val19;
		ParticleSystem[] componentsInChildren10 = mudPuddleProjectileDotZoneGhost.GetComponentsInChildren<ParticleSystem>(true);
		foreach (ParticleSystem val20 in componentsInChildren10)
		{
			MainModule main8 = val20.main;
			((MainModule)(ref main8)).duration = 1f;
			((MainModule)(ref main8)).loop = true;
			ParticleSystemRenderer component6 = ((Component)val20).GetComponent<ParticleSystemRenderer>();
			string name2 = ((Object)val20).name;
			if (name2 == "FizzBurst")
			{
				((Renderer)component6).material = material5;
				continue;
			}
			Material val21 = new Material(((Renderer)component6).material);
			val21.SetColor("_EmissionColor", val2);
			((Renderer)component6).material = val21;
		}
		mudPuddleProjectileDotZone = Instantiate(obj2, "MudPuddleProjectileDotZone", registerNetwork: true);
		HitBox[] hitBoxes = mudPuddleProjectileDotZone.GetComponent<HitBoxGroup>().hitBoxes;
		foreach (HitBox val22 in hitBoxes)
		{
			((Component)val22).transform.parent = mudPuddleProjectileDotZone.transform;
		}
		Object.Destroy((Object)(object)((Component)mudPuddleProjectileDotZone.transform.GetChild(0)).gameObject);
		TeamAreaIndicator componentInChildren3 = mudPuddleProjectileDotZone.GetComponentInChildren<TeamAreaIndicator>();
		Material val23 = new Material(val13);
		val23.SetColor("_Color", Color32.op_Implicit(new Color32((byte)19, (byte)7, (byte)4, byte.MaxValue)));
		val23.SetTexture("_MaskTex", (Texture)(object)val3);
		val23.SetFloat("_DecalSrcBlend", 5f);
		val23.SetFloat("_DecalDstBlend", 12f);
		val23.SetTexture("_Cloud1Tex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/texCloudWaterFoam2.psd"));
		val23.SetTextureScale("_Cloud1Tex", Vector2.one * 12f);
		val23.SetTexture("_RemapTex", (Texture)(object)val18);
		Object.Destroy((Object)(object)componentInChildren3);
		genericPrimary = DamageTypeCombo.Generic;
		DamageAPI.AddModdedDamageType(ref genericPrimary, waterDMG);
		mudPuddleProjectileDotZone.GetComponent<ProjectileController>().ghostPrefab = mudPuddleProjectileDotZoneGhost;
		genericPrimary = DamageTypeCombo.GenericSecondary;
		DamageAPI.AddModdedDamageType(ref genericPrimary, waterDMG);
		mudPuddleProjectileDotZone.GetComponent<ProjectileDamage>().damageType = genericPrimary;
		ProjectileDotZone component7 = mudPuddleProjectileDotZone.GetComponent<ProjectileDotZone>();
		component7.lifetime = 7f;
		component7.damageCoefficient = 0.25f;
		component7.overlapProcCoefficient = 0.3f;
		component7.fireFrequency = 4f;
		ContentAddition.AddProjectile(mudPuddleProjectileDotZone);
		mudPuddleProjectile = Instantiate(mudProjectile, "MudPuddleProjectile", registerNetwork: true);
		mudPuddleProjectile.GetComponent<ProjectileSimple>().desiredForwardSpeed = 10f;
		ProjectileImpactExplosion component8 = mudPuddleProjectile.GetComponent<ProjectileImpactExplosion>();
		((ProjectileExplosion)component8).childrenCount = 1;
		((ProjectileExplosion)component8).fireChildren = true;
		((ProjectileExplosion)component8).childrenDamageCoefficient = 1f;
		((ProjectileExplosion)component8).childrenProjectilePrefab = mudPuddleProjectileDotZone;
		((ProjectileExplosion)component8).blastDamageCoefficient = 0f;
		component8.destroyOnEnemy = false;
		component8.detonateOnEnemy = false;
		component8.destroyOnWorld = true;
		component8.impactOnWorld = true;
		((ProjectileExplosion)component8).blastRadius = 20f;
		component8.impactEffect = mudPuddleProjectileImpact;
		((ProjectileExplosion)component8).childrenInheritDamageType = false;
		mudPuddleProjectile.GetComponent<Rigidbody>().useGravity = true;
		ContentAddition.AddProjectile(mudPuddleProjectile);
		Texture2D val24 = Load<Texture2D>("RoR2/DLC2/Items/SpeedBoostPickup/texElusiveAntlersRamp.png");
		whirlpoolProjectileGhost = Instantiate("RoR2/Base/ElementalRings/FireTornadoGhost.prefab", "WhirlpoolProjectileGhost");
		whirlpoolProjectileGhost.GetComponentInChildren<Light>(true).color = Color.cyan;
		ParticleSystemRenderer[] componentsInChildren11 = whirlpoolProjectileGhost.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val25 in componentsInChildren11)
		{
			MainModule main9 = ((Component)val25).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main9)).simulationSpeed = 2f;
			((MainModule)(ref main9)).duration = 0.6f;
			switch (((Object)val25).name)
			{
			case "TornadoMeshCore":
			{
				((Component)val25).transform.localScale = new Vector3(8f, 8f, 0.05f);
				((MainModule)(ref main9)).loop = true;
				Material val27 = new Material(((Renderer)val25).material);
				val27.SetTexture("_MainTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/TiledTextures/texCloudWaterRipples.png"));
				val27.SetTexture("_RemapTex", (Texture)(object)val24);
				val27.SetTexture("_Cloud2Tex", (Texture)null);
				((Renderer)val25).material = val27;
				break;
			}
			case "TornadoMeshCore, Wide":
			{
				((Component)val25).transform.localScale = new Vector3(1.4f, 1.4f, 2f);
				((MainModule)(ref main9)).loop = true;
				Material val26 = new Material(Load<Material>("RoR2/Base/Common/VFX/mageMageFireStarburst.mat"));
				val26.SetTexture("_RemapTex", (Texture)(object)val24);
				val26.SetTexture("_Cloud1Tex", (Texture)(object)val3);
				val26.SetTexture("_Cloud2Tex", (Texture)null);
				((Renderer)val25).material = val26;
				break;
			}
			case "TornadoBurst":
			case "RuneRings":
			case "Embers":
				((Component)val25).gameObject.SetActive(false);
				break;
			}
		}
		whirlpoolProjectile = Instantiate(obj2, "WhirlpoolProjectile", registerNetwork: true);
		HitBox[] hitBoxes2 = whirlpoolProjectile.GetComponent<HitBoxGroup>().hitBoxes;
		foreach (HitBox val28 in hitBoxes2)
		{
			((Component)val28).transform.parent = whirlpoolProjectile.transform;
		}
		Object.Destroy((Object)(object)((Component)whirlpoolProjectile.transform.GetChild(0)).gameObject);
		genericPrimary = DamageTypeCombo.GenericSecondary;
		DamageAPI.AddModdedDamageType(ref genericPrimary, waterDMG);
		whirlpoolProjectile.GetComponent<ProjectileDamage>().damageType = genericPrimary;
		ProjectileController component9 = whirlpoolProjectile.GetComponent<ProjectileController>();
		component9.ghostPrefab = whirlpoolProjectileGhost;
		component9.flightSoundLoop = Load<LoopSoundDef>("RoR2/Base/ElementalRings/lsdFireTornado.asset");
		RadialForce val29 = whirlpoolProjectile.AddComponent<RadialForce>();
		val29.radius = 15f;
		val29.damping = 0.5f;
		val29.forceMagnitude = -1500f;
		val29.forceCoefficientAtEdge = 0.5f;
		val29.alwaysApply = true;
		((Component)whirlpoolProjectile.transform.GetChild(0).GetChild(0)).gameObject.SetActive(false);
		ProjectileDotZone component10 = whirlpoolProjectile.GetComponent<ProjectileDotZone>();
		component10.lifetime = 6f;
		component10.damageCoefficient = 0.25f;
		component10.overlapProcCoefficient = 0.3f;
		component10.fireFrequency = 4f;
		ContentAddition.AddProjectile(whirlpoolProjectile);
		spitUpProjectileGhost = Instantiate(Assets.Load<GameObject>("SpitUpProjectile"), "SpitUpProjectileGhost");
		spitUpProjectileGhost.AddComponent<ProjectileGhostController>();
		spitUpProjectile = Instantiate("RoR2/Base/Lemurian/Fireball.prefab", "SpitUpProjectile", registerNetwork: true);
		spitUpProjectile.GetComponent<ProjectileController>().ghostPrefab = spitUpProjectileGhost;
		spitUpProjectile.GetComponent<ProjectileSingleTargetImpact>().impactEffect = spitUpHit;
		spitUpProjectile.AddComponent<SoundLoop>().soundID = "Play_Wooper_SpitUp_Fire";
		ContentAddition.AddProjectile(spitUpProjectile);
	}

	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(Texture tex)
	{
		//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_003b: 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", tex);
			val.SetColor("_EmColor", Color.black);
			val.SetFloat("_EmPower", 0f);
			val.SetTexture("_EmTex", (Texture)null);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", (Texture)null);
			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 FireAimAreaIndicatorState : WooperState
{
	public Vector3 point;

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

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

	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 AimAreaIndicatorState : WooperState
{
	private GameObject areaIndicator;

	public bool valid;

	public Vector3 point;

	public virtual float radius => 12f;

	public virtual float distance => 9999f;

	public override void OnEnter()
	{
		//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)
		base.OnEnter();
		((BaseState)this).StartAimMode(2f, false);
		areaIndicator = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab);
		areaIndicator.transform.localScale = Vector3.one * radius;
	}

	public override void Update()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			areaIndicator.transform.forward = Utils.GetForwardDirection(((Ray)(ref aimRay)).direction);
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(aimRay, ref val, distance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
			{
				areaIndicator.SetActive(true);
				areaIndicator.transform.position = ((RaycastHit)(ref val)).point;
				point = ((RaycastHit)(ref val)).point;
				valid = true;
			}
			else
			{
				valid = false;
				areaIndicator.SetActive(false);
			}
		}
	}

	public virtual FireAimAreaIndicatorState GetState()
	{
		return null;
	}

	public override void FixedUpdate()
	{
		//IL_003e: 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)
		base.FixedUpdate();
		if (!((EntityState)this).isAuthority || ((BaseSkillState)this).IsKeyDownAuthority())
		{
			return;
		}
		if (valid)
		{
			FireAimAreaIndicatorState state = GetState();
			if (state != null)
			{
				state.point = point;
				((EntityState)this).outer.SetNextState((EntityState)(object)state);
				return;
			}
		}
		((EntityState)this).outer.SetNextStateToMain();
	}

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)2;
	}
}
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 MeleeSkillState : BaseSkillState
{
	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 Animator animator;

	public int attackIndex = 1;

	private GameObject swingEffectInstance;

	public List<HurtBox> hitList = new List<HurtBox>();

	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 DamageTypeCombo damageType => DamageTypeCombo.op_Implicit((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 finisher => attackIndex == 2;

	public virtual bool scaleSwingEffectSpeed => false;

	public virtual bool isButtonDown => ((EntityState)this).inputBank.skill1.down;

	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)
		((BaseState)this).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 = 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, 0.1f);
			}
			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)
		((EntityState)this).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 (isButtonDown)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val2 = StateOverride();
					if (val2 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val2);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (!(animator.GetFloat(hitBoxActiveParameter) >= 0.11f) || 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 override void OnExit()
	{
		if (Object.op_Implicit((Object)(object)swingEffectInstance))
		{
			EntityState.Destroy((Object)(object)swingEffectInstance);
		}
		((EntityState)this).OnExit();
	}

	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<GameObjec