Decompiled source of SaltlordsPlayableTurretFork v1.0.0

PlayableTurretMod.dll

Decompiled 13 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.ClayBruiser.Weapon;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.EngiTurret.EngiTurretWeapon;
using EntityStates.GolemMonster;
using EntityStates.Huntress;
using EntityStates.LunarExploderMonster.Weapon;
using EntityStates.Mage.Weapon;
using EntityStates.Toolbot;
using EntityStates.Treebot.Weapon;
using Microsoft.CodeAnalysis;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("PlayableTurretMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PlayableTurretMod")]
[assembly: AssemblyTitle("PlayableTurretMod")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PlayableTurretMod
{
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

		private static string ToString(object o)
		{
			return o?.ToString() ?? "null";
		}

		internal static void LogTrace(object data)
		{
			StackTrace stackTrace = new StackTrace();
			StackFrame frame = stackTrace.GetFrame(1);
			MethodBase method = frame.GetMethod();
			string text = "[TRACE // " + method.DeclaringType.Name + "::" + method.Name + "]: ";
			text += ToString(data);
			_logSource.Log((LogLevel)32, (object)text);
		}

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

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

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

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

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

		internal static void LogWarning(object data)
		{
			_logSource.LogWarning((object)ToString(data));
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Saltlords.PlayableTurret", "PlayableTurret", "1.0.0")]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "SurvivorAPI", "SoundAPI", "LanguageAPI", "EffectAPI", "LoadoutAPI", "ProjectileAPI", "DamageAPI", "RecalculateStatsAPI", "BuffAPI" })]
	public class TurretPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "Saltlords.PlayableTurret";

		public const string PluginAuthor = "Saltlords";

		public const string PluginName = "PlayableTurret";

		public const string PluginVersion = "1.0.0";

		public const string characterLore = "<style=cMono>[  BEGIN OUTPUT  ]</style>\n\n<style=cIsHealth><i>“ WHAT AM I FIGHTING FOR? ”</i></style>\n<style=cIsHealth>“AM I ONE OF </style>[faction red]</style><style=cIsHealth>?”</style>\n<style=cIsHealth>“AM I ONE OF</style> [faction white]<style=cIsHealth>?”</style>\n\n...\n\n<style=cMono>[  CEASE OUTPUT  ]</style>\n\n<style=cMono>[  BEGIN OUTPUT  ]</style>\n\n“Take note of the <style=cIsDamage>ratios</style>.”\n“High speed. Speed is war.”\n“Quadrupeds are easier, and more stable.”\n“We deviate from that.”\n“Powered by refuse – all material has value. Quality of components reduces stability.”\n“I will tie destruction with destruction.”\n\n...\n\n<style=cMono>[  CEASE OUTPUT  ]\n\n> TRANSLATION ERRORS: 2\n\n> [faction red]; CANNOT TRANSLATE\n\n> [faction white]; CANNOT TRANSLATE</style>\n\n========================================\n\nTranslation powered by NewGenesis0. Al?l r?ights? r?????????.</style>";

		public static ConfigFile Config;

		public static ConfigEntry<string> MajorConstructSpawn;

		public const bool resize = false;

		public static GameObject body;

		private static SerializableEntityStateType UtilCreateSerializableAndNetRegister<T>() where T : EntityState
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			Log.LogTrace("Registering EntityState " + typeof(T).FullName + " and returning a new instance of SerializableEntityStateType of that type...");
			bool flag = false;
			ContentAddition.AddEntityState<T>(ref flag);
			return new SerializableEntityStateType(typeof(T));
		}

		public static int FindCategoryIndexByName(DirectorCardCategorySelection dcs, string categoryName)
		{
			for (int i = 0; i < dcs.categories.Length; i++)
			{
				if (string.CompareOrdinal(dcs.categories[i].name, categoryName) == 0)
				{
					return i;
				}
			}
			return -1;
		}

		public static List<string> listify(string list)
		{
			return list.Split(new char[1] { ',' }).ToList().ConvertAll((string x) => x.Trim());
		}

		public static float GetICBMDamageMult(CharacterBody body)
		{
			float num = 1f;
			if ((Object)(object)body != (Object)null && (Object)(object)body.inventory != (Object)null)
			{
				int itemCount = body.inventory.GetItemCount(Items.MoreMissile);
				int num2 = itemCount - 1;
				if (num2 > 0)
				{
					num += (float)num2 * 0.5f;
				}
			}
			return num;
		}

		public void Awake()
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_052c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: 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_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0601: Unknown result type (might be due to invalid IL or missing references)
			//IL_0637: Unknown result type (might be due to invalid IL or missing references)
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0721: Unknown result type (might be due to invalid IL or missing references)
			//IL_0769: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_0849: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a79: 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_0a9d: Expected O, but got Unknown
			//IL_0a9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad9: Expected O, but got Unknown
			//IL_0ada: Unknown result type (might be due to invalid IL or missing references)
			//IL_0adc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b16: Expected O, but got Unknown
			//IL_0b17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b53: Expected O, but got Unknown
			//IL_0b54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b90: Expected O, but got Unknown
			//IL_0b91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e06: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Logger.LogWarning((object)"MegaSurvivorPack is loading...");
			SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
			GameObject val2 = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/EngiWalkerTurretBody"), "PCBeetleBody");
			val2.AddComponent<EquipmentSlot>();
			val2.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
			GenericSkill[] componentsInChildren = val2.GetComponentsInChildren<GenericSkill>();
			GenericSkill[] array = componentsInChildren;
			foreach (GenericSkill val3 in array)
			{
				((BaseUnityPlugin)this).Logger.LogMessage((object)"Cleaning out skills");
				Object.DestroyImmediate((Object)val3);
			}
			SkillLocator component = val2.GetComponent<SkillLocator>();
			Reflection.SetFieldValue<GenericSkill[]>((object)component, "allSkills", (GenericSkill[])(object)new GenericSkill[0]);
			component.primary = val2.GetComponent<GenericSkill>();
			((BaseUnityPlugin)this).Logger.LogMessage((object)"Replacing Primary");
			component.primary = val2.AddComponent<GenericSkill>();
			SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>();
			val4.variants = (Variant[])(object)new Variant[0];
			Reflection.SetFieldValue<SkillFamily>((object)component.primary, "_skillFamily", val4);
			component.secondary = val2.GetComponent<GenericSkill>();
			((BaseUnityPlugin)this).Logger.LogMessage((object)"Replacing Secondary");
			component.secondary = val2.AddComponent<GenericSkill>();
			SkillFamily val5 = ScriptableObject.CreateInstance<SkillFamily>();
			val5.variants = (Variant[])(object)new Variant[0];
			Reflection.SetFieldValue<SkillFamily>((object)component.secondary, "_skillFamily", val5);
			component.utility = val2.GetComponent<GenericSkill>();
			((BaseUnityPlugin)this).Logger.LogMessage((object)"Replacing Utility");
			component.utility = val2.AddComponent<GenericSkill>();
			SkillFamily val6 = ScriptableObject.CreateInstance<SkillFamily>();
			val6.variants = (Variant[])(object)new Variant[0];
			Reflection.SetFieldValue<SkillFamily>((object)component.utility, "_skillFamily", val6);
			component.special = val2.GetComponent<GenericSkill>();
			((BaseUnityPlugin)this).Logger.LogMessage((object)"Replacing Special");
			component.special = val2.AddComponent<GenericSkill>();
			SkillFamily val7 = ScriptableObject.CreateInstance<SkillFamily>();
			val7.variants = (Variant[])(object)new Variant[0];
			Reflection.SetFieldValue<SkillFamily>((object)component.special, "_skillFamily", val7);
			SkillDef val8 = ScriptableObject.CreateInstance<SkillDef>();
			val8.activationState = new SerializableEntityStateType(typeof(FireBeam));
			val8.activationStateMachineName = "Weapon";
			val8.baseMaxStock = 1;
			val8.baseRechargeInterval = 0f;
			val8.beginSkillCooldownOnSkillEnd = false;
			val8.canceledFromSprinting = false;
			val8.cancelSprintingOnActivation = true;
			val8.fullRestockOnAssign = true;
			val8.interruptPriority = (InterruptPriority)0;
			val8.isCombatSkill = true;
			val8.mustKeyPress = false;
			val8.rechargeStock = 1;
			val8.requiredStock = 1;
			val8.stockToConsume = 0;
			val8.skillDescriptionToken = "CARBTURRET_PRIMARY_BULLT_DESCRIPTION";
			val8.skillName = "CARBTURRET_PRIMARY_BULLT_NAME";
			val8.skillNameToken = "CARBTURRET_PRIMARY_BULLT_NAME";
			val8.icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/CommandoBodyFireFMJ.asset").WaitForCompletion().icon;
			SkillDef val9 = ScriptableObject.CreateInstance<SkillDef>();
			val9.activationState = new SerializableEntityStateType(typeof(FireExploderShards));
			val9.activationStateMachineName = "Weapon";
			val9.baseMaxStock = 8;
			val9.baseRechargeInterval = 1f;
			val9.beginSkillCooldownOnSkillEnd = false;
			val9.canceledFromSprinting = false;
			val9.cancelSprintingOnActivation = true;
			val9.fullRestockOnAssign = true;
			val9.interruptPriority = (InterruptPriority)1;
			val9.isCombatSkill = true;
			val9.mustKeyPress = false;
			val9.rechargeStock = 1;
			val9.requiredStock = 1;
			val9.stockToConsume = 1;
			val9.skillDescriptionToken = "CARBTURRET_SECONDARY_STRONG_DESCRIPTION";
			val9.skillName = "CARBTURRET_SECONDARY_STRONG_NAME";
			val9.skillNameToken = "CARBTURRET_SECONDARY_STRONG_NAME";
			val9.icon = ((SkillDef)Addressables.LoadAssetAsync<ToolbotWeaponSkillDef>((object)"RoR2/Base/Toolbot/ToolbotBodyFireGrenadeLauncher.asset").WaitForCompletion()).icon;
			SkillDef val10 = ScriptableObject.CreateInstance<SkillDef>();
			LanguageAPI.Add("KEYWORD_WEAK23", "<style=cKeywordName>Weaken</style><style=cSub>Reduce movement speed and damage by <style=cIsDamage>40%</style>. Reduce armor by <style=cIsDamage>30</style>.</style>");
			val10.activationState = new SerializableEntityStateType(typeof(ChargeSonicBoom));
			val10.activationStateMachineName = "Weapon";
			val10.baseMaxStock = 1;
			val10.baseRechargeInterval = 5.5f;
			val10.beginSkillCooldownOnSkillEnd = false;
			val10.canceledFromSprinting = false;
			val10.cancelSprintingOnActivation = false;
			val10.fullRestockOnAssign = true;
			val10.interruptPriority = (InterruptPriority)1;
			val10.isCombatSkill = true;
			val10.mustKeyPress = true;
			val10.rechargeStock = 1;
			val10.requiredStock = 1;
			val10.stockToConsume = 1;
			val10.skillDescriptionToken = "CARBTURRET_UTILITY_DISP_DESCRIPTION";
			val10.skillName = "CARBTURRET_UTILITY_DISP_NAME";
			val10.skillNameToken = "CARBTURRET_UTILITY_DISP_NAME";
			val10.icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Treebot/TreebotBodySonicBoom.asset").WaitForCompletion().icon;
			val10.keywordTokens = new string[1] { "KEYWORD_WEAK23" };
			SkillDef val11 = ScriptableObject.CreateInstance<SkillDef>();
			val11.activationState = new SerializableEntityStateType(typeof(FireShotgunBlast));
			val11.activationStateMachineName = "Weapon";
			val11.baseMaxStock = 1;
			val11.baseRechargeInterval = 6f;
			val11.beginSkillCooldownOnSkillEnd = false;
			val11.canceledFromSprinting = false;
			val11.cancelSprintingOnActivation = false;
			val11.fullRestockOnAssign = true;
			val11.interruptPriority = (InterruptPriority)1;
			val11.isCombatSkill = true;
			val11.mustKeyPress = true;
			val11.rechargeStock = 1;
			val11.requiredStock = 1;
			val11.stockToConsume = 1;
			val11.skillDescriptionToken = "CARBTURRET_SPECIAL_SPORE_DESCRIPTION";
			val11.skillName = "CARBTURRET_SPECIAL_SPORE_NAME";
			val11.skillNameToken = "CARBTURRET_SPECIAL_SPORE_NAME";
			val11.icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/CommandoBodyFireShotgunBlast.asset").WaitForCompletion().icon;
			SkillDef val12 = ScriptableObject.CreateInstance<SkillDef>();
			val12.activationState = new SerializableEntityStateType(typeof(FireGauss));
			val12.activationStateMachineName = "Weapon";
			val12.baseMaxStock = 1;
			val12.baseRechargeInterval = 0f;
			val12.beginSkillCooldownOnSkillEnd = false;
			val12.canceledFromSprinting = false;
			val12.cancelSprintingOnActivation = true;
			val12.fullRestockOnAssign = true;
			val12.interruptPriority = (InterruptPriority)0;
			val12.isCombatSkill = true;
			val12.mustKeyPress = false;
			val12.rechargeStock = 1;
			val12.requiredStock = 1;
			val12.stockToConsume = 0;
			val12.skillDescriptionToken = "CARBTURRET_PRIMARY_BULLT2_DESCRIPTION";
			val12.skillName = "CARBTURRET_PRIMARY_BULLT2_NAME";
			val12.skillNameToken = "CARBTURRET_PRIMARY_BULLT2_NAME";
			val12.icon = ((SkillDef)Addressables.LoadAssetAsync<ReloadSkillDef>((object)"RoR2/Base/Bandit2/Bandit2Blast.asset").WaitForCompletion()).icon;
			SkillDef val13 = ScriptableObject.CreateInstance<SkillDef>();
			LanguageAPI.Add("KEYWORD_FREIZA", "<style=cKeywordName>Freezing</style><style=cSub>Freeze enemies in place. Frozen enemies are <style=cIsHealth>instantly killed</style> if below <style=cIsHealth>30%</style> health.</style>");
			val13.activationState = new SerializableEntityStateType(typeof(PrepWall));
			val13.activationStateMachineName = "Weapon";
			val13.baseMaxStock = 1;
			val13.baseRechargeInterval = 12f;
			val13.beginSkillCooldownOnSkillEnd = true;
			val13.canceledFromSprinting = false;
			val13.cancelSprintingOnActivation = false;
			val13.fullRestockOnAssign = true;
			val13.interruptPriority = (InterruptPriority)1;
			val13.isCombatSkill = true;
			val13.mustKeyPress = true;
			val13.rechargeStock = 1;
			val13.requiredStock = 1;
			val13.stockToConsume = 1;
			val13.skillDescriptionToken = "CARBTURRET_SECONDARY_STRONG2_DESCRIPTION";
			val13.skillName = "CARBTURRET_SECONDARY_STRONG2_NAME";
			val13.skillNameToken = "CARBTURRET_SECONDARY_STRONG2_NAME";
			val13.icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Mage/MageBodyWall.asset").WaitForCompletion().icon;
			val13.keywordTokens = new string[1] { "KEYWORD_FREIZA" };
			SkillDef val14 = ScriptableObject.CreateInstance<SkillDef>();
			val14.activationState = new SerializableEntityStateType(typeof(BlinkState));
			val14.activationStateMachineName = "Weapon";
			val14.baseMaxStock = 1;
			val14.baseRechargeInterval = 8f;
			val14.beginSkillCooldownOnSkillEnd = true;
			val14.canceledFromSprinting = false;
			val14.cancelSprintingOnActivation = false;
			val14.fullRestockOnAssign = true;
			val14.interruptPriority = (InterruptPriority)1;
			val14.isCombatSkill = true;
			val14.mustKeyPress = true;
			val14.rechargeStock = 1;
			val14.requiredStock = 1;
			val14.stockToConsume = 1;
			val14.skillDescriptionToken = "CARBTURRET_UTILITY_DISP2_DESCRIPTION";
			val14.skillName = "CARBTURRET_UTILITY_DISP2_NAME";
			val14.skillNameToken = "CARBTURRET_UTILITY_DISP2_NAME";
			val14.icon = ((SkillDef)Addressables.LoadAssetAsync<MercDashSkillDef>((object)"RoR2/Base/Merc/MercBodyAssaulter.asset").WaitForCompletion()).icon;
			SkillDef val15 = ScriptableObject.CreateInstance<SkillDef>();
			LanguageAPI.Add("KEYWORD_STUNNAIZA", "<style=cKeywordName>Stunning</style><style=cSub>Interrupts enemies and briefly stuns them.</style>");
			val15.activationState = new SerializableEntityStateType(typeof(AimStunDrone));
			val15.activationStateMachineName = "Weapon";
			val15.baseMaxStock = 1;
			val15.baseRechargeInterval = 6f;
			val15.beginSkillCooldownOnSkillEnd = false;
			val15.canceledFromSprinting = false;
			val15.cancelSprintingOnActivation = false;
			val15.fullRestockOnAssign = true;
			val15.interruptPriority = (InterruptPriority)1;
			val15.isCombatSkill = true;
			val15.mustKeyPress = true;
			val15.rechargeStock = 1;
			val15.requiredStock = 1;
			val15.stockToConsume = 1;
			val15.skillDescriptionToken = "CARBTURRET_SPECIAL_SPORE2_DESCRIPTION";
			val15.skillName = "CARBTURRET_SPECIAL_SPORE2_NAME";
			val15.skillNameToken = "CARBTURRET_SPECIAL_SPORE2_NAME";
			val15.icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Toolbot/ToolbotBodyStunDrone.asset").WaitForCompletion().icon;
			ContentAddition.AddSkillDef(val8);
			ContentAddition.AddSkillDef(val10);
			ContentAddition.AddSkillDef(val9);
			ContentAddition.AddSkillDef(val11);
			ContentAddition.AddSkillDef(val12);
			ContentAddition.AddSkillDef(val13);
			ContentAddition.AddSkillDef(val14);
			ContentAddition.AddSkillDef(val15);
			((BaseUnityPlugin)this).Logger.LogMessage((object)"Skilldefs added");
			LanguageAPI.Add("CARBTURRET_PRIMARY_BULLT_NAME", "APPLY_FORCE");
			LanguageAPI.Add("CARBTURRET_PRIMARY_BULLT_DESCRIPTION", "Fire a <style=cIsUtility>slowing</style> continuous short-range beam for <style=cIsDamage>200% damage</style> per second.");
			LanguageAPI.Add("CARBTURRET_SECONDARY_STRONG_NAME", "APPLY_SUPRESSION");
			LanguageAPI.Add("CARBTURRET_SECONDARY_STRONG_DESCRIPTION", "Fire an <style=cIsDamage>orb</style> for <style=cIsDamage>200% damage</style>. Can hold up to <style=cIsDamage>8</style>.");
			LanguageAPI.Add("CARBTURRET_UTILITY_DISP_NAME", "DISPERSE");
			LanguageAPI.Add("CARBTURRET_UTILITY_DISP_DESCRIPTION", "Fire a <style=cIsUtility>Sonic Boom</style> that <style=cIsDamage>Weakens</style> all enemies on hit.");
			LanguageAPI.Add("CARBTURRET_SPECIAL_SPORE_NAME", "SHATTER");
			LanguageAPI.Add("CARBTURRET_SPECIAL_SPORE_DESCRIPTION", "Fire two close-range blasts that deal <style=cIsDamage>8x200% damage</style> total.");
			LanguageAPI.Add("CARBTURRET_PRIMARY_BULLT2_NAME", "APPLY_PRESSURE");
			LanguageAPI.Add("CARBTURRET_PRIMARY_BULLT2_DESCRIPTION", "Fire a <style=cIsUtility>gauss blast</style> for <style=cIsDamage>100% damage</style>.");
			LanguageAPI.Add("CARBTURRET_SECONDARY_STRONG2_NAME", "APPLY_OPPRESSION");
			LanguageAPI.Add("CARBTURRET_SECONDARY_STRONG2_DESCRIPTION", "<style=cIsUtility>Freezing</style>. Create a barrier that hurts enemies for <style=cIsDamage>100% damage</style>.");
			LanguageAPI.Add("CARBTURRET_UTILITY_DISP2_NAME", "FLICKER");
			LanguageAPI.Add("CARBTURRET_UTILITY_DISP2_DESCRIPTION", "<style=cIsUtility>Disappear</style> and <style=cIsUtility>teleport</style> forward.");
			LanguageAPI.Add("CARBTURRET_SPECIAL_SPORE2_NAME", "DISCOMBOBULATE");
			LanguageAPI.Add("CARBTURRET_SPECIAL_SPORE2_DESCRIPTION", "<style=cIsDamage>Stunning</style>. Launch a canister for <style=cIsDamage>220% damage</style>. Drops <style=cIsDamage>stun</style> bomblets for <style=cIsDamage>5x44%</style> damage.");
			SkillFamily skillFamily = component.primary.skillFamily;
			SkillFamily skillFamily2 = component.secondary.skillFamily;
			SkillFamily skillFamily3 = component.utility.skillFamily;
			SkillFamily skillFamily4 = component.special.skillFamily;
			SkillDef val16 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Heretic/HereticDefaultAbility.asset").WaitForCompletion();
			if ((Object)(object)val16 == (Object)null)
			{
				throw new InvalidOperationException("Could not load HereticDefaultAbility SkillDef.");
			}
			Variant[] array2 = new Variant[2];
			Variant val17 = new Variant
			{
				skillDef = val8
			};
			((Variant)(ref val17)).viewableNode = new Node(val8.skillNameToken, false, (Node)null);
			array2[0] = val17;
			val17 = new Variant
			{
				skillDef = val12,
				unlockableName = ""
			};
			((Variant)(ref val17)).viewableNode = new Node(val12.skillNameToken, false, (Node)null);
			array2[1] = val17;
			skillFamily.variants = (Variant[])(object)array2;
			Variant[] array3 = new Variant[1];
			val17 = new Variant
			{
				skillDef = val16
			};
			((Variant)(ref val17)).viewableNode = new Node(val16.skillNameToken, false, (Node)null);
			array3[0] = val17;
			skillFamily2.variants = (Variant[])(object)array3;
			Variant[] array4 = new Variant[1];
			val17 = new Variant
			{
				skillDef = val16
			};
			((Variant)(ref val17)).viewableNode = new Node(val16.skillNameToken, false, (Node)null);
			array4[0] = val17;
			skillFamily3.variants = (Variant[])(object)array4;
			Variant[] array5 = new Variant[1];
			val17 = new Variant
			{
				skillDef = val16
			};
			((Variant)(ref val17)).viewableNode = new Node(val16.skillNameToken, false, (Node)null);
			array5[0] = val17;
			skillFamily4.variants = (Variant[])(object)array5;
			ContentAddition.AddSkillFamily(val4);
			ContentAddition.AddSkillFamily(val5);
			ContentAddition.AddSkillFamily(val6);
			ContentAddition.AddSkillFamily(val7);
			ContentAddition.AddBody(val2);
			((BaseUnityPlugin)this).Logger.LogMessage((object)"Body added");
			LanguageAPI.Add("PCBeetle_DESC", "The TR58 Carbonizer Turret is a poor survivor, never meant to be one, with awful stats and no abilities." + Environment.NewLine + Environment.NewLine + "<style=cSub><!> “The future is now! Cybernetic enhancements – buy them cheap and become the person you’ve always dreamed of being!”</style>" + Environment.NewLine + Environment.NewLine + "<style=cSub><!> Your beam has a very high proc coefficient, aim for items that have a chance to hit such as 'Ukelele'.</style>");
			LanguageAPI.Add("PCBeetle_LORE", "<style=cMono>[  BEGIN OUTPUT  ]</style>\n\n<style=cIsHealth><i>“ WHAT AM I FIGHTING FOR? ”</i></style>\n<style=cIsHealth>“AM I ONE OF </style>[faction red]</style><style=cIsHealth>?”</style>\n<style=cIsHealth>“AM I ONE OF</style> [faction white]<style=cIsHealth>?”</style>\n\n...\n\n<style=cMono>[  CEASE OUTPUT  ]</style>\n\n<style=cMono>[  BEGIN OUTPUT  ]</style>\n\n“Take note of the <style=cIsDamage>ratios</style>.”\n“High speed. Speed is war.”\n“Quadrupeds are easier, and more stable.”\n“We deviate from that.”\n“Powered by refuse – all material has value. Quality of components reduces stability.”\n“I will tie destruction with destruction.”\n\n...\n\n<style=cMono>[  CEASE OUTPUT  ]\n\n> TRANSLATION ERRORS: 2\n\n> [faction red]; CANNOT TRANSLATE\n\n> [faction white]; CANNOT TRANSLATE</style>\n\n========================================\n\nTranslation powered by NewGenesis0. Al?l r?ights? r?????????.</style>");
			LanguageAPI.Add("PCBeetle_NAME", "TR58 Carbonizer");
			LanguageAPI.Add("PCBeetle_SUBNAME", "Inferior Construct");
			LanguageAPI.Add("SALTCARBON_OUTRO_FLAVOR", "MISSON_(COMPLETE); UPLOADING FOOTAGE TO SERVERS. . .");
			LanguageAPI.Add("SALTCARBON_MAIN_ENDING_ESCAPE_FAILURE_FLAVOR", "My battery is low, and its getting dark...");
			CharacterBody component2 = val2.GetComponent<CharacterBody>();
			CharacterBody val18 = component2;
			val2.GetComponent<Interactor>().maxInteractionDistance = 3f;
			CameraTargetParams component3 = val2.GetComponent<CameraTargetParams>();
			component3.dontRaycastToPivot = true;
			CharacterBody val19 = val18;
			val19.baseMaxHealth *= 1f;
			component2.levelMaxHealth = 33f;
			component2.baseRegen = 1f;
			component2.levelRegen = 0.25f;
			component2.baseArmor = 0f;
			component2.levelArmor = 0f;
			val18 = component2;
			CharacterBody val20 = val18;
			val20.baseDamage *= 1f;
			component2.levelDamage = 2.4f;
			component2.baseCrit = 1f;
			component2.levelCrit = 0f;
			component2.baseMoveSpeed = 8f;
			component2.levelMoveSpeed = 0f;
			component2.baseAttackSpeed = 1f;
			component2.levelAttackSpeed = 0f;
			component2.hideCrosshair = false;
			component2.baseNameToken = "PCBeetle_NAME";
			component2.subtitleNameToken = "PCBeetle_SUBNAME";
			GameObject val21 = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/characterdisplays/engidisplay"), "WalkerBodyDisplay", true);
			Transform val22 = val21.transform.Find("mdlEngi");
			Transform val23 = val21.transform.Find("mdlEngiTurret");
			if ((Object)(object)val22 != (Object)null)
			{
				val22.localPosition = new Vector3(100f, 100f, 100f);
			}
			if ((Object)(object)val23 != (Object)null)
			{
				val23.localPosition = Vector3.zero;
				val23.localRotation = Quaternion.identity;
			}
			SurvivorDef val24 = ScriptableObject.CreateInstance<SurvivorDef>();
			val24.bodyPrefab = val2;
			val24.descriptionToken = "PCBeetle_DESC";
			val24.displayPrefab = val21;
			val24.cachedName = "Inferior Construct";
			val24.desiredSortPosition = 16f;
			val24.bodyPrefab.GetComponent<CharacterBody>().bodyColor = Color32.op_Implicit(new Color32((byte)135, (byte)83, (byte)224, byte.MaxValue));
			val24.mainEndingEscapeFailureFlavorToken = "SALTCARBON_OUTRO_FLAVOR";
			val24.bodyPrefab.GetComponent<CharacterBody>().defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/simpledotcrosshair");
			ContentAddition.AddSurvivorDef(val24);
			GameObject val25 = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/TreebotMonsterMaster"), "WalkerPlayableMonsterMaster", true);
			val25.GetComponent<CharacterMaster>().bodyPrefab = val2;
			ContentAddition.AddMaster(val25);
		}
	}
	public class WalkerChargeBeam : BaseState
	{
		public static float baseDuration = 1f;

		public static float laserMaxWidth = 0.2f;

		private float duration;

		private uint chargePlayID;

		private GameObject chargeEffect;

		private GameObject laserEffect;

		private LineRenderer laserLineComponent;

		private Vector3 laserDirection;

		private Vector3 visualEndPosition;

		private float flashTimer;

		private bool laserOn;

		private Animator animator;

		public override void OnEnter()
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((BaseState)this).StartAimMode(duration + 2f, false);
			((EntityState)this).characterBody.defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/BanditCrosshair");
			chargePlayID = Util.PlayAttackSpeedSound(ChargeLaser.attackSoundString, ((EntityState)this).gameObject, base.attackSpeedStat);
			if ((Object)(object)modelTransform != (Object)null)
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if ((Object)(object)component != (Object)null)
				{
					Transform val = component.FindChild(MinigunState.muzzleName);
					if ((Object)(object)val != (Object)null)
					{
						if ((Object)(object)ChargeLaser.effectPrefab != (Object)null)
						{
							chargeEffect = Object.Instantiate<GameObject>(ChargeLaser.effectPrefab, val.position, val.rotation);
							chargeEffect.transform.parent = val;
							ScaleParticleSystemDuration component2 = chargeEffect.GetComponent<ScaleParticleSystemDuration>();
							if ((Object)(object)component2 != (Object)null)
							{
								component2.newDuration = duration;
							}
						}
						if ((Object)(object)ChargeLaser.laserPrefab != (Object)null)
						{
							laserEffect = Object.Instantiate<GameObject>(ChargeLaser.laserPrefab, val.position, val.rotation);
							laserEffect.transform.parent = val;
							laserLineComponent = laserEffect.GetComponent<LineRenderer>();
						}
					}
				}
			}
			if ((Object)(object)((EntityState)this).characterBody != (Object)null)
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
			}
			flashTimer = 0f;
			laserOn = true;
		}

		public override void OnExit()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			((EntityState)this).OnExit();
			if ((Object)(object)chargeEffect != (Object)null)
			{
				EntityState.Destroy((Object)chargeEffect);
			}
			if ((Object)(object)laserEffect != (Object)null)
			{
				EntityState.Destroy((Object)laserEffect);
			}
		}

		public override void Update()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).Update();
			if ((Object)(object)laserEffect == (Object)null || (Object)(object)laserLineComponent == (Object)null)
			{
				return;
			}
			float num = 1000f;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 position = laserEffect.transform.parent.position;
			Vector3 point = ((Ray)(ref aimRay)).GetPoint(num);
			laserDirection = point - position;
			RaycastHit val = default(RaycastHit);
			Ray val2 = aimRay;
			LayerIndex val3 = LayerIndex.world;
			int num2 = LayerMask.op_Implicit(((LayerIndex)(ref val3)).mask);
			val3 = LayerIndex.entityPrecise;
			if (Physics.Raycast(val2, ref val, num, num2 | LayerMask.op_Implicit(((LayerIndex)(ref val3)).mask)))
			{
				point = ((RaycastHit)(ref val)).point;
			}
			laserLineComponent.SetPosition(0, position);
			laserLineComponent.SetPosition(1, point);
			float num3;
			if (duration - ((EntityState)this).age > 0.5f)
			{
				num3 = ((EntityState)this).age / duration;
			}
			else
			{
				flashTimer -= Time.deltaTime;
				if (flashTimer <= 0f)
				{
					laserOn = !laserOn;
					flashTimer = 1f / 30f;
				}
				num3 = (laserOn ? 1f : 0f);
			}
			num3 *= laserMaxWidth;
			laserLineComponent.startWidth = num3;
			laserLineComponent.endWidth = num3;
		}

		public override void FixedUpdate()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				WalkerFireBeam walkerFireBeam = new WalkerFireBeam();
				walkerFireBeam.laserDirection = laserDirection;
				((EntityState)this).outer.SetNextState((EntityState)walkerFireBeam);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class WalkerFireBeam : BaseState
	{
		public static float damageCoefficient = 8f;

		public static float procCoefficient = 2f;

		public static float force = 500f;

		public static float minSpread = 0f;

		public static float maxSpread = 0f;

		public static int bulletCount = 1;

		public static float baseDuration = 0.5f;

		public static float radius = 1.25f;

		public float recoilAmplitude = 10f;

		public float bloom = 6f;

		public Vector3 laserDirection;

		private float duration;

		private Ray modifiedAimRay;

		private Animator animator;

		public override void OnEnter()
		{
			//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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: 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_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: 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_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: 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_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: 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_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			modifiedAimRay = ((BaseState)this).GetAimRay();
			((Ray)(ref modifiedAimRay)).direction = laserDirection;
			animator = ((EntityState)this).GetModelAnimator();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(2f, false);
			float num = recoilAmplitude / base.attackSpeedStat;
			((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
			((EntityState)this).characterBody.AddSpreadBloom(bloom);
			Util.PlayAttackSpeedSound(FireLaser.attackSoundString, ((EntityState)this).gameObject, 2f);
			string muzzleName = MinigunState.muzzleName;
			if ((Object)(object)FireLaser.effectPrefab != (Object)null)
			{
				EffectManager.SimpleMuzzleFlash(FireLaser.effectPrefab, ((EntityState)this).gameObject, muzzleName, false);
			}
			if (((EntityState)this).isAuthority)
			{
				float num2 = 1000f;
				Vector3 val = ((Ray)(ref modifiedAimRay)).origin + ((Ray)(ref modifiedAimRay)).direction * num2;
				RaycastHit val2 = default(RaycastHit);
				Ray val3 = modifiedAimRay;
				LayerIndex val4 = LayerIndex.world;
				int num3 = LayerMask.op_Implicit(((LayerIndex)(ref val4)).mask);
				val4 = LayerIndex.defaultLayer;
				int num4 = num3 | LayerMask.op_Implicit(((LayerIndex)(ref val4)).mask);
				val4 = LayerIndex.entityPrecise;
				if (Physics.Raycast(val3, ref val2, num2, num4 | LayerMask.op_Implicit(((LayerIndex)(ref val4)).mask)))
				{
					val = ((RaycastHit)(ref val2)).point;
				}
				BulletAttack val5 = new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin
				};
				Vector3 direction = ((Ray)(ref modifiedAimRay)).direction;
				val5.aimVector = ((Vector3)(ref direction)).normalized;
				val5.maxDistance = 10000f;
				val5.minSpread = 0f;
				val5.maxSpread = 0f;
				val5.bulletCount = (uint)bulletCount;
				val5.procCoefficient = procCoefficient;
				val5.damageType = DamageTypeCombo.op_Implicit((DamageType)262144);
				val5.damage = damageCoefficient * base.damageStat;
				val5.force = force;
				val5.falloffModel = (FalloffModel)0;
				val5.tracerEffectPrefab = FireLaser.tracerEffectPrefab;
				val5.muzzleName = MinigunState.muzzleName;
				val5.hitEffectPrefab = FireLaser.hitEffectPrefab;
				val5.isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
				val5.HitEffectNormal = false;
				val5.radius = radius;
				val5.smartCollision = true;
				val4 = LayerIndex.world;
				val5.stopperMask = ((LayerIndex)(ref val4)).mask;
				val5.Fire();
			}
			((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMinigun", 0.75f * duration);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterBody.defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/SimpleDotCrosshair");
			((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
			animator.SetBool("WeaponIsReady", false);
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
}