Decompiled source of SurvivorsPlus v1.1.1

SurvivorsPlus.dll

Decompiled 3 weeks 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 EntityStates;
using EntityStates.Bandit2.Weapon;
using EntityStates.Captain.Weapon;
using EntityStates.CaptainDefenseMatrixItem;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Engi.EngiWeapon;
using EntityStates.Engi.Mine;
using EntityStates.Huntress;
using EntityStates.Merc;
using EntityStates.Railgunner.Reload;
using EntityStates.Railgunner.Weapon;
using EntityStates.VoidSurvivor;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates;
using On.EntityStates.Bandit2.Weapon;
using On.EntityStates.CaptainDefenseMatrixItem;
using On.EntityStates.Commando;
using On.EntityStates.Engi.EngiWeapon;
using On.EntityStates.Engi.Mine;
using On.EntityStates.Huntress;
using On.EntityStates.Railgunner.Reload;
using On.EntityStates.Railgunner.Weapon;
using On.EntityStates.VoidSurvivor;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.CharacterAI;
using RoR2.EntityLogic;
using RoR2.HudOverlay;
using RoR2.Projectile;
using RoR2.Skills;
using SurvivorsPlus.Bandit;
using SurvivorsPlus.Captain;
using SurvivorsPlus.Commando;
using SurvivorsPlus.Engineer;
using SurvivorsPlus.Huntress;
using SurvivorsPlus.Loader;
using SurvivorsPlus.Mercenary;
using SurvivorsPlus.REX;
using SurvivorsPlus.Railgunner;
using SurvivorsPlus.VoidFiend;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("SurvivorsPlus")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+3a19b9bebbdbe9a3ce97821a90e60a74bc40b147")]
[assembly: AssemblyProduct("SurvivorsPlus")]
[assembly: AssemblyTitle("SurvivorsPlus")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 SurvivorsPlus
{
	[BepInPlugin("com.Nuxlar.SurvivorsPlus", "SurvivorsPlus", "1.1.1")]
	public class SurvivorsPlus : BaseUnityPlugin
	{
		private GameObject arti = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageBody.prefab").WaitForCompletion();

		private GameObject mult = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotBody.prefab").WaitForCompletion();

		public static ConfigEntry<bool> enableAccelerationChanges;

		public static ConfigEntry<bool> enableCommandoChanges;

		public static ConfigEntry<bool> enableHuntressChanges;

		public static ConfigEntry<bool> enableBanditChanges;

		public static ConfigEntry<bool> enableEngineerChanges;

		public static ConfigEntry<bool> enableMercChanges;

		public static ConfigEntry<bool> enableREXChanges;

		public static ConfigEntry<bool> enableRunnerChanges;

		public static ConfigEntry<bool> enableAcridChanges;

		public static ConfigEntry<bool> enableCaptainChanges;

		public static ConfigEntry<bool> enableVoidFiendChanges;

		public static ConfigEntry<bool> enableArtificerChanges;

		public static ConfigEntry<bool> enableLoaderChanges;

		private static ConfigFile SPConfig { get; set; }

		public void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			SPConfig = new ConfigFile(Paths.ConfigPath + "\\com.Nuxlar.SurvivorsPlus.cfg", true);
			enableAccelerationChanges = SPConfig.Bind<bool>("General", "Enable Acceleration Changes", true, "Toggle Artificer and MUL-T acceleration changes on/off");
			enableCommandoChanges = SPConfig.Bind<bool>("General", "Enable Commando Changes", true, "Toggle commando changes on/off");
			enableHuntressChanges = SPConfig.Bind<bool>("General", "Enable Huntress Changes", true, "Toggle huntress changes on/off");
			enableBanditChanges = SPConfig.Bind<bool>("General", "Enable Bandit Changes", true, "Toggle bandit changes on/off");
			enableEngineerChanges = SPConfig.Bind<bool>("General", "Enable Engineer Changes", true, "Toggle engineer changes on/off");
			enableMercChanges = SPConfig.Bind<bool>("General", "Enable Mercenary Changes", true, "Toggle mercenary changes on/off");
			enableREXChanges = SPConfig.Bind<bool>("General", "Enable REX Changes", true, "Toggle REX changes on/off");
			enableRunnerChanges = SPConfig.Bind<bool>("General", "Enable Railgunner Changes", true, "Toggle Railgunner changes on/off");
			enableAcridChanges = SPConfig.Bind<bool>("General", "Enable Acrid Changes", true, "Toggle Acrid changes on/off");
			enableCaptainChanges = SPConfig.Bind<bool>("General", "Enable Captain Changes", true, "Toggle Captain changes on/off");
			enableVoidFiendChanges = SPConfig.Bind<bool>("General", "Enable Void Fiend Changes", true, "Toggle Void Fiend changes on/off");
			enableArtificerChanges = SPConfig.Bind<bool>("General", "Enable Artificer Changes", true, "Toggle Artificer changes on/off");
			enableLoaderChanges = SPConfig.Bind<bool>("General", "Enable Loader Changes", true, "Toggle Loader changes on/off");
			if (enableAccelerationChanges.Value)
			{
				arti.GetComponent<CharacterBody>().baseAcceleration = 80f;
				mult.GetComponent<CharacterBody>().baseAcceleration = 80f;
			}
			if (enableCommandoChanges.Value)
			{
				new CommandoChanges();
			}
			if (enableHuntressChanges.Value)
			{
				new HuntressChanges();
			}
			if (enableBanditChanges.Value)
			{
				new BanditChanges();
			}
			if (enableEngineerChanges.Value)
			{
				new EngineerChanges();
			}
			if (enableMercChanges.Value)
			{
				new MercenaryChanges();
			}
			if (enableREXChanges.Value)
			{
				new REXChanges();
			}
			if (enableRunnerChanges.Value)
			{
				new RailgunnerChanges();
			}
			if (enableCaptainChanges.Value)
			{
				new CaptainChanges();
			}
			if (enableVoidFiendChanges.Value)
			{
				new VoidFiendChanges();
			}
			if (enableLoaderChanges.Value)
			{
				new LoaderChanges();
			}
		}

		public static void ChangeEntityStateValue(string entityStateConfiguration, string fieldName, string newValue)
		{
			//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)
			EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)entityStateConfiguration).WaitForCompletion();
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = newValue;
				}
			}
		}

		public static void ChangeEntityStateValueO(string entityStateConfiguration, string fieldName, Object newValue)
		{
			//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)
			EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)entityStateConfiguration).WaitForCompletion();
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					val.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue = newValue;
				}
			}
		}
	}
}
namespace SurvivorsPlus.VoidFiend
{
	public class VoidFiendChanges
	{
		public VoidFiendChanges()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
			VoidSurvivorController.OnEnable += new hook_OnEnable(ChangeValues);
			GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(ExtraCorruptionOnKill);
			CorruptionTransitionBase.OnEnter += new hook_OnEnter(ReduceCorruptionAnim);
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && sender.HasBuff(Buffs.VoidSurvivorCorruptMode))
			{
				args.armorAdd -= 100f;
			}
		}

		private void ReduceCorruptionAnim(orig_OnEnter orig, CorruptionTransitionBase self)
		{
			if (self is EnterCorruptionTransition)
			{
				self.duration = 0.75f;
			}
			orig.Invoke(self);
		}

		private void ChangeValues(orig_OnEnable orig, VoidSurvivorController self)
		{
			self.corruptionPerCrit = 0f;
			self.corruptionForFullHeal = 0f;
			self.corruptionFractionPerSecondWhileCorrupted = -1f / 30f;
			self.corruptionPerSecondInCombat = 1f;
			self.corruptionPerSecondOutOfCombat = 0f;
			self.corruptionForFullDamage = 0f;
			orig.Invoke(self);
		}

		private void ExtraCorruptionOnKill(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
		{
			orig.Invoke(self, damageReport);
			if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)((Component)damageReport.attackerBody).GetComponent<VoidSurvivorController>()) && !damageReport.attackerBody.HasBuff(Buffs.VoidSurvivorCorruptMode))
			{
				((Component)damageReport.attackerBody).GetComponent<VoidSurvivorController>().AddCorruption(2f);
			}
		}
	}
}
namespace SurvivorsPlus.REX
{
	public class REXChanges
	{
		public static GameObject syringe = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Treebot/SyringeProjectile.prefab").WaitForCompletion();

		public REXChanges()
		{
			syringe.GetComponent<ProjectileController>().procCoefficient = 0.8f;
		}
	}
}
namespace SurvivorsPlus.Railgunner
{
	public class RailgunnerChanges
	{
		private GameObject railgunner = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerBody.prefab").WaitForCompletion();

		private GameObject polarMine = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerMineAltDetonated.prefab").WaitForCompletion();

		private SkillDef badPrimary = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/Railgunner/RailgunnerBodyFirePistol.asset").WaitForCompletion();

		private SkillDef snipeLight = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/Railgunner/RailgunnerBodyFireSnipeLight.asset").WaitForCompletion();

		private SkillDef snipeHeavy = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/Railgunner/RailgunnerBodyScopeHeavy.asset").WaitForCompletion();

		private SkillFamily utilityFamily = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/DLC1/Railgunner/RailgunnerBodyUtilityFamily.asset").WaitForCompletion();

		private SkillFamily specialFamily = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/DLC1/Railgunner/RailgunnerBodySpecialFamily.asset").WaitForCompletion();

		public RailgunnerChanges()
		{
			//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_001e: 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_0036: 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_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_0066: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Expected O, but got Unknown
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Expected O, but got Unknown
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Expected O, but got Unknown
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Expected O, but got Unknown
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Expected O, but got Unknown
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Expected O, but got Unknown
			SurvivorsPlus.ChangeEntityStateValue("RoR2/DLC1/Railgunner/EntityStates.Railgunner.Backpack.Offline.asset", "baseDuration", "5");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/DLC1/Railgunner/EntityStates.Railgunner.Weapon.FireSnipeLight.asset", "critDamageMultiplier", "0");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/DLC1/Railgunner/EntityStates.Railgunner.Weapon.FireSnipeLight.asset", "damageCoefficient", "3");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/DLC1/Railgunner/EntityStates.Railgunner.Weapon.FireSnipeHeavy.asset", "damageCoefficient", "6");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/DLC1/Railgunner/EntityStates.Railgunner.Weapon.FireSnipeSuper.asset", "damageCoefficient", "24");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/DLC1/Railgunner/EntityStates.Railgunner.Weapon.FireSnipeCryo.asset", "damageCoefficient", "12");
			railgunner.AddComponent<WeakspotController>();
			polarMine.GetComponent<SlowDownProjectiles>().slowDownCoefficient = 0.01f;
			SkillLocator component = railgunner.GetComponent<SkillLocator>();
			GenericSkill[] components = railgunner.GetComponents<GenericSkill>();
			foreach (GenericSkill val in components)
			{
				if (!val.skillName.Contains("Passive"))
				{
					Object.Destroy((Object)(object)val);
				}
			}
			FamilyChanges();
			component.primary.skillFamily.variants[0].skillDef.skillNameToken = "HH44 Rounds";
			component.primary.skillFamily.variants[0].skillDef.skillDescriptionToken = "Fire a light projectile for <style=cIsDamage>300% damage</style>.";
			component.secondary.skillFamily.variants[0].skillDef.skillDescriptionToken = "Activate your <style=cIsUtility>long-range scope</style>, highlighting <style=cIsDamage>Weak Points</style> and transforming your weapon into a piercing <style=cIsDamage>600% damage</style> railgun.";
			component.special.skillFamily.variants[0].skillDef.skillDescriptionToken = "Fire a <style=cIsDamage>piercing</style> round for <style=cIsDamage>2400% damage</style> and <style=cIsDamage>150% Weak Point damage</style>. Afterwards, <style=cIsHealth>all your weapons are disabled</style> for <style=cIsHealth>5</style> seconds.";
			component.special.skillFamily.variants[1].skillDef.skillDescriptionToken = "<style=cIsUtility>Freezing</style>. Fire <style=cIsDamage>piercing</style> round for <style=cIsDamage>1200% damage</style>.";
			CharacterBody.RecalculateStats += new Manipulator(DoubleLope);
			CharacterBody.RecalculateStats += new Manipulator(DoubleCritMultiplier);
			BaseFireSnipe.OnEnter += new hook_OnEnter(AddReload);
			BaseFireSnipe.ModifyBullet += new hook_ModifyBullet(AlterBullet);
			HurtBox.OnEnable += new hook_OnEnable(ReduceWeakpointSize);
			Boosted.OnEnter += new hook_OnEnter(ReduceBoostBonus);
		}

		private void ReduceBoostBonus(orig_OnEnter orig, Boosted self)
		{
			self.bonusDamageCoefficient = 1.5f;
			orig.Invoke(self);
		}

		private void ReduceWeakpointSize(orig_OnEnable orig, HurtBox self)
		{
			orig.Invoke(self);
			HurtBox.sniperTargetRadius = 0.75f;
		}

		private void DoubleLope(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 2f),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f)
			});
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)((float num, CharacterBody body) => (Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCount(Items.ConvertCritChanceToCritDamage) > 0) ? 2f : num));
		}

		private void DoubleCritMultiplier(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			int num = default(int);
			val.GotoNext((MoveType)0, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCall<CharacterBody>(x, "get_critMultiplier"),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.01f)
			});
			val.Index += 2;
			val.Next.Operand = 0.02f;
		}

		private void AddReload(orig_OnEnter orig, BaseFireSnipe self)
		{
			if (self is FireSnipeLight)
			{
				self.useSecondaryStocks = true;
				self.queueReload = true;
			}
			orig.Invoke(self);
		}

		private void AlterBullet(orig_ModifyBullet orig, BaseFireSnipe self, BulletAttack bulletAttack)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (self is FireSnipeLight)
			{
				bulletAttack.sniper = true;
				bulletAttack.falloffModel = (FalloffModel)0;
				EntityStateMachine val = EntityStateMachine.FindByCustomName(((EntityState)self).gameObject, "Reload");
				if (Object.op_Implicit((Object)(object)val))
				{
					EntityState state = val.state;
					Boosted val2 = (Boosted)(object)((state is Boosted) ? state : null);
					if (val2 != null)
					{
						bulletAttack.damage += val2.GetBonusDamage() / 2f;
						val2.ConsumeBoost(self.queueReload);
					}
					else if (self.queueReload)
					{
						EntityState state2 = val.state;
						Waiting val3 = (Waiting)(object)((state2 is Waiting) ? state2 : null);
						if (val3 != null)
						{
							val3.QueueReload();
						}
					}
				}
				EntityStateMachine val4 = EntityStateMachine.FindByCustomName(((EntityState)self).gameObject, "Backpack");
				EntityState val5 = self.InstantiateBackpackState();
				if (Object.op_Implicit((Object)(object)val4) && val5 != null)
				{
					val4.SetNextState(val5);
				}
			}
			else
			{
				orig.Invoke(self, bulletAttack);
			}
		}

		private void FamilyChanges()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			SkillLocator component = railgunner.GetComponent<SkillLocator>();
			GenericSkill val = railgunner.AddComponent<GenericSkill>();
			val.skillName = "RailgunnerPrimary";
			SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val2).name = "RailgunnerPrimaryFamily";
			val2.variants = (Variant[])(object)new Variant[2]
			{
				new Variant
				{
					skillDef = snipeLight
				},
				new Variant
				{
					skillDef = badPrimary
				}
			};
			val._skillFamily = val2;
			ContentAddition.AddSkillFamily(val2);
			component.primary = val;
			GenericSkill val3 = railgunner.AddComponent<GenericSkill>();
			val.skillName = "RailgunnerSecondary";
			SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val4).name = "RailgunnerSecondaryFamily";
			val4.variants = (Variant[])(object)new Variant[1]
			{
				new Variant
				{
					skillDef = snipeHeavy
				}
			};
			val3._skillFamily = val4;
			ContentAddition.AddSkillFamily(val4);
			component.secondary = val3;
			GenericSkill val5 = railgunner.AddComponent<GenericSkill>();
			val5.skillName = "RailgunnerUtility";
			val5._skillFamily = utilityFamily;
			component.utility = val5;
			GenericSkill val6 = railgunner.AddComponent<GenericSkill>();
			val6.skillName = "RailgunnerSpecial";
			val6._skillFamily = specialFamily;
			component.special = val6;
		}
	}
	public class WeakspotController : MonoBehaviour
	{
		public GameObject scopeOverlayPrefab = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerScopeHeavyOverlay.prefab").WaitForCompletion().transform.GetChild(0)).gameObject;

		private OverlayController overlayController;

		public void Start()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			overlayController = HudOverlayManager.AddOverlay(((Component)this).gameObject, new OverlayCreationParams
			{
				prefab = scopeOverlayPrefab,
				childLocatorEntry = "ScopeContainer"
			});
		}

		public void OnDisable()
		{
			RemoveOverlay(0f);
		}

		protected void RemoveOverlay(float transitionDuration)
		{
			if (overlayController != null)
			{
				HudOverlayManager.RemoveOverlay(overlayController);
				overlayController = null;
			}
		}
	}
}
namespace SurvivorsPlus.Mercenary
{
	public class EvisDashNux : BaseState
	{
		private Transform modelTransform;

		public static GameObject blinkPrefab;

		private float stopwatch;

		private Vector3 dashVector = Vector3.zero;

		public static float smallHopVelocity;

		public static float dashPrepDuration;

		public static float dashDuration = 0.3f;

		public static float speedCoefficient = 25f;

		public static string beginSoundString;

		public static string endSoundString;

		public static float overlapSphereRadius;

		public static float lollypopFactor;

		private Animator animator;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		private bool isDashing;

		private AimRequest aimRequest;

		public override void OnEnter()
		{
			//IL_00c2: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Util.PlaySound(EvisDash.beginSoundString, ((EntityState)this).gameObject);
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				aimRequest = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			}
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				animator = ((Component)modelTransform).GetComponent<Animator>();
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
			}
			if (((EntityState)this).isAuthority)
			{
				((BaseState)this).SmallHop(((EntityState)this).characterMotor, EvisDash.smallHopVelocity);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
			}
			((EntityState)this).PlayAnimation("FullBody, Override", "EvisPrep", "EvisPrep.playbackRate", EvisDash.dashPrepDuration);
			dashVector = ((EntityState)this).inputBank.aimDirection;
			((EntityState)this).characterDirection.forward = dashVector;
		}

		private void CreateBlinkEffect(Vector3 origin)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			EffectManager.SpawnEffect(EvisDash.blinkPrefab, new EffectData
			{
				rotation = Util.QuaternionSafeLookRotation(dashVector),
				origin = origin
			}, false);
		}

		public override void FixedUpdate()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: 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_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if ((double)stopwatch > (double)EvisDash.dashPrepDuration && !isDashing)
			{
				isDashing = true;
				dashVector = ((EntityState)this).inputBank.aimDirection;
				CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
				((EntityState)this).PlayCrossfade("FullBody, Override", "EvisLoop", 0.1f);
				if (Object.op_Implicit((Object)(object)modelTransform))
				{
					TemporaryOverlay obj = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
					obj.duration = 0.6f;
					obj.animateShaderAlpha = true;
					obj.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					obj.destroyComponentOnEnd = true;
					obj.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashBright");
					obj.AddToCharacerModel(((Component)modelTransform).GetComponent<CharacterModel>());
					TemporaryOverlay obj2 = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
					obj2.duration = 0.7f;
					obj2.animateShaderAlpha = true;
					obj2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					obj2.destroyComponentOnEnd = true;
					obj2.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashExpanded");
					obj2.AddToCharacerModel(((Component)modelTransform).GetComponent<CharacterModel>());
				}
			}
			bool flag = (double)stopwatch >= (double)EvisDash.dashDuration + (double)EvisDash.dashPrepDuration;
			if (isDashing)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += dashVector * (base.moveSpeedStat * EvisDash.speedCoefficient * Time.fixedDeltaTime);
				}
				if (((EntityState)this).isAuthority)
				{
					Collider[] array = Physics.OverlapSphere(((EntityState)this).transform.position, ((EntityState)this).characterBody.radius + EvisDash.overlapSphereRadius * (flag ? EvisDash.lollypopFactor : 1f), LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
					for (int i = 0; i < array.Length; i++)
					{
						HurtBox component = ((Component)array[i]).GetComponent<HurtBox>();
						if (Object.op_Implicit((Object)(object)component) && (Object)(object)component.healthComponent != (Object)(object)((EntityState)this).healthComponent)
						{
							((EntityState)this).outer.SetNextState((EntityState)(object)new EvisNux());
							return;
						}
					}
				}
			}
			if (flag && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound(EvisDash.endSoundString, ((EntityState)this).gameObject);
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity *= 0.1f;
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, EvisDash.smallHopVelocity);
			AimRequest obj = aimRequest;
			if (obj != null)
			{
				obj.Dispose();
			}
			((EntityState)this).PlayAnimation("FullBody, Override", "EvisLoopExit");
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
			}
			((EntityState)this).OnExit();
		}
	}
	public class EvisNux : BaseState
	{
		private Transform modelTransform;

		public static GameObject blinkPrefab;

		public static float duration = 2f;

		public static float damageCoefficient;

		public static float damageFrequency;

		public static float procCoefficient;

		public static string beginSoundString;

		public static string endSoundString;

		public static float maxRadius;

		public static GameObject hitEffectPrefab;

		public static string slashSoundString;

		public static string impactSoundString;

		public static string dashSoundString;

		public static float slashPitch;

		public static float smallHopVelocity;

		public static float lingeringInvincibilityDuration;

		private CharacterModel characterModel;

		private float stopwatch;

		private float attackStopwatch;

		private bool crit;

		private static float minimumDuration = 0.5f;

		private AimRequest aimRequest;

		private int hitCount;

		public override void OnEnter()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			Util.PlayAttackSpeedSound(Evis.beginSoundString, ((EntityState)this).gameObject, 1.2f);
			crit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount++;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				aimRequest = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: 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_019b: Expected O, but got Unknown
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			attackStopwatch += Time.fixedDeltaTime;
			float num = 1f / Evis.damageFrequency / base.attackSpeedStat;
			if ((double)attackStopwatch >= (double)num)
			{
				hitCount++;
				attackStopwatch -= num;
				HurtBox val = SearchForTarget();
				if (Object.op_Implicit((Object)(object)val))
				{
					Util.PlayAttackSpeedSound(Evis.slashSoundString, ((EntityState)this).gameObject, Evis.slashPitch);
					Util.PlaySound(Evis.dashSoundString, ((EntityState)this).gameObject);
					Util.PlaySound(Evis.impactSoundString, ((EntityState)this).gameObject);
					HurtBoxGroup hurtBoxGroup = val.hurtBoxGroup;
					HurtBox val2 = hurtBoxGroup.hurtBoxes[Random.Range(0, hurtBoxGroup.hurtBoxes.Length - 1)];
					if (Object.op_Implicit((Object)(object)val2))
					{
						Vector3 position = ((Component)val2).transform.position;
						Vector2 insideUnitCircle = Random.insideUnitCircle;
						Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized;
						Vector3 val3 = default(Vector3);
						((Vector3)(ref val3))..ctor(normalized.x, 0f, normalized.y);
						EffectManager.SimpleImpactEffect(Evis.hitEffectPrefab, position, val3, false);
						Transform transform = ((Component)val.hurtBoxGroup).transform;
						TemporaryOverlay obj = ((Component)transform).gameObject.AddComponent<TemporaryOverlay>();
						obj.duration = num;
						obj.animateShaderAlpha = true;
						obj.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
						obj.destroyComponentOnEnd = true;
						obj.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matMercEvisTarget");
						obj.AddToCharacerModel(((Component)transform).GetComponent<CharacterModel>());
						if (NetworkServer.active)
						{
							DamageInfo val4 = new DamageInfo();
							val4.damage = 1.5f * base.damageStat;
							val4.attacker = ((EntityState)this).gameObject;
							val4.procCoefficient = Evis.procCoefficient;
							val4.position = ((Component)val2).transform.position;
							val4.crit = crit;
							if (hitCount == 7)
							{
								val4.damageType = (DamageType)(val4.damageType | 0x800000);
							}
							val2.healthComponent.TakeDamage(val4);
							GlobalEventManager.instance.OnHitEnemy(val4, ((Component)val2.healthComponent).gameObject);
							GlobalEventManager.instance.OnHitAll(val4, ((Component)val2.healthComponent).gameObject);
						}
					}
				}
				else if (((EntityState)this).isAuthority && (double)stopwatch > (double)Evis.minimumDuration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
			}
			if (!((double)stopwatch < (double)Evis.duration) && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private HurtBox SearchForTarget()
		{
			//IL_0000: 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)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			BullseyeSearch val = new BullseyeSearch
			{
				searchOrigin = ((EntityState)this).transform.position,
				searchDirection = Random.onUnitSphere,
				maxDistanceFilter = Evis.maxRadius,
				teamMaskFilter = TeamMask.GetUnprotectedTeams(((BaseState)this).GetTeam()),
				sortMode = (SortMode)1
			};
			val.RefreshCandidates();
			val.FilterOutGameObject(((EntityState)this).gameObject);
			return val.GetResults().FirstOrDefault();
		}

		private void CreateBlinkEffect(Vector3 origin)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			EffectManager.SpawnEffect(Evis.blinkPrefab, new EffectData
			{
				rotation = Util.QuaternionSafeLookRotation(Vector3.up),
				origin = origin
			}, false);
		}

		public override void OnExit()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound(Evis.endSoundString, ((EntityState)this).gameObject);
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				TemporaryOverlay obj = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
				obj.duration = 0.6f;
				obj.animateShaderAlpha = true;
				obj.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				obj.destroyComponentOnEnd = true;
				obj.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matMercEvisTarget");
				obj.AddToCharacerModel(((Component)modelTransform).GetComponent<CharacterModel>());
				TemporaryOverlay obj2 = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
				obj2.duration = 0.7f;
				obj2.animateShaderAlpha = true;
				obj2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				obj2.destroyComponentOnEnd = true;
				obj2.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashExpanded");
				obj2.AddToCharacerModel(((Component)modelTransform).GetComponent<CharacterModel>());
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj3 = characterModel;
				obj3.invisibilityCount--;
			}
			AimRequest obj4 = aimRequest;
			if (obj4 != null)
			{
				obj4.Dispose();
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, Evis.lingeringInvincibilityDuration);
			}
			Util.PlaySound(Evis.endSoundString, ((EntityState)this).gameObject);
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, Evis.smallHopVelocity);
			((EntityState)this).OnExit();
		}
	}
	public class MercenaryChanges
	{
		private GameObject merc = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion();

		private GameObject evisOverlapProjectile = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/EvisOverlapProjectile.prefab").WaitForCompletion();

		public MercenaryChanges()
		{
			//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_001e: 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_0048: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			Object.Destroy((Object)(object)evisOverlapProjectile.GetComponent<DelayedEvent>());
			bool flag = default(bool);
			ContentAddition.AddEntityState<EvisDashNux>(ref flag);
			ContentAddition.AddEntityState<EvisNux>(ref flag);
			SurvivorsPlus.ChangeEntityStateValue("RoR2/Base/Merc/EntityStates.Merc.Assaulter2.asset", "damageCoefficient", "4");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/Base/Merc/EntityStates.Merc.FocusedAssaultDash.asset", "delayedDamageCoefficient", "8");
			CharacterBody component = merc.GetComponent<CharacterBody>();
			component.baseRegen = 2.5f;
			component.levelRegen = 0.5f;
			SkillLocator component2 = merc.GetComponent<SkillLocator>();
			component2.utility.skillFamily.variants[0].skillDef.skillDescriptionToken = "<style=cIsDamage>Stunning</style>. Dash forward, dealing <style=cIsDamage>400% damage</style>. If you hit an enemy, <style=cIsDamage>you can dash again</style>, up to <style=cIsDamage>3</style> total.";
			component2.utility.skillFamily.variants[1].skillDef.skillDescriptionToken = "<style=cIsDamage>Stunning</style>. Dash forward, dealing <style=cIsDamage>800% damage</style> and <style=cIsUtility>Exposing</style> enemies after<style=cIsUtility> 1 second</style>.";
			component2.special.skillFamily.variants[0].skillDef.skillDescriptionToken = "Target a nearby enemy, attacking them for <style=cIsDamage>150% damage</style> repeatedly. <style=cIsUtility>Exposing</style> on the final hit. <style=cIsUtility>You cannot be hit for the duration</style>.";
			component2.special.skillFamily.variants[0].skillDef.activationState = new SerializableEntityStateType(typeof(EvisDashNux));
		}
	}
}
namespace SurvivorsPlus.Loader
{
	public class LoaderChanges
	{
		private GameObject loader = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Loader/LoaderBody.prefab").WaitForCompletion();

		public LoaderChanges()
		{
			//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)
			CharacterBody component = loader.GetComponent<CharacterBody>();
			component.baseMaxHealth = 110f;
			component.levelMaxHealth = 33f;
			component.baseArmor = 10f;
		}
	}
}
namespace SurvivorsPlus.Huntress
{
	public class HuntressChanges
	{
		public ModdedDamageType huntressSlow;

		private GameObject arrowRainProjectile = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRain.prefab").WaitForCompletion();

		private GameObject huntress = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBody.prefab").WaitForCompletion();

		public HuntressChanges()
		{
			//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_001e: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: 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_017a: Expected O, but got Unknown
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Expected O, but got Unknown
			huntressSlow = DamageAPI.ReserveDamageType();
			SurvivorsPlus.ChangeEntityStateValue("RoR2/Base/Huntress/EntityStates.Huntress.HuntressWeapon.FireFlurrySeekingArrow.asset", "orbProcCoefficient", "0.8");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/Base/Huntress/EntityStates.Huntress.HuntressWeapon.FireFlurrySeekingArrow.asset", "baseDuration", "1");
			SurvivorsPlus.ChangeEntityStateValue("RoR2/Base/Huntress/EntityStates.Huntress.ArrowRain.asset", "damageCoefficient", "6");
			arrowRainProjectile.GetComponent<ProjectileDotZone>().overlapProcCoefficient = 0.6f;
			arrowRainProjectile.GetComponent<ProjectileDamage>().damageType = (DamageType)0;
			arrowRainProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(huntressSlow);
			SkillLocator component = huntress.GetComponent<SkillLocator>();
			component.utility.skillFamily.variants[0].skillDef.baseRechargeInterval = 6f;
			SkillDef skillDef = component.utility.skillFamily.variants[1].skillDef;
			skillDef.baseMaxStock = 1;
			skillDef.baseRechargeInterval = 3f;
			skillDef.skillDescriptionToken = "<style=cIsUtility>Agile</style>. <style=cIsUtility>Disappear</style> and <style=cIsUtility>teleport</style> a short distance.";
			component.secondary.skillFamily.variants[0].skillDef.skillDescriptionToken = "Throw a seeking glaive that bounces up to <style=cIsDamage>6</style> times for <style=cIsDamage>400%</style> damage.";
			component.special.skillFamily.variants[0].skillDef.skillDescriptionToken = "<style=cIsUtility>Teleport</style> into the sky. Target an area to rain arrows, <style=cIsUtility>slowing</style> all enemies and dealing <style=cIsDamage>450% damage per second</style>.";
			HealthComponent.SendDamageDealt += new hook_SendDamageDealt(ApplyNewDamageType);
			ArrowRain.UpdateAreaIndicator += new hook_UpdateAreaIndicator(ChangeAimLayer);
		}

		private void ApplyNewDamageType(orig_SendDamageDealt orig, DamageReport damageReport)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, huntressSlow) && Object.op_Implicit((Object)(object)damageReport.victimBody))
			{
				damageReport.victimBody.AddTimedBuff(Buffs.Slow80, 1f);
			}
			orig.Invoke(damageReport);
		}

		private void ChangeAimLayer(orig_UpdateAreaIndicator orig, ArrowRain self)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)self.areaIndicatorInstance))
			{
				float num = 1000f;
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(((BaseState)self).GetAimRay(), ref val, num, LayerMask.op_Implicit(CommonMasks.bullet)))
				{
					self.areaIndicatorInstance.transform.position = ((RaycastHit)(ref val)).point;
					self.areaIndicatorInstance.transform.up = ((RaycastHit)(ref val)).normal;
				}
			}
		}
	}
}
namespace SurvivorsPlus.Engineer
{
	public class BetterFireBeam : BaseState
	{
		public GameObject effectPrefab;

		public GameObject hitEffectPrefab = EngineerChanges.hitEffect;

		public GameObject laserPrefab = EngineerChanges.laser;

		public string muzzleString = "Muzzle";

		public string attackSoundString = "";

		public float damageCoefficient = 2f;

		public float procCoefficient = 3f;

		public float force;

		public float minSpread;

		public float maxSpread;

		public int bulletCount = 1;

		public float fireFrequency = 5f;

		public float maxDistance = 50f;

		private float fireTimer;

		private Ray laserRay;

		private Transform modelTransform;

		private GameObject laserEffectInstance;

		private Transform laserEffectInstanceEndTransform;

		public int bulletCountCurrent = 1;

		public override void OnEnter()
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			fireTimer = 0f;
			modelTransform = ((EntityState)this).GetModelTransform();
			if (!Object.op_Implicit((Object)(object)modelTransform))
			{
				return;
			}
			ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Transform val = component.FindChild(muzzleString);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)laserPrefab))
			{
				if (((Component)val).transform.childCount > 0)
				{
					laserEffectInstance = ((Component)((Component)val).transform.GetChild(0)).gameObject;
					laserEffectInstanceEndTransform = laserEffectInstance.GetComponent<ChildLocator>().FindChild("LaserEnd");
				}
				if (!Object.op_Implicit((Object)(object)laserEffectInstance))
				{
					laserEffectInstance = Object.Instantiate<GameObject>(laserPrefab, val.position, val.rotation);
					laserEffectInstance.transform.parent = val;
					laserEffectInstanceEndTransform = laserEffectInstance.GetComponent<ChildLocator>().FindChild("LaserEnd");
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			laserRay = GetLaserRay();
			fireTimer += Time.fixedDeltaTime;
			if ((double)fireTimer > (double)(1f / (fireFrequency * ((EntityState)this).characterBody.attackSpeed)))
			{
				FireBullet(modelTransform, laserRay, muzzleString);
				fireTimer = 0f;
			}
			if (Object.op_Implicit((Object)(object)laserEffectInstance) && Object.op_Implicit((Object)(object)laserEffectInstanceEndTransform))
			{
				laserEffectInstanceEndTransform.position = GetBeamEndPoint();
			}
			if (((EntityState)this).isAuthority && fireTimer == 0f)
			{
				((EntityState)this).outer.SetNextState(GetNextState());
			}
		}

		protected Vector3 GetBeamEndPoint()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_0052: 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_0059: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			Vector3 point = ((Ray)(ref laserRay)).GetPoint(maxDistance);
			GameObject gameObject = ((EntityState)this).gameObject;
			Ray val = laserRay;
			double num = maxDistance;
			LayerIndex val2 = LayerIndex.world;
			int num2 = LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask);
			val2 = LayerIndex.entityPrecise;
			int num3 = LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask);
			LayerMask val3 = LayerMask.op_Implicit(num2 | num3);
			RaycastHit val4 = default(RaycastHit);
			if (Util.CharacterRaycast(gameObject, val, ref val4, (float)num, val3, (QueryTriggerInteraction)0))
			{
				point = ((RaycastHit)(ref val4)).point;
			}
			return point;
		}

		protected virtual EntityState GetNextState()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return EntityStateCatalog.InstantiateState(((EntityState)this).outer.mainStateType);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}

		public virtual void ModifyBullet(BulletAttack bulletAttack)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			bulletAttack.damageType = (DamageType)(bulletAttack.damageType | 8);
		}

		public virtual bool ShouldFireLaser()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
			{
				return ((EntityState)this).inputBank.skill1.down;
			}
			return false;
		}

		public virtual Ray GetLaserRay()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return ((BaseState)this).GetAimRay();
		}

		private void FireBullet(Transform modelTransform, Ray laserRay, string targetMuzzle)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, targetMuzzle, false);
			}
			if (((EntityState)this).isAuthority)
			{
				BulletAttack val = new BulletAttack();
				val.owner = ((EntityState)this).gameObject;
				val.weapon = ((EntityState)this).gameObject;
				val.origin = ((Ray)(ref laserRay)).origin;
				val.aimVector = ((Ray)(ref laserRay)).direction;
				val.minSpread = minSpread;
				val.maxSpread = maxSpread;
				val.bulletCount = 1u;
				val.damage = damageCoefficient * base.damageStat / fireFrequency;
				val.procCoefficient = procCoefficient / fireFrequency;
				val.force = force;
				val.muzzleName = targetMuzzle;
				val.hitEffectPrefab = hitEffectPrefab;
				val.isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
				val.HitEffectNormal = false;
				val.radius = 0f;
				val.maxDistance = maxDistance;
				ModifyBullet(val);
				val.Fire();
			}
		}
	}
	public class EngineerChanges
	{
		public static GameObject hitEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/Hitspark1.prefab").WaitForCompletion();

		public static GameObject laser = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/LaserEngiTurret.prefab").WaitForCompletion();

		private GameObject engi = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiBody.prefab").WaitForCompletion();

		private GameObject engiWalkerTurret = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiWalkerTurretBody.prefab").WaitForCompletion();

		private GameObject engiWalkerTurretMaster = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiWalkerTurretMaster.prefab").WaitForCompletion();

		public EngineerChanges()
		{
			//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_001e: 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_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Expected O, but got Unknown
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Expected O, but got Unknown
			bool flag = default(bool);
			ContentAddition.AddEntityState<BetterFireBeam>(ref flag);
			SurvivorsPlus.ChangeEntityStateValue("RoR2/Base/Engi/EntityStates.EngiTurret.EngiTurretWeapon.FireBeam.asset", "maxDistance", "50");
			SkillLocator component = engi.GetComponent<SkillLocator>();
			SkillDef skillDef = component.primary.skillFamily.variants[0].skillDef;
			skillDef.skillDescriptionToken = "Fire <style=cIsDamage>3</style> grenades that deal <style=cIsDamage>100% damage</style> each.";
			skillDef.activationState = new SerializableEntityStateType(typeof(FireGrenades));
			SkillDef skillDef2 = component.secondary.skillFamily.variants[0].skillDef;
			skillDef2.skillDescriptionToken = "Place a large blast radius mine that deals <style=cIsDamage>deal 600% damage</style> each. Can place up to 4.";
			skillDef2.baseRechargeInterval = 5f;
			engiWalkerTurret.AddComponent<TurretBeamRemover>();
			engiWalkerTurret.GetComponent<SkillLocator>().primary.skillFamily.variants[0].skillDef.activationState = new SerializableEntityStateType(typeof(BetterFireBeam));
			AISkillDriver[] array = (from x in engiWalkerTurretMaster.GetComponents<AISkillDriver>()
				where x.customName.Contains("ReturnToLeader")
				select x).ToArray();
			foreach (AISkillDriver val in array)
			{
				if (val.maxDistance == 110f)
				{
					val.maxDistance = 55f;
					val.shouldSprint = true;
				}
			}
			AISkillDriver obj = (from x in engiWalkerTurretMaster.GetComponents<AISkillDriver>()
				where x.customName.Contains("ChaseAndFireAtEnemy")
				select x).First();
			obj.maxDistance = 50f;
			obj.shouldSprint = true;
			BaseMineArmingState.OnEnter += new hook_OnEnter(BaseMineArmingState_OnEnter);
			FireGrenades.OnEnter += new hook_OnEnter(FireGrenades_OnEnter);
		}

		private void BaseMineArmingState_OnEnter(orig_OnEnter orig, BaseMineArmingState self)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			orig.Invoke(self);
			if (self is MineArmingFull)
			{
				self.damageScale = 2f;
			}
			if (self is MineArmingWeak)
			{
				((EntityState)self).outer.SetState((EntityState)new MineArmingFull());
			}
		}

		private void FireGrenades_OnEnter(orig_OnEnter orig, FireGrenades self)
		{
			FireGrenades.baseDuration = 1f;
			self.grenadeCountMax = 3;
			orig.Invoke(self);
		}
	}
	public class TurretBeamRemover : MonoBehaviour
	{
		private GameObject muzzle;

		private InputBankTest inputBank;

		private void Start()
		{
			muzzle = ((Component)((Component)((Component)this).GetComponent<CharacterBody>().modelLocator.modelTransform).GetComponent<ChildLocator>().FindChild("Muzzle")).gameObject;
			inputBank = ((Component)this).GetComponent<CharacterBody>().inputBank;
		}

		private void FixedUpdate()
		{
			if (muzzle.transform.childCount > 0 && !inputBank.skill1.down)
			{
				Object.Destroy((Object)(object)((Component)muzzle.transform.GetChild(0)).gameObject);
			}
		}
	}
}
namespace SurvivorsPlus.Commando
{
	public class BetterSuppressiveFire : BaseState
	{
		public static GameObject effectPrefab = FireBarrage.effectPrefab;

		public static GameObject hitEffectPrefab = FireBarrage.hitEffectPrefab;

		public static GameObject tracerEffectPrefab = FireBarrage.tracerEffectPrefab;

		public static float damageCoefficient = 2f;

		public static float force = FireSweepBarrage.force;

		public static float minSpread = FireBarrage.minSpread;

		public static float maxSpread = FireBarrage.maxSpread;

		public static float baseDurationBetweenShots = 1f;

		public static float totalDuration = 2f;

		public static float bulletRadius = 1.5f;

		public static int baseBulletCount = FireBarrage.baseBulletCount;

		public static string fireBarrageSoundString = FireBarrage.fireBarrageSoundString;

		public static float recoilAmplitude = FireBarrage.recoilAmplitude;

		public static float spreadBloomValue = FireBarrage.spreadBloomValue;

		private int totalBulletsFired;

		private int bulletCount;

		public float stopwatchBetweenShots;

		private Animator modelAnimator;

		private Transform modelTransform;

		private float duration;

		private float durationBetweenShots;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((EntityState)this).characterBody.SetSpreadBloom(0.2f, false);
			durationBetweenShots = FireBarrage.baseDurationBetweenShots / base.attackSpeedStat;
			bulletCount = (int)((double)FireBarrage.baseBulletCount * (double)base.attackSpeedStat);
			duration = durationBetweenShots * (float)bulletCount;
			modelAnimator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayCrossfade("Gesture, Additive", "FireBarrage", "FireBarrage.playbackRate", duration, 0.2f);
			((EntityState)this).PlayCrossfade("Gesture, Override", "FireBarrage", "FireBarrage.playbackRate", duration, 0.2f);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			FireBullet();
		}

		private void FireBullet()
		{
			//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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			string text = "MuzzleRight";
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				if (Object.op_Implicit((Object)(object)effectPrefab))
				{
					EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, false);
				}
				((EntityState)this).PlayAnimation("Gesture Additive, Right", "FirePistol, Right");
			}
			((BaseState)this).AddRecoil(-0.8f * recoilAmplitude, -1f * recoilAmplitude, -0.1f * recoilAmplitude, 0.15f * recoilAmplitude);
			if (((EntityState)this).isAuthority)
			{
				new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = minSpread,
					maxSpread = maxSpread,
					bulletCount = 1u,
					falloffModel = (FalloffModel)0,
					damage = damageCoefficient * base.damageStat,
					force = force,
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = text,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master),
					radius = bulletRadius,
					smartCollision = true,
					damageType = (DamageType)0,
					procCoefficient = 2f
				}.Fire();
			}
			((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue);
			totalBulletsFired++;
			Util.PlaySound(fireBarrageSoundString, ((EntityState)this).gameObject);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatchBetweenShots += Time.fixedDeltaTime;
			if ((double)stopwatchBetweenShots >= (double)durationBetweenShots && totalBulletsFired < bulletCount)
			{
				stopwatchBetweenShots -= durationBetweenShots;
				FireBullet();
			}
			if (totalBulletsFired == bulletCount && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class CommandoChanges
	{
		private GameObject commando = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();

		public CommandoChanges()
		{
			//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_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: 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_00f4: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			SkillLocator component = commando.GetComponent<SkillLocator>();
			component.secondary.skillFamily.variants[1].skillDef.skillDescriptionToken = "Fire two close-range blasts that deal <style=cIsDamage>12x200% damage</style> total.";
			component.secondary.skillFamily.variants[0].skillDef.skillDescriptionToken = "Fire a <style=cIsUtility>piercing</style> bullet for <style=cIsDamage>400% damage</style>. Deals <style=cIsDamage>40%</style> more damage every time it passes through an enemy.";
			SkillDef skillDef = component.utility.skillFamily.variants[0].skillDef;
			skillDef.cancelSprintingOnActivation = false;
			skillDef.skillDescriptionToken = "<style=cIsUtility>Roll</style> forward a short distance. You are <style=cIsDamage>invincible</style> during the roll.";
			SkillDef skillDef2 = component.special.skillFamily.variants[0].skillDef;
			skillDef2.skillDescriptionToken = "Fire a barrage of high impact rounds that deal <style=cIsDamage>200% damage</style> with <style=cIsUtility>double the proc coefficient</style>.";
			skillDef2.activationState = new SerializableEntityStateType(typeof(BetterSuppressiveFire));
			skillDef2.baseRechargeInterval = 6f;
			GenericProjectileBaseState.OnEnter += new hook_OnEnter(AlterFMJ);
			DodgeState.OnEnter += new hook_OnEnter(AddInvincibility);
			DodgeState.OnExit += new hook_OnExit(RemoveInvincibility);
		}

		private void AlterFMJ(orig_OnEnter orig, GenericProjectileBaseState self)
		{
			if (self is FireFMJ)
			{
				self.damageCoefficient = 4f;
			}
			orig.Invoke(self);
		}

		private void AddInvincibility(orig_OnEnter orig, DodgeState self)
		{
			self.initialSpeedCoefficient = 4f;
			self.finalSpeedCoefficient = 2f;
			((EntityState)self).characterBody.AddBuff(Buffs.HiddenInvincibility);
			orig.Invoke(self);
		}

		private void RemoveInvincibility(orig_OnExit orig, DodgeState self)
		{
			orig.Invoke(self);
			((EntityState)self).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
		}
	}
}
namespace SurvivorsPlus.Captain
{
	public class CaptainChanges
	{
		private GameObject captain = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainBody.prefab").WaitForCompletion();

		public CaptainChanges()
		{
			//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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			captain.GetComponent<SkillLocator>().primary.skillFamily.variants[0].skillDef.activationState = new SerializableEntityStateType(typeof(FireCaptainShotgun));
			DefenseMatrixOn.DeleteNearbyProjectile += new hook_DeleteNearbyProjectile(MicrobotEdit);
		}

		private void FamilyChanges()
		{
			SkillLocator component = captain.GetComponent<SkillLocator>();
			GenericSkill val = captain.AddComponent<GenericSkill>();
			val.skillName = "captainPrimary";
			SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val2).name = "captainPrimaryFamily";
			val._skillFamily = val2;
			ContentAddition.AddSkillFamily(val2);
			component.primary = val;
			GenericSkill val3 = captain.AddComponent<GenericSkill>();
			val.skillName = "captainSecondary";
			SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val4).name = "captainSecondaryFamily";
			val3._skillFamily = val4;
			ContentAddition.AddSkillFamily(val4);
			component.secondary = val3;
			GenericSkill val5 = captain.AddComponent<GenericSkill>();
			val5.skillName = "captainUtility";
			component.utility = val5;
			GenericSkill val6 = captain.AddComponent<GenericSkill>();
			val6.skillName = "captainSpecial";
			component.special = val6;
		}

		private bool MicrobotEdit(orig_DeleteNearbyProjectile orig, DefenseMatrixOn self)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: 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)
			//IL_0186: Expected O, but got Unknown
			Vector3 val = (Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)self).attachedBody) ? ((BaseBodyAttachmentState)self).attachedBody.corePosition : Vector3.zero);
			TeamIndex val2 = (TeamIndex)((!Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)self).attachedBody)) ? (-1) : ((int)((BaseBodyAttachmentState)self).attachedBody.teamComponent.teamIndex));
			float num = DefenseMatrixOn.projectileEraserRadius * DefenseMatrixOn.projectileEraserRadius;
			int num2 = 0;
			int itemStack = self.GetItemStack();
			bool result = false;
			List<ProjectileController> instancesList = InstanceTracker.GetInstancesList<ProjectileController>();
			List<ProjectileController> list = new List<ProjectileController>();
			int i = 0;
			for (int count = instancesList.Count; i < count; i++)
			{
				if (num2 >= itemStack)
				{
					break;
				}
				ProjectileController val3 = instancesList[i];
				if (val3.cannotBeDeleted || val3.teamFilter.teamIndex == val2)
				{
					continue;
				}
				Vector3 val4 = ((Component)val3).transform.position - val;
				if (((Vector3)(ref val4)).sqrMagnitude < num)
				{
					bool flag = true;
					ProjectileSimple component = ((Component)val3).gameObject.GetComponent<ProjectileSimple>();
					ProjectileCharacterController component2 = ((Component)val3).gameObject.GetComponent<ProjectileCharacterController>();
					if ((!Object.op_Implicit((Object)(object)component) || (Object.op_Implicit((Object)(object)component) && component.desiredForwardSpeed == 0f)) && !Object.op_Implicit((Object)(object)component2))
					{
						flag = false;
					}
					if (flag)
					{
						list.Add(val3);
						num2++;
					}
				}
			}
			int j = 0;
			for (int count2 = list.Count; j < count2; j++)
			{
				ProjectileController val5 = list[j];
				if (Object.op_Implicit((Object)(object)val5))
				{
					result = true;
					Vector3 position = ((Component)val5).transform.position;
					Vector3 start = val;
					if (Object.op_Implicit((Object)(object)DefenseMatrixOn.tracerEffectPrefab))
					{
						EffectData val6 = new EffectData
						{
							origin = position,
							start = start
						};
						EffectManager.SpawnEffect(DefenseMatrixOn.tracerEffectPrefab, val6, true);
					}
					EntityState.Destroy((Object)(object)((Component)val5).gameObject);
				}
			}
			return result;
		}
	}
}
namespace SurvivorsPlus.Bandit
{
	public class BanditChanges
	{
		public ModdedDamageType banditOpenWound;

		public ModdedDamageType banditDoubleHemorrhage;

		private GameObject lightsOutEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2ResetEffect.prefab").WaitForCompletion();

		private GameObject bandit = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2Body.prefab").WaitForCompletion();

		private Material bloodMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matBloodHumanLarge.mat").WaitForCompletion();

		private DotIndex emptyDotIdx;

		public BanditChanges()
		{
			//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_001e: 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_0036: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: 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_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Expected O, but got Unknown
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Expected O, but got Unknown
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Expected O, but got Unknown
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Expected O, but got Unknown
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			((Renderer)((Component)lightsOutEffect.transform.GetChild(0)).GetComponent<ParticleSystemRenderer>()).sharedMaterial = bloodMat;
			((Renderer)((Component)lightsOutEffect.transform.GetChild(1)).GetComponent<ParticleSystemRenderer>()).sharedMaterial = bloodMat;
			((Renderer)((Component)lightsOutEffect.transform.GetChild(2)).GetComponent<ParticleSystemRenderer>()).sharedMaterial = bloodMat;
			SkillLocator component = bandit.GetComponent<SkillLocator>();
			component.utility.skillFamily.variants[0].skillDef.beginSkillCooldownOnSkillEnd = true;
			component.secondary.skillFamily.variants[0].skillDef.skillDescriptionToken = "Lunge and slash for <style=cIsDamage>360% damage</style>. Critical Strikes also cause <style=cIsHealth>2 Hemorrhage stacks</style>.";
			SkillDef skillDef = component.special.skillFamily.variants[0].skillDef;
			skillDef.skillNameToken = "Open Wound";
			skillDef.skillDescriptionToken = "<style=cIsDamage>Slayer</style>. Fire a revolver shot for <style=cIsDamage>600% damage</style>. Clears all stacks of <style=cIsHealth>Hemorrhage, dealing remaining damage immediately</style>.";
			skillDef.baseRechargeInterval = 6f;
			banditDoubleHemorrhage = DamageAPI.ReserveDamageType();
			banditOpenWound = DamageAPI.ReserveDamageType();
			CustomDotBehaviour val = new CustomDotBehaviour(OpenWoundBehavior);
			emptyDotIdx = DotAPI.RegisterDotDef(0f, 0f, (DamageColorIndex)0, (BuffDef)null, val, (CustomDotVisual)null);
			HealthComponent.SendDamageDealt += new hook_SendDamageDealt(ApplyNewDamageTypes);
			FireShotgun2.FireBullet += new hook_FireBullet(ModifyFire);
			SlashBlade.AuthorityModifyOverlapAttack += new hook_AuthorityModifyOverlapAttack(IncreaseHemorrhageStacks);
			Bandit2FirePrimaryBase.OnEnter += new hook_OnEnter(ReduceRecoil);
			FireSidearmResetRevolver.ModifyBullet += new hook_ModifyBullet(AddOpenWound);
		}

		private void AddOpenWound(orig_ModifyBullet orig, FireSidearmResetRevolver self, BulletAttack bulletAttack)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			DamageAPI.AddModdedDamageType(bulletAttack, banditOpenWound);
			orig.Invoke(self, bulletAttack);
		}

		private void OpenWoundBehavior(DotController self, DotStack dotStack)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Invalid comparison between Unknown and I4
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_0114: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Expected O, but got Unknown
			if (dotStack.dotIndex != emptyDotIdx || !Object.op_Implicit((Object)(object)self.victimBody) || !Object.op_Implicit((Object)(object)self.victimBody.healthComponent))
			{
				return;
			}
			int i = 0;
			int count = self.dotStackList.Count;
			float num = 0f;
			for (; i < count; i++)
			{
				if ((int)self.dotStackList[i].dotIndex == 6)
				{
					float num2 = self.dotStackList[i].timer / 0.25f;
					float damage = self.dotStackList[i].damage;
					num += damage * num2;
					self.dotStackList[i].timer = 0f;
				}
			}
			if (num > 0f)
			{
				DamageInfo val = new DamageInfo();
				val.damage = num;
				val.position = self.victimBody.corePosition;
				val.force = Vector3.zero;
				val.crit = false;
				val.procChainMask = default(ProcChainMask);
				val.procCoefficient = 1f;
				val.damageColorIndex = (DamageColorIndex)8;
				val.damageType = (DamageType)0;
				self.victimBody.healthComponent.TakeDamage(val);
				EffectManager.SpawnEffect(lightsOutEffect, new EffectData
				{
					origin = self.victimBody.corePosition,
					scale = self.victimBody.radius
				}, true);
			}
		}

		private void ModifyFire(orig_FireBullet orig, FireShotgun2 self, Ray aimRay)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)self).StartAimMode(aimRay, 3f, false);
			((GenericBulletBaseState)self).DoFireEffects();
			((GenericBulletBaseState)self).PlayFireAnimation();
			((BaseState)self).AddRecoil(-1f * ((GenericBulletBaseState)self).recoilAmplitudeY, -1.5f * ((GenericBulletBaseState)self).recoilAmplitudeY, -1f * ((GenericBulletBaseState)self).recoilAmplitudeX, 1f * ((GenericBulletBaseState)self).recoilAmplitudeX);
			if (((EntityState)self).isAuthority)
			{
				Vector3 val = Vector3.Cross(((Ray)(ref aimRay)).direction, Vector3.up);
				float num = 5f;
				Ray val5 = default(Ray);
				for (int i = 0; i < ((GenericBulletBaseState)self).bulletCount; i++)
				{
					float num2 = Random.Range((0f - num) / 2f, num / 2f);
					float num3 = Random.Range((0f - num) / 2f, num / 2f);
					Quaternion val2 = Quaternion.AngleAxis(num2, Vector3.up);
					Quaternion val3 = Quaternion.AngleAxis(num3, val);
					Vector3 val4 = val2 * val3 * ((Ray)(ref aimRay)).direction;
					((Ray)(ref val5))..ctor(((Ray)(ref aimRay)).origin, val4);
					BulletAttack val6 = ((GenericBulletBaseState)self).GenerateBulletAttack(val5);
					((GenericBulletBaseState)self).ModifyBullet(val6);
					val6.Fire();
				}
			}
		}

		private void IncreaseHemorrhageStacks(orig_AuthorityModifyOverlapAttack orig, SlashBlade self, OverlapAttack overlapAttack)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			DamageAPI.AddModdedDamageType(overlapAttack, banditDoubleHemorrhage);
			orig.Invoke(self, overlapAttack);
		}

		private void ApplyNewDamageTypes(orig_SendDamageDealt orig, DamageReport damageReport)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, banditOpenWound) && Object.op_Implicit((Object)(object)damageReport.victimBody))
			{
				DotController.InflictDot(((Component)damageReport.victimBody).gameObject, damageReport.attacker, emptyDotIdx, 0f, 1f, (uint?)null);
			}
			if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, banditDoubleHemorrhage) && damageReport.damageInfo.crit && Object.op_Implicit((Object)(object)damageReport.victimBody))
			{
				DotController.InflictDot(((Component)damageReport.victimBody).gameObject, damageReport.attacker, (DotIndex)6, 8f, 1f, (uint?)null);
			}
			orig.Invoke(damageReport);
		}

		private void ReduceRecoil(orig_OnEnter orig, Bandit2FirePrimaryBase self)
		{
			if (self is Bandit2FireRifle)
			{
				((GenericBulletBaseState)self).spreadBloomValue = 0.65f;
				((GenericBulletBaseState)self).spreadYawScale = 0.25f;
				((GenericBulletBaseState)self).spreadPitchScale = 0.3f;
			}
			orig.Invoke(self);
		}
	}
}