Decompiled source of Admiral v2.5.2

Admiral.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
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.Captain.Weapon;
using EntityStates.CaptainSupplyDrop;
using IL.RoR2;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using On.EntityStates;
using On.EntityStates.Captain.Weapon;
using On.RoR2;
using On.RoR2.Orbs;
using On.RoR2.Projectile;
using On.RoR2.Skills;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Hologram;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.Stats;
using TILER2;
using UnityEngine;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Admiral")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+29ca6b36d77913a3cb1d4634e8ee295e38eee509")]
[assembly: AssemblyProduct("Admiral")]
[assembly: AssemblyTitle("Admiral")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ThinkInvisible.Admiral;

[BepInDependency("com.bepis.r2api", "5.1.5")]
[BepInDependency("com.ThinkInvisible.TILER2", "7.4.3")]
[BepInPlugin("com.ThinkInvisible.Admiral", "Admiral", "2.5.2")]
public class AdmiralPlugin : BaseUnityPlugin
{
	public const string ModVer = "2.5.2";

	public const string ModName = "Admiral";

	public const string ModGuid = "com.ThinkInvisible.Admiral";

	internal static ManualLogSource logger;

	internal static AssetBundle resources;

	internal static ConfigFile cfgFile;

	private FilingDictionary<T2Module> allModules;

	public void Awake()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Expected O, but got Unknown
		//IL_0053: 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)
		logger = ((BaseUnityPlugin)this).Logger;
		cfgFile = new ConfigFile(Path.Combine(Paths.ConfigPath, "com.ThinkInvisible.Admiral.cfg"), true);
		using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Admiral.admiral_assets"))
		{
			resources = AssetBundle.LoadFromStream(stream);
		}
		allModules = T2Module.InitModules(new ModInfo
		{
			displayName = "Admiral",
			longIdentifier = "Admiral",
			shortIdentifier = "ADML",
			mainConfigFile = cfgFile
		});
		T2Module.SetupAll_PluginAwake((IEnumerable<T2Module>)allModules);
	}

	public void Start()
	{
		T2Module.SetupAll_PluginStart((IEnumerable<T2Module>)allModules, false);
	}
}
public class CaptainBeaconDecayer : MonoBehaviour
{
	public float lifetime = 15f;

	public bool silent = false;

	private float stopwatch = 0f;

	private GenericEnergyComponent energyCpt;

	public static float lifetimeDropAdjust { get; internal set; } = 4f;


	private void Awake()
	{
		energyCpt = ((Component)this).gameObject.GetComponent<GenericEnergyComponent>();
	}

	private void FixedUpdate()
	{
		//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_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Expected O, but got Unknown
		stopwatch += Time.fixedDeltaTime;
		if (Object.op_Implicit((Object)(object)energyCpt))
		{
			energyCpt.capacity = lifetime;
			energyCpt.energy = lifetime - stopwatch + lifetimeDropAdjust;
		}
		if (stopwatch >= lifetime + lifetimeDropAdjust)
		{
			if (!silent)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("prefabs/effects/omnieffect/OmniExplosionVFXEngiTurretDeath"), new EffectData
				{
					origin = ((Component)this).transform.position,
					scale = 5f
				}, true);
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class BeaconRebalance : T2Module<BeaconRebalance>
{
	internal GameObject muzzleFlashPrefab;

	private bool isNormalRechargeRunning = false;

	[AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float beaconCDRInfluence { get; private set; } = 0.5f;


	[AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float beaconRestockInfluence { get; private set; } = 0.5f;


	[AutoConfigRoOCheckbox(null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public bool removeOriginals { get; private set; } = true;


	public override string enabledConfigDescription => "Changes all Beacon skills to have cooldown and lifetime, and replaces some variants which are incompatible with this model.";

	public override AutoConfigUpdateActionTypes enabledConfigUpdateActionTypes => (AutoConfigUpdateActionTypes)1;

	public override AutoConfigFlags enabledConfigFlags => (AutoConfigFlags)66;

	public override void SetupAttributes()
	{
		((T2Module)this).SetupAttributes();
		muzzleFlashPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/MuzzleflashSupplyDrop, Healing");
	}

	public override void InstallLanguage()
	{
		((T2Module)this).InstallLanguage();
		((T2Module)this).languageOverlays.Add(LanguageAPI.AddOverlay("CAPTAIN_SPECIAL_DESCRIPTION", "Request one of two <style=cIsUtility>temporary</style> Supply Beacons. Both beacons have <style=cIsUtility>independent cooldowns</style>."));
	}

	public override void Install()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Expected O, but got Unknown
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Expected O, but got Unknown
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Expected O, but got Unknown
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Expected O, but got Unknown
		((T2Module)this).Install();
		CaptainSupplyDropController.UpdateSkillOverrides += new Manipulator(IL_CSDCUpdateSkillOverrides);
		CaptainSupplyDropController.SetSkillOverride += new hook_SetSkillOverride(On_CSDCSetSkillOverride);
		GenericSkill.CalculateFinalRechargeInterval += new hook_CalculateFinalRechargeInterval(On_GSCalculateFinalRechargeInterval);
		GenericSkill.RecalculateMaxStock += new hook_RecalculateMaxStock(On_GSRecalculateMaxStock);
		GenericSkill.AddOneStock += new hook_AddOneStock(On_GSAddOneStock);
		GenericSkill.RunRecharge += new hook_RunRecharge(On_GSRunRecharge);
		GenericSkill.FixedUpdate += new hook_FixedUpdate(On_GSFixedUpdate);
		((T2Module)T2Module<EquipBeacon>.instance).Install();
		((T2Module)T2Module<HackBeacon>.instance).Install();
		((T2Module)T2Module<HealBeacon>.instance).Install();
		((T2Module)T2Module<ShockBeacon>.instance).Install();
		((T2Module)T2Module<StasisBeacon>.instance).Install();
	}

	public override void Uninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Expected O, but got Unknown
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Expected O, but got Unknown
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Expected O, but got Unknown
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Expected O, but got Unknown
		((T2Module)this).Uninstall();
		CaptainSupplyDropController.UpdateSkillOverrides -= new Manipulator(IL_CSDCUpdateSkillOverrides);
		CaptainSupplyDropController.SetSkillOverride -= new hook_SetSkillOverride(On_CSDCSetSkillOverride);
		GenericSkill.CalculateFinalRechargeInterval -= new hook_CalculateFinalRechargeInterval(On_GSCalculateFinalRechargeInterval);
		GenericSkill.RecalculateMaxStock -= new hook_RecalculateMaxStock(On_GSRecalculateMaxStock);
		GenericSkill.AddOneStock -= new hook_AddOneStock(On_GSAddOneStock);
		GenericSkill.RunRecharge -= new hook_RunRecharge(On_GSRunRecharge);
		GenericSkill.FixedUpdate -= new hook_FixedUpdate(On_GSFixedUpdate);
		((T2Module)T2Module<EquipBeacon>.instance).Uninstall();
		((T2Module)T2Module<HackBeacon>.instance).Uninstall();
		((T2Module)T2Module<HealBeacon>.instance).Uninstall();
		((T2Module)T2Module<ShockBeacon>.instance).Uninstall();
		((T2Module)T2Module<StasisBeacon>.instance).Uninstall();
	}

	private bool SkillIsTemporaryBeacon(SkillDef skillDef)
	{
		return (Object)(object)skillDef == (Object)(object)T2Module<EquipBeacon>.instance.skillDef || (Object)(object)skillDef == (Object)(object)T2Module<HackBeacon>.instance.skillDef || (Object)(object)skillDef == (Object)(object)T2Module<HealBeacon>.instance.skillDef || (Object)(object)skillDef == (Object)(object)T2Module<ShockBeacon>.instance.skillDef || (Object)(object)skillDef == (Object)(object)T2Module<StasisBeacon>.instance.skillDef;
	}

	private bool SkillIsTemporaryBeacon(GenericSkill skill)
	{
		return SkillIsTemporaryBeacon(skill.skillDef);
	}

	private void On_GSFixedUpdate(orig_FixedUpdate orig, GenericSkill self)
	{
		isNormalRechargeRunning = true;
		orig.Invoke(self);
		isNormalRechargeRunning = false;
	}

	private void On_GSRunRecharge(orig_RunRecharge orig, GenericSkill self, float dt)
	{
		if (SkillIsTemporaryBeacon(self) && !isNormalRechargeRunning)
		{
			dt *= beaconCDRInfluence;
		}
		orig.Invoke(self, dt);
	}

	private void On_GSAddOneStock(orig_AddOneStock orig, GenericSkill self)
	{
		if (SkillIsTemporaryBeacon(self))
		{
			self.rechargeStopwatch += self.finalRechargeInterval * beaconRestockInfluence;
		}
		else
		{
			orig.Invoke(self);
		}
	}

	private void On_GSRecalculateMaxStock(orig_RecalculateMaxStock orig, GenericSkill self)
	{
		orig.Invoke(self);
		if (SkillIsTemporaryBeacon(self))
		{
			self.maxStock = 1;
		}
	}

	private float On_GSCalculateFinalRechargeInterval(orig_CalculateFinalRechargeInterval orig, GenericSkill self)
	{
		float num = orig.Invoke(self);
		if (SkillIsTemporaryBeacon(self))
		{
			return self.baseRechargeInterval * (1f - beaconCDRInfluence) + num * beaconCDRInfluence;
		}
		return num;
	}

	private void On_CSDCSetSkillOverride(orig_SetSkillOverride orig, CaptainSupplyDropController self, ref SkillDef currentSkillDef, SkillDef newSkillDef, GenericSkill component)
	{
		if (!SkillIsTemporaryBeacon(currentSkillDef))
		{
			orig.Invoke(self, ref currentSkillDef, newSkillDef, component);
		}
	}

	private void IL_CSDCUpdateSkillOverrides(ILContext il)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Expected O, but got Unknown
		ILCursor val = new ILCursor(il);
		int maskLocIndex = -1;
		int num = default(int);
		ILLabel val2 = default(ILLabel);
		if (val.TryGotoNext(new Func<Instruction, bool>[5]
		{
			(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref maskLocIndex),
			(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, maskLocIndex),
			(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num),
			(Instruction x) => ILPatternMatchingExt.MatchLdfld<CaptainSupplyDropController>(x, "authorityEnabledSkillsMask"),
			(Instruction x) => ILPatternMatchingExt.MatchBeq(x, ref val2)
		}))
		{
			val.Index = 0;
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, maskLocIndex)
			});
			val.EmitDelegate<Func<byte, byte>>((Func<byte, byte>)((byte orig) => 3));
		}
		else
		{
			AdmiralPlugin.logger.LogError((object)"BeaconRebalance/CSDCUpdateSkillOverrides: Failed to apply IL patch (target instructions not found)");
		}
	}
}
public class CancelOrbitalSkills : T2Module<CancelOrbitalSkills>
{
	public override string enabledConfigDescription => "Allows orbital skills to be cancelled by reactivating the skill.";

	public override void Install()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((T2Module)this).Install();
		GenericSkill.ExecuteIfReady += new hook_ExecuteIfReady(GenericSkill_ExecuteIfReady);
	}

	public override void Uninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((T2Module)this).Uninstall();
		GenericSkill.ExecuteIfReady -= new hook_ExecuteIfReady(GenericSkill_ExecuteIfReady);
	}

	private bool GenericSkill_ExecuteIfReady(orig_ExecuteIfReady orig, GenericSkill self)
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		bool flag = orig.Invoke(self);
		if (flag || !Object.op_Implicit((Object)(object)self.stateMachine) || self.stateMachine.HasPendingState())
		{
			return flag;
		}
		Type type = ((object)self.stateMachine.state).GetType();
		SerializableEntityStateType activationState = self.activationState;
		if (type == ((SerializableEntityStateType)(ref activationState)).stateType && (self.stateMachine.state is SetupAirstrike || self.stateMachine.state is SetupSupplyDrop))
		{
			self.stateMachine.SetNextStateToMain();
		}
		return false;
	}
}
public class CatalyzerDartSkill : T2Module<CatalyzerDartSkill>
{
	public class MalevolentCleanseOnHit : MonoBehaviour
	{
	}

	internal UnlockableDef unlockable;

	internal SkillDef skillDef;

	internal GameObject projectilePrefab;

	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillRecharge { get; private set; } = 8f;


	[AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float evilCleanseDoTDamage { get; private set; } = 3f;


	[AutoConfigRoOSlider("{0:P0}", 0f, 20f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float evilCleanseNonDoTDamage { get; private set; } = 5f;


	public override string enabledConfigDescription => "Adds the Catalyzer Dart secondary skill variant.";

	public override AutoConfigFlags enabledConfigFlags => (AutoConfigFlags)72;

	public override void SetupAttributes()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		((T2Module)this).SetupAttributes();
		bool flag = default(bool);
		SerializableEntityStateType activationState = ContentAddition.AddEntityState<EntStateFireCatalyzer>(ref flag);
		projectilePrefab = MiscUtil.ModifyVanillaPrefab("RoR2/Base/Captain/CaptainTazer.prefab", "CaptainCatalyzerProjectile", true, (Func<GameObject, GameObject>)delegate(GameObject projPfbPfb)
		{
			//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)
			projPfbPfb.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)0);
			((ProjectileExplosion)projPfbPfb.GetComponent<ProjectileImpactExplosion>()).blastRadius = 1f;
			projPfbPfb.AddComponent<MalevolentCleanseOnHit>();
			return projPfbPfb;
		});
		ContentAddition.AddProjectile(projectilePrefab);
		string text = "ADMIRAL_CATALYZER_SKILL_NAME";
		string text2 = "ADMIRAL_CATALYZER_SKILL_DESC";
		string text3 = "Catalyzer Dart";
		LanguageAPI.Add(text, text3);
		LanguageAPI.Add(text2, "Fire a fast dart which <style=cIsHealing>catalyzes all debuffs</style>, converting them to <style=cIsDamage>damage</style>: <style=cIsDamage>300%</style> of the remaining total for DoTs, <style=cIsDamage>1x500%</style> otherwise.");
		skillDef = ScriptableObject.CreateInstance<SkillDef>();
		skillDef.activationStateMachineName = "Weapon";
		skillDef.activationState = activationState;
		skillDef.interruptPriority = (InterruptPriority)1;
		skillDef.baseRechargeInterval = skillRecharge;
		skillDef.baseMaxStock = 1;
		skillDef.rechargeStock = 1;
		skillDef.beginSkillCooldownOnSkillEnd = false;
		skillDef.requiredStock = 1;
		skillDef.stockToConsume = 1;
		skillDef.isCombatSkill = true;
		skillDef.cancelSprintingOnActivation = true;
		skillDef.canceledFromSprinting = false;
		skillDef.mustKeyPress = false;
		skillDef.fullRestockOnAssign = true;
		skillDef.dontAllowPastMaxStocks = false;
		skillDef.skillName = text3;
		skillDef.skillNameToken = text;
		skillDef.skillDescriptionToken = text2;
		skillDef.icon = AdmiralPlugin.resources.LoadAsset<Sprite>("Assets/Admiral/Textures/Icons/icon_AdmiralCatalyzerSkill.png");
		ContentAddition.AddSkillDef(skillDef);
		string text4 = "ACHIEVEMENT_ADMIRAL_" + ((T2Module)this).name.ToUpper(CultureInfo.InvariantCulture) + "_NAME";
		string text5 = "ACHIEVEMENT_ADMIRAL_" + ((T2Module)this).name.ToUpper(CultureInfo.InvariantCulture) + "_DESCRIPTION";
		unlockable = ScriptableObject.CreateInstance<UnlockableDef>();
		unlockable.cachedName = "Admiral_" + ((T2Module)this).name + "Unlockable";
		unlockable.sortScore = 200;
		unlockable.achievementIcon = AdmiralPlugin.resources.LoadAsset<Sprite>("Assets/Admiral/Textures/Icons/icon_AdmiralCatalyzerSkill.png");
		ContentAddition.AddUnlockableDef(unlockable);
		LanguageAPI.Add(text4, "Captain: Hoist By Their Own Petard");
		LanguageAPI.Add(text5, "As Captain, kill 6 other enemies by Shocking the same one.");
	}

	public override void Install()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Expected O, but got Unknown
		((T2Module)this).Install();
		SkillUtil.AddVariant(LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSecondarySkillFamily"), skillDef, unlockable);
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		FireTazer.Fire += new hook_Fire(FireTazer_Fire);
	}

	public override void Uninstall()
	{
		((T2Module)this).Uninstall();
		SkillUtil.RemoveVariant(LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSecondarySkillFamily"), skillDef);
	}

	private void FireTazer_Fire(orig_Fire orig, FireTazer self)
	{
		if (!(self is EntStateFireCatalyzer))
		{
			orig.Invoke(self);
			return;
		}
		GameObject val = FireTazer.projectilePrefab;
		FireTazer.projectilePrefab = projectilePrefab;
		orig.Invoke(self);
		FireTazer.projectilePrefab = val;
	}

	private void GlobalEventManager_onServerDamageDealt(DamageReport obj)
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Invalid comparison between Unknown and I4
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: 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_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: 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_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)(object)obj.victimBody) || !Object.op_Implicit((Object)(object)obj.damageInfo.inflictor) || !Object.op_Implicit((Object)(object)obj.damageInfo.inflictor.GetComponent<MalevolentCleanseOnHit>()))
		{
			return;
		}
		int num = 0;
		for (BuffIndex val = (BuffIndex)0; (int)val < BuffCatalog.buffCount; val = (BuffIndex)(val + 1))
		{
			BuffDef buffDef = BuffCatalog.GetBuffDef(val);
			if (buffDef.isDebuff)
			{
				num += obj.victimBody.GetBuffCount(val);
			}
		}
		EntityStateMachine val2 = ((Component)obj.victimBody).GetComponent<SetStateOnHurt>()?.targetStateMachine;
		if (Object.op_Implicit((Object)(object)val2) && (val2.state is FrozenState || val2.state is StunState || val2.state is ShockState))
		{
			num++;
		}
		float num2 = 0f;
		if (DotController.dotControllerLocator.TryGetValue(((Object)((Component)obj.victimBody).gameObject).GetInstanceID(), out var value))
		{
			List<DotStack> dotStackList = value.dotStackList;
			foreach (DotStack item in dotStackList)
			{
				num2 += item.damage * Mathf.Ceil(item.timer / item.dotDef.interval);
			}
		}
		obj.victimBody.healthComponent.TakeDamage(new DamageInfo
		{
			attacker = obj.attacker,
			crit = false,
			damage = (float)num * obj.attackerBody.damage * evilCleanseNonDoTDamage + num2 * evilCleanseDoTDamage,
			damageType = DamageTypeCombo.op_Implicit((DamageType)0),
			procCoefficient = 0f
		});
		Util.CleanseBody(obj.victimBody, true, false, true, true, false, false);
	}
}
[RegisterAchievement("Admiral_CatalyzerDartSkill", "Admiral_CatalyzerDartSkillUnlockable", "CompleteMainEnding", 3u, null)]
public class AdmiralCatalyzerAchievement : BaseAchievement
{
	public override bool wantsBodyCallbacks => true;

	public override BodyIndex LookUpRequiredBodyIndex()
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return BodyCatalog.FindBodyIndex("CaptainBody");
	}

	public override void OnInstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((BaseAchievement)this).OnInstall();
		LightningOrb.OnArrival += new hook_OnArrival(LightningOrb_OnArrival);
	}

	public override void OnUninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((BaseAchievement)this).OnUninstall();
		LightningOrb.OnArrival -= new hook_OnArrival(LightningOrb_OnArrival);
	}

	private void LightningOrb_OnArrival(orig_OnArrival orig, LightningOrb self)
	{
		orig.Invoke(self);
		if (!(self is ShockedOrb shockedOrb) || self.failedToKill || !Object.op_Implicit((Object)(object)shockedOrb.shockVictim))
		{
			return;
		}
		ShockHelper component = shockedOrb.shockVictim.GetComponent<ShockHelper>();
		if (Object.op_Implicit((Object)(object)component))
		{
			component.shockKills++;
			if (component.shockKills >= 6)
			{
				((BaseAchievement)this).Grant();
			}
		}
	}
}
public class EntStateFireCatalyzer : FireTazer
{
}
public class EquipBeacon : T2Module<EquipBeacon>
{
	public class EntStateCallSupplyDropRejuvenator : CallSupplyDropEquipmentRestock
	{
		public override void OnEnter()
		{
			((CallSupplyDropBase)this).supplyDropPrefab = T2Module<EquipBeacon>.instance.beaconPrefab;
			((CallSupplyDropBase)this).muzzleflashEffect = T2Module<BeaconRebalance>.instance.muzzleFlashPrefab;
			((CallSupplyDropBase)this).OnEnter();
		}
	}

	public class EntStateRejuvenatorMainState : EquipmentRestockMainState
	{
		public override bool shouldShowEnergy => T2Module<EquipBeacon>.instance.useInteractable && T2Module<EquipBeacon>.instance.interactableLimited;

		public override void OnEnter()
		{
			//IL_0042: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			((BaseCaptainSupplyDropState)this).OnEnter();
			if (NetworkServer.active && !T2Module<EquipBeacon>.instance.useInteractable)
			{
				GameObject val = Object.Instantiate<GameObject>(T2Module<EquipBeacon>.instance.rejuvWardPrefab, ((EntityState)this).outer.commonComponents.transform.position, ((EntityState)this).outer.commonComponents.transform.rotation);
				val.GetComponent<TeamFilter>().teamIndex = ((BaseCaptainSupplyDropState)this).teamFilter.teamIndex;
				NetworkServer.Spawn(val);
			}
		}

		public override void OnInteractionBegin(Interactor activator)
		{
			if (!Object.op_Implicit((Object)(object)activator))
			{
				return;
			}
			CharacterBody component = ((Component)activator).GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && !component.HasBuff(T2Module<EquipBeacon>.instance.stimmedBuff))
			{
				if (T2Module<EquipBeacon>.instance.interactableLimited)
				{
					((BaseCaptainSupplyDropState)this).energyComponent.TakeEnergy(base.activationCost);
				}
				component.AddTimedBuff(T2Module<EquipBeacon>.instance.stimmedBuff, T2Module<EquipBeacon>.instance.skillLifetime);
			}
		}

		public override Interactability GetInteractability(Interactor activator)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			if (!T2Module<EquipBeacon>.instance.useInteractable)
			{
				return (Interactability)0;
			}
			if (!Object.op_Implicit((Object)(object)activator))
			{
				return (Interactability)0;
			}
			CharacterBody component = ((Component)activator).GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return (Interactability)0;
			}
			if (T2Module<EquipBeacon>.instance.interactableLimited && base.activationCost >= ((BaseCaptainSupplyDropState)this).energyComponent.energy)
			{
				return (Interactability)1;
			}
			if (component.HasBuff(T2Module<EquipBeacon>.instance.stimmedBuff))
			{
				return (Interactability)1;
			}
			return (Interactability)2;
		}

		public override string GetContextString(Interactor activator)
		{
			return Language.GetString("ADMIRAL_SUPPLY_REJUVENATOR_CONTEXT");
		}
	}

	private GameObject rejuvWardPrefab;

	private SkillFamily skillFamily1;

	private SkillFamily skillFamily2;

	private SkillDef origSkillDef;

	internal SkillDef skillDef;

	internal GameObject beaconPrefab;

	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillLifetime { get; private set; } = 20f;


	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillRecharge { get; private set; } = 50f;


	[AutoConfigRoOSlider("{0:P0}", 0f, 5f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float rechargeRate { get; private set; } = 0.5f;


	[AutoConfigRoOCheckbox(null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public bool useInteractable { get; private set; } = true;


	[AutoConfigRoOCheckbox(null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public bool interactableLimited { get; private set; } = false;


	public override string enabledConfigDescription => "Contains config for the T.Beacon: Resupply submodule of Modules.BeaconRebalance. Replaces Beacon: Equipment.";

	public override bool managedEnable => false;

	public BuffDef stimmedBuff { get; private set; }

	public override void SetupAttributes()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_0347: Unknown result type (might be due to invalid IL or missing references)
		//IL_035f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0364: Unknown result type (might be due to invalid IL or missing references)
		((T2Module)this).SetupAttributes();
		bool flag = default(bool);
		SerializableEntityStateType activationState = ContentAddition.AddEntityState<EntStateCallSupplyDropRejuvenator>(ref flag);
		SerializableEntityStateType mainStateType = ContentAddition.AddEntityState<EntStateRejuvenatorMainState>(ref flag);
		skillFamily1 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop1SkillFamily");
		skillFamily2 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop2SkillFamily");
		origSkillDef = LegacyResourcesAPI.Load<SkillDef>("skilldefs/captainbody/CallSupplyDropEquipmentRestock");
		skillDef = SkillUtil.CloneSkillDef(origSkillDef);
		skillDef.rechargeStock = 1;
		skillDef.baseRechargeInterval = skillRecharge;
		skillDef.skillName = "AdmiralSupplyDropRejuvenator";
		skillDef.skillNameToken = "ADMIRAL_SUPPLY_REJUVENATOR_NAME";
		skillDef.skillDescriptionToken = "ADMIRAL_SUPPLY_REJUVENATOR_DESCRIPTION";
		skillDef.activationState = activationState;
		LanguageAPI.Add(skillDef.skillNameToken, "T.Beacon: Rejuvenator");
		LanguageAPI.Add(skillDef.skillDescriptionToken, "<style=cIsUtility>Temporary beacon</style>. <style=cIsUtility>Buff</style> all nearby allies with <style=cIsUtility>+50% skill recharge rate</style>.");
		ContentAddition.AddSkillDef(skillDef);
		stimmedBuff = ScriptableObject.CreateInstance<BuffDef>();
		((Object)stimmedBuff).name = "Stimmed";
		stimmedBuff.iconSprite = LegacyResourcesAPI.Load<Sprite>("textures/itemicons/texSyringeIcon");
		stimmedBuff.buffColor = Color.red;
		stimmedBuff.canStack = false;
		stimmedBuff.isDebuff = false;
		ContentAddition.AddBuffDef(stimmedBuff);
		LanguageAPI.Add("ADMIRAL_SUPPLY_REJUVENATOR_CONTEXT", "Take stim charge");
		GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/captainsupplydrops/CaptainSupplyDrop, EquipmentRestock"), "TempSetup, BeaconPrefabPrefab", false);
		CaptainBeaconDecayer captainBeaconDecayer = val.AddComponent<CaptainBeaconDecayer>();
		captainBeaconDecayer.lifetime = skillLifetime;
		if (!useInteractable)
		{
			((Behaviour)val.GetComponent<ProxyInteraction>()).enabled = false;
			((Behaviour)val.GetComponent<GenericEnergyComponent>()).enabled = true;
		}
		val.GetComponent<EntityStateMachine>().mainStateType = mainStateType;
		beaconPrefab = PrefabAPI.InstantiateClone(val, "AdmiralSupplyDrop, Rejuvenator", true);
		Object.Destroy((Object)(object)val);
		GameObject val2 = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/captainsupplydrops/CaptainHealingWard"));
		((Behaviour)val2.GetComponent<HealingWard>()).enabled = false;
		Transform val3 = val2.transform.Find("Indicator");
		CaptainBeaconDecayer captainBeaconDecayer2 = val2.AddComponent<CaptainBeaconDecayer>();
		captainBeaconDecayer2.lifetime = skillLifetime - CaptainBeaconDecayer.lifetimeDropAdjust;
		captainBeaconDecayer2.silent = true;
		BuffWard val4 = val2.AddComponent<BuffWard>();
		val4.buffDef = stimmedBuff;
		val4.buffDuration = 1f;
		val4.radius = 10f;
		val4.interval = 1f;
		val4.rangeIndicator = val3;
		((Renderer)((Component)val3.Find("IndicatorRing")).GetComponent<MeshRenderer>()).material.SetColor("_TintColor", new Color(1f, 0.5f, 0f, 1f));
		ParticleSystemRenderer component = ((Component)val3.Find("HealingSymbols")).GetComponent<ParticleSystemRenderer>();
		((Renderer)component).material.SetTexture("_MainTex", LegacyResourcesAPI.Load<Texture>("textures/bufficons/texBuffTeslaIcon"));
		((Renderer)component).material.SetColor("_TintColor", new Color(2f, 0.05f, 0f, 1f));
		component.trailMaterial.SetColor("_TintColor", new Color(2f, 0.05f, 0f, 1f));
		MainModule main = ((Component)val3.Find("Flashes")).GetComponent<ParticleSystem>().main;
		((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.5f, 0.25f, 0f, 1f));
		rejuvWardPrefab = PrefabAPI.InstantiateClone(val2, "CaptainRejuvWard", true);
		Object.Destroy((Object)(object)val2);
	}

	public override void Install()
	{
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		((T2Module)this).Install();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, origSkillDef, skillDef);
			SkillUtil.ReplaceVariant(skillFamily2, origSkillDef, skillDef);
		}
		else
		{
			SkillUtil.AddVariant(skillFamily1, skillDef, (UnlockableDef)null);
			SkillUtil.AddVariant(skillFamily2, skillDef, (UnlockableDef)null);
		}
		SkillDef.OnFixedUpdate += new hook_OnFixedUpdate(On_SkillDefFixedUpdate);
	}

	public override void Uninstall()
	{
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Expected O, but got Unknown
		((T2Module)this).Uninstall();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, skillDef, origSkillDef);
			SkillUtil.ReplaceVariant(skillFamily2, skillDef, origSkillDef);
		}
		else
		{
			SkillUtil.RemoveVariant(skillFamily1, skillDef);
			SkillUtil.RemoveVariant(skillFamily2, skillDef);
		}
		SkillDef.OnFixedUpdate -= new hook_OnFixedUpdate(On_SkillDefFixedUpdate);
	}

	private void On_SkillDefFixedUpdate(orig_OnFixedUpdate orig, SkillDef self, GenericSkill skillSlot, float deltaTime)
	{
		if (skillSlot.characterBody.HasBuff(stimmedBuff))
		{
			skillSlot.RunRecharge(deltaTime * rechargeRate);
		}
		orig.Invoke(self, skillSlot, deltaTime);
	}
}
public class HackBeacon : T2Module<HackBeacon>
{
	public class EntStateCallSupplyDropSpecialOrder : CallSupplyDropHacking
	{
		public override void OnEnter()
		{
			((CallSupplyDropBase)this).supplyDropPrefab = T2Module<HackBeacon>.instance.beaconPrefab;
			((CallSupplyDropBase)this).muzzleflashEffect = T2Module<BeaconRebalance>.instance.muzzleFlashPrefab;
			((CallSupplyDropBase)this).OnEnter();
		}
	}

	public class EntStateSpecialOrderMainState : HackingMainState
	{
		public override bool shouldShowEnergy => true;

		public override void OnEnter()
		{
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			((HackingMainState)this).OnEnter();
			if (!NetworkServer.active)
			{
				return;
			}
			ItemWard component = ((Component)((EntityState)this).outer).gameObject.GetComponent<ItemWard>();
			List<ItemDef> list = (from x in Run.instance.availableTier1DropList
				select ItemCatalog.GetItemDef(PickupCatalog.GetPickupDef(x).itemIndex) into x
				where !FakeInventory.blacklist.Contains(x)
				select x).ToList();
			List<ItemDef> list2 = (from x in Run.instance.availableTier2DropList
				select ItemCatalog.GetItemDef(PickupCatalog.GetPickupDef(x).itemIndex) into x
				where !FakeInventory.blacklist.Contains(x)
				select x).ToList();
			List<ItemDef> list3 = (from x in Run.instance.availableTier3DropList
				select ItemCatalog.GetItemDef(PickupCatalog.GetPickupDef(x).itemIndex) into x
				where !FakeInventory.blacklist.Contains(x)
				select x).ToList();
			if (T2Module<HackBeacon>.instance.splitDHU)
			{
				WeightedSelection<List<ItemDef>> val = new WeightedSelection<List<ItemDef>>(8);
				val.AddChoice(list.Where((ItemDef x) => x.ContainsTag((ItemTag)1)).ToList(), T2Module<HackBeacon>.instance.itemTier1Chance);
				val.AddChoice(list2.Where((ItemDef x) => x.ContainsTag((ItemTag)1)).ToList(), T2Module<HackBeacon>.instance.itemTier2Chance);
				val.AddChoice(list3.Where((ItemDef x) => x.ContainsTag((ItemTag)1)).ToList(), T2Module<HackBeacon>.instance.itemTier3Chance);
				WeightedSelection<List<ItemDef>> val2 = new WeightedSelection<List<ItemDef>>(8);
				val2.AddChoice(list.Where((ItemDef x) => x.ContainsTag((ItemTag)2)).ToList(), T2Module<HackBeacon>.instance.itemTier1Chance);
				val2.AddChoice(list2.Where((ItemDef x) => x.ContainsTag((ItemTag)2)).ToList(), T2Module<HackBeacon>.instance.itemTier2Chance);
				val2.AddChoice(list3.Where((ItemDef x) => x.ContainsTag((ItemTag)2)).ToList(), T2Module<HackBeacon>.instance.itemTier3Chance);
				WeightedSelection<List<ItemDef>> val3 = new WeightedSelection<List<ItemDef>>(8);
				val3.AddChoice(list.Where((ItemDef x) => x.DoesNotContainTag((ItemTag)1) && x.DoesNotContainTag((ItemTag)2)).ToList(), T2Module<HackBeacon>.instance.itemTier1Chance);
				val3.AddChoice(list2.Where((ItemDef x) => x.DoesNotContainTag((ItemTag)1) && x.DoesNotContainTag((ItemTag)2)).ToList(), T2Module<HackBeacon>.instance.itemTier2Chance);
				val3.AddChoice(list3.Where((ItemDef x) => x.DoesNotContainTag((ItemTag)1) && x.DoesNotContainTag((ItemTag)2)).ToList(), T2Module<HackBeacon>.instance.itemTier3Chance);
				int num = ((T2Module)T2Module<HackBeacon>.instance).rng.RangeInt(0, 3);
				for (int i = 0; i < T2Module<HackBeacon>.instance.baseItems + T2Module<HackBeacon>.instance.itemsPerStage * Run.instance.stageClearCount; i++)
				{
					List<ItemDef> list4 = ((WeightedSelection<List<ItemDef>>)(((i + num) % 3) switch
					{
						0 => val, 
						1 => val2, 
						_ => val3, 
					})).Evaluate(Run.instance.treasureRng.nextNormalizedFloat);
					ItemDef val4 = Run.instance.treasureRng.NextElementUniform<ItemDef>(list4);
					component.ServerAddItem(val4.itemIndex);
				}
			}
			else
			{
				WeightedSelection<List<ItemDef>> val5 = new WeightedSelection<List<ItemDef>>(8);
				val5.AddChoice(list, T2Module<HackBeacon>.instance.itemTier1Chance);
				val5.AddChoice(list2, T2Module<HackBeacon>.instance.itemTier2Chance);
				val5.AddChoice(list3, T2Module<HackBeacon>.instance.itemTier3Chance);
				for (int j = 0; j < T2Module<HackBeacon>.instance.baseItems + T2Module<HackBeacon>.instance.itemsPerStage * Run.instance.stageClearCount; j++)
				{
					List<ItemDef> list5 = val5.Evaluate(Run.instance.treasureRng.nextNormalizedFloat);
					ItemDef val6 = Run.instance.treasureRng.NextElementUniform<ItemDef>(list5);
					component.ServerAddItem(val6.itemIndex);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime;
		}
	}

	private SkillFamily skillFamily1;

	private SkillFamily skillFamily2;

	private SkillDef origSkillDef;

	internal SkillDef skillDef;

	internal GameObject beaconPrefab;

	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillLifetime { get; private set; } = 20f;


	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillRecharge { get; private set; } = 40f;


	[AutoConfigRoOSlider("{0:N0} m", 0f, 100f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float wardRadius { get; private set; } = 10f;


	[AutoConfigRoOIntSlider("{0:N0}", 0, 30, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public int baseItems { get; private set; } = 6;


	[AutoConfigRoOIntSlider("{0:N0}", 0, 30, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public int itemsPerStage { get; private set; } = 3;


	[AutoConfigRoOSlider("{0:N3}", 0f, 2f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float itemTier1Chance { get; private set; } = 0.8f;


	[AutoConfigRoOSlider("{0:N3}", 0f, 2f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float itemTier2Chance { get; private set; } = 0.2f;


	[AutoConfigRoOSlider("{0:N3}", 0f, 2f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float itemTier3Chance { get; private set; } = 0.01f;


	[AutoConfigRoOCheckbox(null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public bool splitDHU { get; private set; } = true;


	public override string enabledConfigDescription => "Contains config for the T.Beacon: Special Order submodule of Modules.BeaconRebalance. Replaces Beacon: Hacking.";

	public override bool managedEnable => false;

	public override void SetupAttributes()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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_00ad: 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_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		((T2Module)this).SetupAttributes();
		bool flag = default(bool);
		SerializableEntityStateType activationState = ContentAddition.AddEntityState<EntStateCallSupplyDropSpecialOrder>(ref flag);
		SerializableEntityStateType mainStateType = ContentAddition.AddEntityState<EntStateSpecialOrderMainState>(ref flag);
		skillFamily1 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop1SkillFamily");
		skillFamily2 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop2SkillFamily");
		origSkillDef = LegacyResourcesAPI.Load<SkillDef>("skilldefs/captainbody/CallSupplyDropHacking");
		skillDef = SkillUtil.CloneSkillDef(origSkillDef);
		skillDef.rechargeStock = 1;
		skillDef.baseRechargeInterval = skillRecharge;
		skillDef.skillName = "AdmiralSupplyDropSpecialOrder";
		skillDef.skillNameToken = "ADMIRAL_SUPPLY_SPECIALORDER_NAME";
		skillDef.skillDescriptionToken = "ADMIRAL_SUPPLY_SPECIALORDER_DESCRIPTION";
		skillDef.activationState = activationState;
		skillDef.icon = origSkillDef.icon;
		LanguageAPI.Add(skillDef.skillNameToken, "T.Beacon: Special Order");
		LanguageAPI.Add(skillDef.skillDescriptionToken, "<style=cIsUtility>Temporary beacon</style>. Requisition a pack of <style=cIsUtility>random, disposable items</style> from your trusty quartermaster. All allies standing near the beacon receive these items until it runs out of energy.");
		ContentAddition.AddSkillDef(skillDef);
		GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/captainsupplydrops/CaptainSupplyDrop, Hacking"), "TempSetup, BeaconPrefabPrefab", false);
		((Behaviour)val.GetComponent<GenericEnergyComponent>()).enabled = true;
		CaptainBeaconDecayer captainBeaconDecayer = val.AddComponent<CaptainBeaconDecayer>();
		captainBeaconDecayer.lifetime = skillLifetime;
		val.GetComponent<EntityStateMachine>().mainStateType = mainStateType;
		val.AddComponent<Inventory>();
		ItemWard val2 = val.AddComponent<ItemWard>();
		val2.radius = wardRadius;
		Transform val3 = val.transform.Find("ModelBase").Find("captain supply drop").Find("Indicator");
		((Behaviour)((Component)val3).gameObject.GetComponent<ObjectScaleCurve>()).enabled = false;
		Transform child = val3.GetChild(0);
		child.localScale /= 1.5f;
		val2.rangeIndicator = val3;
		beaconPrefab = PrefabAPI.InstantiateClone(val, "AdmiralSupplyDrop, SpecialOrder", true);
		Object.Destroy((Object)(object)val);
	}

	public override void Install()
	{
		((T2Module)this).Install();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, origSkillDef, skillDef);
			SkillUtil.ReplaceVariant(skillFamily2, origSkillDef, skillDef);
		}
		else
		{
			SkillUtil.AddVariant(skillFamily1, skillDef, (UnlockableDef)null);
			SkillUtil.AddVariant(skillFamily2, skillDef, (UnlockableDef)null);
		}
	}

	public override void Uninstall()
	{
		((T2Module)this).Uninstall();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, skillDef, origSkillDef);
			SkillUtil.ReplaceVariant(skillFamily2, skillDef, origSkillDef);
		}
		else
		{
			SkillUtil.RemoveVariant(skillFamily1, skillDef);
			SkillUtil.RemoveVariant(skillFamily2, skillDef);
		}
	}
}
public class HealBeacon : T2Module<HealBeacon>
{
	public class EntStateCallSupplyDropHealing : CallSupplyDropHealing
	{
		public override void OnEnter()
		{
			((CallSupplyDropBase)this).supplyDropPrefab = T2Module<HealBeacon>.instance.beaconPrefab;
			((CallSupplyDropBase)this).muzzleflashEffect = T2Module<BeaconRebalance>.instance.muzzleFlashPrefab;
			((CallSupplyDropBase)this).OnEnter();
		}
	}

	public class EntStateHealingMainState : HealZoneMainState
	{
		public override bool shouldShowEnergy => true;
	}

	private SkillFamily skillFamily1;

	private SkillFamily skillFamily2;

	private SkillDef origSkillDef;

	internal SkillDef skillDef;

	internal GameObject beaconPrefab;

	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillLifetime { get; private set; } = 20f;


	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillRecharge { get; private set; } = 40f;


	public override string enabledConfigDescription => "Contains config for the T.Beacon: Healing submodule of Modules.BeaconRebalance. Replaces Beacon: Healing.";

	public override bool managedEnable => false;

	public override void SetupAttributes()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		((T2Module)this).SetupAttributes();
		bool flag = default(bool);
		SerializableEntityStateType activationState = ContentAddition.AddEntityState<EntStateCallSupplyDropHealing>(ref flag);
		SerializableEntityStateType mainStateType = ContentAddition.AddEntityState<EntStateHealingMainState>(ref flag);
		skillFamily1 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop1SkillFamily");
		skillFamily2 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop2SkillFamily");
		origSkillDef = LegacyResourcesAPI.Load<SkillDef>("skilldefs/captainbody/CallSupplyDropHealing");
		skillDef = SkillUtil.CloneSkillDef(origSkillDef);
		skillDef.rechargeStock = 1;
		skillDef.baseRechargeInterval = skillRecharge;
		skillDef.skillName = "AdmiralSupplyDropHealing";
		skillDef.skillNameToken = "ADMIRAL_SUPPLY_HEALING_NAME";
		skillDef.skillDescriptionToken = "ADMIRAL_SUPPLY_HEALING_DESCRIPTION";
		skillDef.activationState = activationState;
		LanguageAPI.Add(skillDef.skillNameToken, "T.Beacon: Healing");
		LanguageAPI.Add(skillDef.skillDescriptionToken, "<style=cIsUtility>Temporary beacon</style>. <style=cIsHealing>Heal</style> all nearby allies for <style=cIsHealing>10%</style> of their <style=cIsHealing>maximum health</style> every second.");
		ContentAddition.AddSkillDef(skillDef);
		GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/captainsupplydrops/CaptainSupplyDrop, Healing"), "TempSetup, BeaconPrefabPrefab", false);
		((Behaviour)val.GetComponent<GenericEnergyComponent>()).enabled = true;
		CaptainBeaconDecayer captainBeaconDecayer = val.AddComponent<CaptainBeaconDecayer>();
		captainBeaconDecayer.lifetime = skillLifetime;
		val.GetComponent<EntityStateMachine>().mainStateType = mainStateType;
		beaconPrefab = PrefabAPI.InstantiateClone(val, "AdmiralSupplyDrop, Healing", true);
		Object.Destroy((Object)(object)val);
	}

	public override void Install()
	{
		((T2Module)this).Install();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, origSkillDef, skillDef);
			SkillUtil.ReplaceVariant(skillFamily2, origSkillDef, skillDef);
		}
		else
		{
			SkillUtil.AddVariant(skillFamily1, skillDef, (UnlockableDef)null);
			SkillUtil.AddVariant(skillFamily2, skillDef, (UnlockableDef)null);
		}
	}

	public override void Uninstall()
	{
		((T2Module)this).Uninstall();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, skillDef, origSkillDef);
			SkillUtil.ReplaceVariant(skillFamily2, skillDef, origSkillDef);
		}
		else
		{
			SkillUtil.RemoveVariant(skillFamily1, skillDef);
			SkillUtil.RemoveVariant(skillFamily2, skillDef);
		}
	}
}
public class EntStateCallJumpPad : BaseSkillState
{
	public override void OnEnter()
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Expected O, but got Unknown
		((BaseState)this).OnEnter();
		if (((EntityState)this).isAuthority)
		{
			switch (((BaseSkillState)this).activatorSkillSlot.stock)
			{
			case 0:
			{
				CallAirstrike2 val2 = new CallAirstrike2();
				((AimThrowableBase)val2).projectilePrefab = T2Module<OrbitalJumpPadSkill>.instance.jumpPadPrefabProj2;
				((AimThrowableBase)val2).maxDistance = 100f;
				((EntityState)this).outer.SetNextState((EntityState)(object)val2);
				break;
			}
			case 1:
			{
				CallAirstrike1 val = new CallAirstrike1();
				((AimThrowableBase)val).projectilePrefab = T2Module<OrbitalJumpPadSkill>.instance.jumpPadPrefabProj1;
				((AimThrowableBase)val).maxDistance = 100f;
				((EntityState)this).outer.SetNextState((EntityState)(object)val);
				break;
			}
			default:
				AdmiralPlugin.logger.LogError((object)"Jump pad skill has invalid stock count!");
				break;
			}
		}
	}

	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 EntStateSetupJumpPad : SetupAirstrike
{
	public override void OnEnter()
	{
		SkillDef primarySkillDef = SetupAirstrike.primarySkillDef;
		SetupAirstrike.primarySkillDef = T2Module<OrbitalJumpPadSkill>.instance.callSkillDef;
		((SetupAirstrike)this).OnEnter();
		SetupAirstrike.primarySkillDef = primarySkillDef;
	}

	public override void OnExit()
	{
		SkillDef primarySkillDef = SetupAirstrike.primarySkillDef;
		SetupAirstrike.primarySkillDef = T2Module<OrbitalJumpPadSkill>.instance.callSkillDef;
		((SetupAirstrike)this).OnExit();
		SetupAirstrike.primarySkillDef = primarySkillDef;
	}
}
public class OrbitalJumpPadSkill : T2Module<OrbitalJumpPadSkill>
{
	private struct MsgSetJumpPadTarget : INetMessage, ISerializableObject
	{
		private GameObject _targetJumpPad;

		private Vector3 _velocity;

		private Vector3 _targetPos;

		public void Serialize(NetworkWriter writer)
		{
			//IL_0010: 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)
			writer.Write(_targetJumpPad);
			writer.Write(_velocity);
			writer.Write(_targetPos);
		}

		public void Deserialize(NetworkReader reader)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			_targetJumpPad = reader.ReadGameObject();
			_velocity = reader.ReadVector3();
			_targetPos = reader.ReadVector3();
		}

		public void OnReceived()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)_targetJumpPad))
			{
				GameObject gameObject = ((Component)_targetJumpPad.transform.Find("mdlHumanFan").Find("JumpVolume")).gameObject;
				gameObject.GetComponent<JumpVolume>().jumpVelocity = _velocity;
				LineRenderer component = gameObject.GetComponent<LineRenderer>();
				if (T2Module<OrbitalJumpPadSkill>.instance.showArcs)
				{
					component.SetPositions(CalculateJumpPadPoints(gameObject.transform.position, _targetPos, 5f, 32));
				}
				else
				{
					((Renderer)component).enabled = false;
				}
			}
		}

		public MsgSetJumpPadTarget(GameObject targetJumpPad, Vector3 velocity, Vector3 targetPos)
		{
			//IL_0009: 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_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			_targetJumpPad = targetJumpPad;
			_velocity = velocity;
			_targetPos = targetPos;
		}
	}

	internal SkillDef setupSkillDef;

	internal SkillDef callSkillDef;

	internal UnlockableDef unlockable;

	internal GameObject jumpPadPrefabBase;

	internal GameObject jumpPadPrefabProj1;

	internal GameObject jumpPadPrefabProj2;

	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillLifetime { get; private set; } = 20f;


	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillRecharge { get; private set; } = 50f;


	[AutoConfigRoOSlider("{0:N0} m", 0f, 300f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillRange { get; private set; } = 80f;


	[AutoConfigRoOCheckbox(null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public bool showArcs { get; private set; } = true;


	[AutoConfigRoOCheckbox(null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public bool doubleStock { get; private set; } = true;


	public override string enabledConfigDescription => "Adds the Orbital Jump Pad utility skill variant.";

	public override AutoConfigFlags enabledConfigFlags => (AutoConfigFlags)72;

	public override void SetupAttributes()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		((T2Module)this).SetupAttributes();
		bool flag = default(bool);
		SerializableEntityStateType activationState = ContentAddition.AddEntityState<EntStateCallJumpPad>(ref flag);
		SerializableEntityStateType activationState2 = ContentAddition.AddEntityState<EntStateSetupJumpPad>(ref flag);
		NetworkingAPI.RegisterMessageType<MsgSetJumpPadTarget>();
		string text = "ACHIEVEMENT_ADMIRAL_" + ((T2Module)this).name.ToUpper(CultureInfo.InvariantCulture) + "_NAME";
		string text2 = "ACHIEVEMENT_ADMIRAL_" + ((T2Module)this).name.ToUpper(CultureInfo.InvariantCulture) + "_DESCRIPTION";
		unlockable = ScriptableObject.CreateInstance<UnlockableDef>();
		unlockable.cachedName = "Admiral_" + ((T2Module)this).name + "Unlockable";
		unlockable.sortScore = 200;
		unlockable.achievementIcon = AdmiralPlugin.resources.LoadAsset<Sprite>("Assets/Admiral/Textures/Icons/icon_AdmiralJumpPadSkill.png");
		ContentAddition.AddUnlockableDef(unlockable);
		LanguageAPI.Add(text, "Captain: Damn The Torpedoes");
		LanguageAPI.Add(text2, "As Captain, nail a very speedy target with an Orbital Probe.");
		jumpPadPrefabBase = MiscUtil.ModifyVanillaPrefab("RoR2/Base/frozenwall/FW_HumanFan.prefab", "CaptainJumpPad", true, (Func<GameObject, GameObject>)ModifyJumpPadPrefab);
		jumpPadPrefabProj1 = MiscUtil.ModifyVanillaPrefab("RoR2/Base/Captain/CaptainAirstrikeProjectile1.prefab", "CaptainJumpPadProjectile1", true, (Func<GameObject, GameObject>)ModifyAirstrike1Prefab);
		ContentAddition.AddProjectile(jumpPadPrefabProj1);
		jumpPadPrefabProj2 = MiscUtil.ModifyVanillaPrefab("RoR2/Base/Captain/CaptainAirstrikeProjectile1.prefab", "CaptainJumpPadProjectile2", true, (Func<GameObject, GameObject>)ModifyAirstrike2Prefab);
		ContentAddition.AddProjectile(jumpPadPrefabProj2);
		string text3 = "ADMIRAL_JUMPPAD_SKILL_NAME";
		string text4 = "ADMIRAL_JUMPPAD_SKILL_DESC";
		string text5 = "Orbital Jump Pad";
		LanguageAPI.Add(text3, text5);
		LanguageAPI.Add(text4, "Request an Orbital Jump Pad from the <style=cIsUtility>UES Safe Travels</style>. Fire once to set the jump pad, then again to set its target (both within <style=cIsUtility>80 m</style>).");
		setupSkillDef = ScriptableObject.CreateInstance<SkillDef>();
		setupSkillDef.activationStateMachineName = "Skillswap";
		setupSkillDef.activationState = activationState2;
		setupSkillDef.interruptPriority = (InterruptPriority)1;
		setupSkillDef.baseRechargeInterval = skillRecharge;
		setupSkillDef.baseMaxStock = ((!doubleStock) ? 1 : 2);
		setupSkillDef.rechargeStock = ((!doubleStock) ? 1 : 2);
		setupSkillDef.beginSkillCooldownOnSkillEnd = true;
		setupSkillDef.requiredStock = 1;
		setupSkillDef.stockToConsume = 1;
		setupSkillDef.isCombatSkill = false;
		setupSkillDef.cancelSprintingOnActivation = true;
		setupSkillDef.canceledFromSprinting = true;
		setupSkillDef.mustKeyPress = true;
		setupSkillDef.fullRestockOnAssign = true;
		setupSkillDef.skillName = text5;
		setupSkillDef.skillNameToken = text3;
		setupSkillDef.skillDescriptionToken = text4;
		setupSkillDef.icon = AdmiralPlugin.resources.LoadAsset<Sprite>("Assets/Admiral/Textures/Icons/icon_AdmiralJumpPadSkill.png");
		ContentAddition.AddSkillDef(setupSkillDef);
		callSkillDef = ScriptableObject.CreateInstance<SkillDef>();
		callSkillDef.activationStateMachineName = "Weapon";
		callSkillDef.activationState = activationState;
		callSkillDef.interruptPriority = (InterruptPriority)2;
		callSkillDef.baseRechargeInterval = 0f;
		callSkillDef.baseMaxStock = 2;
		callSkillDef.rechargeStock = 0;
		callSkillDef.beginSkillCooldownOnSkillEnd = true;
		callSkillDef.requiredStock = 1;
		callSkillDef.stockToConsume = 1;
		callSkillDef.isCombatSkill = false;
		callSkillDef.cancelSprintingOnActivation = true;
		callSkillDef.canceledFromSprinting = true;
		callSkillDef.mustKeyPress = true;
		callSkillDef.fullRestockOnAssign = true;
		callSkillDef.dontAllowPastMaxStocks = true;
		callSkillDef.skillName = text5;
		callSkillDef.skillNameToken = text3;
		callSkillDef.skillDescriptionToken = text4;
		callSkillDef.icon = AdmiralPlugin.resources.LoadAsset<Sprite>("Assets/Admiral/Textures/Icons/icon_AdmiralJumpPadSkill.png");
		ContentAddition.AddSkillDef(callSkillDef);
	}

	private void ProjectileExplosion_DetonateServer(orig_DetonateServer orig, ProjectileExplosion self)
	{
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self);
		if (!NetworkServer.active)
		{
			return;
		}
		if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<OrbitalJumpPad1ImpactEventFlag>()))
		{
			GameObject owner = ((Component)self).GetComponent<ProjectileController>().owner;
			if (Object.op_Implicit((Object)(object)owner))
			{
				OrbitalJumpPadDeployTracker orbitalJumpPadDeployTracker = owner.GetComponent<OrbitalJumpPadDeployTracker>();
				if (!Object.op_Implicit((Object)(object)orbitalJumpPadDeployTracker))
				{
					orbitalJumpPadDeployTracker = owner.AddComponent<OrbitalJumpPadDeployTracker>();
				}
				GameObject val = Object.Instantiate<GameObject>(jumpPadPrefabBase, ((Component)self).transform.position, ((Component)self).transform.rotation);
				if (Object.op_Implicit((Object)(object)orbitalJumpPadDeployTracker.prevPadBase))
				{
					Object.Destroy((Object)(object)orbitalJumpPadDeployTracker.prevPadBase);
				}
				orbitalJumpPadDeployTracker.prevPadBase = orbitalJumpPadDeployTracker.lastPadBase;
				orbitalJumpPadDeployTracker.lastPadBase = val;
				NetworkServer.Spawn(val);
			}
		}
		else
		{
			if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<OrbitalJumpPad2ImpactEventFlag>()))
			{
				return;
			}
			GameObject owner2 = ((Component)self).GetComponent<ProjectileController>().owner;
			if (!Object.op_Implicit((Object)(object)owner2))
			{
				return;
			}
			OrbitalJumpPadDeployTracker component = owner2.GetComponent<OrbitalJumpPadDeployTracker>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.lastPadBase))
			{
				(Vector3, float) tuple = CalculateJumpPadTrajectory(component.lastPadBase.transform.position, ((Component)self).transform.position, 5f);
				if (!float.IsNaN(tuple.Item1.y))
				{
					NetMessageExtensions.Send((INetMessage)(object)new MsgSetJumpPadTarget(component.lastPadBase, tuple.Item1, ((Component)self).transform.position), (NetworkDestination)1);
					component.lastPadBase.GetComponent<ChestBehavior>().Open();
				}
				else
				{
					Object.Destroy((Object)(object)component.lastPadBase);
				}
			}
		}
	}

	public override void Install()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		((T2Module)this).Install();
		JumpVolume.OnTriggerStay += new hook_OnTriggerStay(JumpVolume_OnTriggerStay);
		ProjectileExplosion.DetonateServer += new hook_DetonateServer(ProjectileExplosion_DetonateServer);
		SkillFamily val = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainUtilitySkillFamily");
		SkillUtil.AddVariant(val, setupSkillDef, unlockable);
	}

	public override void Uninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		((T2Module)this).Uninstall();
		JumpVolume.OnTriggerStay -= new hook_OnTriggerStay(JumpVolume_OnTriggerStay);
		ProjectileExplosion.DetonateServer -= new hook_DetonateServer(ProjectileExplosion_DetonateServer);
		SkillFamily val = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainUtilitySkillFamily");
		SkillUtil.RemoveVariant(val, setupSkillDef);
	}

	public static (Vector3, float) CalculateJumpPadTrajectory(Vector3 source, Vector3 target, float extraPeakHeight)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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)
		Vector3 val = target - source;
		float y = val.y;
		float num = Mathf.Max(new float[3]
		{
			Mathf.Max(y, 0f) + extraPeakHeight,
			y,
			0f
		});
		float num2 = 0f - Physics.gravity.y;
		float num3 = Mathf.Sqrt(2f * num2 * num);
		float num4 = Mathf.Sqrt(2f) / num2 * (Mathf.Sqrt(num2 * (num - y)) + Mathf.Sqrt(num2 * num));
		float num5 = val.x / num4;
		float num6 = val.z / num4;
		return (new Vector3(num5, num3, num6), num4);
	}

	public static Vector3[] CalculateJumpPadPoints(Vector3 source, Vector3 target, float extraPeakHeight, int displayPointsToGenerate)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = target - source;
		float y = val.y;
		float num = Mathf.Max(new float[3]
		{
			Mathf.Max(y, 0f) + extraPeakHeight,
			y,
			0f
		});
		float num2 = 0f - Physics.gravity.y;
		float num3 = Mathf.Sqrt(2f * num2 * num);
		float num4 = Mathf.Sqrt(2f) / num2 * (Mathf.Sqrt(num2 * (num - y)) + Mathf.Sqrt(num2 * num));
		float num5 = val.x / num4;
		float num6 = val.z / num4;
		Vector3 val2 = default(Vector3);
		((Vector3)(ref val2))..ctor(num5, num3, num6);
		Vector3[] array = (Vector3[])(object)new Vector3[displayPointsToGenerate];
		float num7 = num4 / ((float)displayPointsToGenerate - 1f);
		for (int i = 0; i < displayPointsToGenerate; i++)
		{
			array[i] = Trajectory.CalculatePositionAtTime(source, val2, num7 * (float)i);
		}
		return array;
	}

	private GameObject ModifyJumpPadPrefab(GameObject origPrefab)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_00b6: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: 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_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: 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_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_024c: Expected O, but got Unknown
		origPrefab.transform.localScale = new Vector3(0.75f, 0.125f, 0.75f);
		Transform val = origPrefab.transform.Find("mdlHumanFan").Find("JumpVolume");
		Transform val2 = val.Find("LoopParticles").Find("Particle System");
		val2.localScale = new Vector3(0.25f, 0.25f, 0.25f);
		MainModule main = ((Component)val2).gameObject.GetComponent<ParticleSystem>().main;
		((MainModule)(ref main)).startSpeed = new MinMaxCurve(6f);
		Transform val3 = val.Find("LoopParticles").Find("ForwardDust");
		val3.localScale = new Vector3(0.25f, 0.25f, 0.25f);
		MainModule main2 = ((Component)val3).gameObject.GetComponent<ParticleSystem>().main;
		((MainModule)(ref main2)).startSpeed = new MinMaxCurve(0.5f, 12f);
		Transform val4 = val.Find("ActivateParticles").Find("ForwardDust");
		val4.localScale = new Vector3(0.3f, 0.3f, 0.3f);
		MainModule main3 = ((Component)val4).gameObject.GetComponent<ParticleSystem>().main;
		((MainModule)(ref main3)).startSpeed = new MinMaxCurve(0.75f, 15f);
		Transform val5 = val.Find("ActivateParticles").Find("Circle");
		val5.localScale = new Vector3(0.25f, 0.25f, 0.125f);
		LineRenderer val6 = ((Component)val).gameObject.AddComponent<LineRenderer>();
		((Renderer)val6).material = Object.Instantiate<Material>(LegacyResourcesAPI.Load<Material>("materials/matBlueprintsOk"));
		((Renderer)val6).material.SetColor("_TintColor", new Color(2f, 0.2f, 10f, 3f));
		val6.positionCount = 32;
		List<Keyframe> list = new List<Keyframe>();
		for (int i = 0; i < val6.positionCount; i++)
		{
			list.Add(new Keyframe((float)i / 32f, (1f - MiscUtil.Wrap((float)i / 8f, 0f, 1f)) * 0.875f));
		}
		val6.widthCurve = new AnimationCurve
		{
			keys = list.ToArray()
		};
		((Behaviour)origPrefab.GetComponent<PurchaseInteraction>()).enabled = false;
		((Behaviour)origPrefab.GetComponent<HologramProjector>()).enabled = false;
		((Behaviour)origPrefab.GetComponent<OccupyNearbyNodes>()).enabled = false;
		((Component)val).gameObject.AddComponent<TemporaryFallProtectionProvider>();
		CaptainBeaconDecayer captainBeaconDecayer = origPrefab.AddComponent<CaptainBeaconDecayer>();
		captainBeaconDecayer.lifetime = skillLifetime;
		return origPrefab;
	}

	private GameObject ModifyAirstrike1Prefab(GameObject origPrefab)
	{
		ProjectileImpactExplosion component = origPrefab.GetComponent<ProjectileImpactExplosion>();
		((ProjectileExplosion)component).blastDamageCoefficient = 0.1f;
		((ProjectileExplosion)component).blastRadius = 5f;
		component.lifetime = 0.5f;
		origPrefab.AddComponent<OrbitalJumpPad1ImpactEventFlag>();
		return origPrefab;
	}

	private GameObject ModifyAirstrike2Prefab(GameObject origPrefab)
	{
		ProjectileImpactExplosion component = origPrefab.GetComponent<ProjectileImpactExplosion>();
		((ProjectileExplosion)component).blastDamageCoefficient = 0.05f;
		((ProjectileExplosion)component).blastRadius = 2.5f;
		component.lifetime = 0.5f;
		origPrefab.AddComponent<OrbitalJumpPad2ImpactEventFlag>();
		return origPrefab;
	}

	private void JumpVolume_OnTriggerStay(orig_OnTriggerStay orig, JumpVolume self, Collider other)
	{
		orig.Invoke(self, other);
		TemporaryFallProtectionProvider component = ((Component)self).GetComponent<TemporaryFallProtectionProvider>();
		CharacterBody component2 = ((Component)other).GetComponent<CharacterBody>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.characterMotor))
		{
			TemporaryFallDamageProtection temporaryFallDamageProtection = ((Component)other).GetComponent<TemporaryFallDamageProtection>();
			if (!Object.op_Implicit((Object)(object)temporaryFallDamageProtection))
			{
				temporaryFallDamageProtection = ((Component)other).gameObject.AddComponent<TemporaryFallDamageProtection>();
			}
			temporaryFallDamageProtection.Apply();
		}
	}
}
public class TemporaryFallDamageProtection : NetworkBehaviour
{
	private CharacterBody attachedBody;

	private bool hasProtection = false;

	private bool disableNextFrame = false;

	private bool disableN2f = false;

	private void FixedUpdate()
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		if (disableN2f)
		{
			disableN2f = false;
			disableNextFrame = true;
		}
		else if (disableNextFrame)
		{
			disableNextFrame = false;
			hasProtection = false;
			CharacterBody obj = attachedBody;
			obj.bodyFlags = (BodyFlags)(obj.bodyFlags & -2);
		}
		else if (hasProtection && ((BaseCharacterController)attachedBody.characterMotor).Motor.GroundingStatus.IsStableOnGround && !((BaseCharacterController)attachedBody.characterMotor).Motor.LastGroundingStatus.IsStableOnGround)
		{
			disableN2f = true;
		}
	}

	private void Awake()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		attachedBody = ((Component)this).GetComponent<CharacterBody>();
		attachedBody.characterMotor.onMovementHit += new MovementHitDelegate(CharacterMotor_onMovementHit);
	}

	public void Apply()
	{
		//IL_000f: 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_0016: Unknown result type (might be due to invalid IL or missing references)
		hasProtection = true;
		CharacterBody obj = attachedBody;
		obj.bodyFlags = (BodyFlags)(obj.bodyFlags | 1);
	}

	private void CharacterMotor_onMovementHit(ref MovementHitInfo movementHitInfo)
	{
		if (hasProtection && !disableN2f && !disableNextFrame)
		{
			disableN2f = true;
		}
	}
}
public class TemporaryFallProtectionProvider : MonoBehaviour
{
}
public class OrbitalJumpPadDeployTracker : MonoBehaviour
{
	public GameObject lastPadBase;

	public GameObject prevPadBase;
}
public class OrbitalJumpPad1ImpactEventFlag : MonoBehaviour
{
}
public class OrbitalJumpPad2ImpactEventFlag : MonoBehaviour
{
}
[RegisterAchievement("Admiral_OrbitalJumpPadSkill", "Admiral_OrbitalJumpPadSkillUnlockable", "CompleteMainEnding", 5u, null)]
public class AdmiralJumpPadAchievement : BaseAchievement
{
	private int projTestInd1 = -1;

	private int projTestInd2 = -1;

	private int projTestInd3 = -1;

	public override bool wantsBodyCallbacks => true;

	public override BodyIndex LookUpRequiredBodyIndex()
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return BodyCatalog.FindBodyIndex("CaptainBody");
	}

	public override void OnInstall()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		((BaseAchievement)this).OnInstall();
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		CharacterBody.Awake += new hook_Awake(CharacterBody_Awake);
		projTestInd1 = ProjectileCatalog.FindProjectileIndex("CaptainAirstrikeProjectile1");
		projTestInd2 = ProjectileCatalog.FindProjectileIndex("CaptainAirstrikeProjectile2");
		projTestInd3 = ProjectileCatalog.FindProjectileIndex("CaptainAirstrikeProjectile3");
	}

	public override void OnUninstall()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		((BaseAchievement)this).OnUninstall();
		GlobalEventManager.onServerDamageDealt -= GlobalEventManager_onServerDamageDealt;
		CharacterBody.Awake -= new hook_Awake(CharacterBody_Awake);
	}

	private void CharacterBody_Awake(orig_Awake orig, CharacterBody self)
	{
		orig.Invoke(self);
		((Component)self).gameObject.AddComponent<AverageSpeedTracker>();
	}

	private void GlobalEventManager_onServerDamageDealt(DamageReport obj)
	{
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		if (!((BaseAchievement)this).meetsBodyRequirement || !Object.op_Implicit((Object)(object)obj.victimBody) || !Object.op_Implicit((Object)(object)obj.damageInfo.attacker) || !Object.op_Implicit((Object)(object)obj.damageInfo.inflictor) || NetworkUser.readOnlyLocalPlayersList.Count == 0)
		{
			return;
		}
		GameObject attacker = obj.damageInfo.attacker;
		CharacterBody currentBody = NetworkUser.readOnlyLocalPlayersList[0].GetCurrentBody();
		if ((Object)(object)attacker != (Object)(object)((currentBody != null) ? ((Component)currentBody).gameObject : null))
		{
			return;
		}
		int projectileIndex = ProjectileCatalog.GetProjectileIndex(obj.damageInfo.inflictor);
		if (projectileIndex != projTestInd1 && projectileIndex != projTestInd2 && projectileIndex != projTestInd3)
		{
			return;
		}
		AverageSpeedTracker component = ((Component)obj.victimBody).GetComponent<AverageSpeedTracker>();
		if (Object.op_Implicit((Object)(object)component))
		{
			float num = component.QuerySpeed();
			Vector3 val = obj.damageInfo.position - obj.damageInfo.inflictor.transform.position;
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (num > 20f && magnitude < 4f)
			{
				((BaseAchievement)this).Grant();
			}
		}
	}
}
public class AverageSpeedTracker : MonoBehaviour
{
	private readonly List<Vector3> positions = new List<Vector3>();

	private readonly List<float> deltas = new List<float>();

	public float pollingRate = 0.2f;

	private uint _history = 5u;

	private float stopwatch = 0f;

	public uint history
	{
		get
		{
			return _history;
		}
		set
		{
			positions.Clear();
			deltas.Clear();
			_history = value;
		}
	}

	private void FixedUpdate()
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch > pollingRate)
		{
			positions.Add(((Component)this).transform.position);
			deltas.Add(stopwatch);
			if (positions.Count >= _history)
			{
				positions.RemoveAt(0);
				deltas.RemoveAt(0);
			}
			stopwatch = 0f;
		}
	}

	public float QuerySpeed()
	{
		//IL_0016: 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)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		float num = 0f;
		for (int i = 0; i < positions.Count - 1; i++)
		{
			float num2 = num;
			Vector3 val = positions[i + 1] - positions[i];
			num = num2 + ((Vector3)(ref val)).magnitude / deltas[i + 1];
		}
		return num;
	}
}
public class OrbitalSkillsAnywhere : T2Module<OrbitalSkillsAnywhere>
{
	private Hook CUOSHook;

	public override string enabledConfigDescription => "Allows orbital skills to be used anywhere except Bazaar.";

	public override void SetupBehavior()
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		((T2Module)this).SetupBehavior();
		MethodInfo methodCached = Reflection.GetMethodCached(typeof(CaptainOrbitalSkillDef), "get_isAvailable");
		MethodInfo methodCached2 = Reflection.GetMethodCached(typeof(OrbitalSkillsAnywhere), "Hook_Get_IsAvailable");
		CUOSHook = new Hook((MethodBase)methodCached, methodCached2, new HookConfig
		{
			ManualApply = true
		});
	}

	public override void Install()
	{
		((T2Module)this).Install();
		CUOSHook.Apply();
	}

	public override void Uninstall()
	{
		((T2Module)this).Uninstall();
		CUOSHook.Undo();
	}

	private static bool Hook_Get_IsAvailable(CaptainOrbitalSkillDef self)
	{
		return SceneCatalog.mostRecentSceneDef.baseSceneName != "bazaar";
	}
}
public class ShockBeacon : T2Module<ShockBeacon>
{
	public class EntStateCallSupplyDropShocking : CallSupplyDropShocking
	{
		public override void OnEnter()
		{
			((CallSupplyDropBase)this).supplyDropPrefab = T2Module<ShockBeacon>.instance.beaconPrefab;
			((CallSupplyDropBase)this).muzzleflashEffect = T2Module<BeaconRebalance>.instance.muzzleFlashPrefab;
			((CallSupplyDropBase)this).OnEnter();
		}
	}

	public class EntStateShockingMainState : ShockZoneMainState
	{
		public override bool shouldShowEnergy => true;

		public override void FixedUpdate()
		{
			((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime;
			base.shockTimer += Time.fixedDeltaTime;
			if (base.shockTimer > T2Module<ShockBeacon>.instance.shockRate)
			{
				base.shockTimer -= T2Module<ShockBeacon>.instance.shockRate;
				((ShockZoneMainState)this).Shock();
			}
		}
	}

	private SkillFamily skillFamily1;

	private SkillFamily skillFamily2;

	private SkillDef origSkillDef;

	internal SkillDef skillDef;

	internal GameObject beaconPrefab;

	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillLifetime { get; private set; } = 8f;


	[AutoConfigRoOSlider("{0:N0} s", 0f, 120f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float skillRecharge { get; private set; } = 24f;


	[AutoConfigRoOSlider("{0:N2} s", 0f, 30f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float shockRate { get; private set; } = 0.95f;


	public override string enabledConfigDescription => "Contains config for the T.Beacon: Shocking submodule of Modules.BeaconRebalance. Replaces Beacon: Shocking.";

	public override bool managedEnable => false;

	public override void SetupAttributes()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		((T2Module)this).SetupAttributes();
		bool flag = default(bool);
		SerializableEntityStateType activationState = ContentAddition.AddEntityState<EntStateCallSupplyDropShocking>(ref flag);
		SerializableEntityStateType mainStateType = ContentAddition.AddEntityState<EntStateShockingMainState>(ref flag);
		skillFamily1 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop1SkillFamily");
		skillFamily2 = LegacyResourcesAPI.Load<SkillFamily>("skilldefs/captainbody/CaptainSupplyDrop2SkillFamily");
		origSkillDef = LegacyResourcesAPI.Load<SkillDef>("skilldefs/captainbody/CallSupplyDropShocking");
		skillDef = SkillUtil.CloneSkillDef(origSkillDef);
		skillDef.rechargeStock = 1;
		skillDef.baseRechargeInterval = skillRecharge;
		skillDef.skillName = "AdmiralSupplyDropShocking";
		skillDef.skillNameToken = "ADMIRAL_SUPPLY_SHOCKING_NAME";
		skillDef.skillDescriptionToken = "ADMIRAL_SUPPLY_SHOCKING_DESCRIPTION";
		skillDef.activationState = activationState;
		LanguageAPI.Add(skillDef.skillNameToken, "T.Beacon: Shocking");
		LanguageAPI.Add(skillDef.skillDescriptionToken, "<style=cIsUtility>Temporary beacon</style>. <style=cIsDamage>Shock</style> all nearby enemies rapidly for a short time.");
		ContentAddition.AddSkillDef(skillDef);
		GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/captainsupplydrops/CaptainSupplyDrop, Shocking"), "TempSetup, BeaconPrefabPrefab", false);
		((Behaviour)val.GetComponent<GenericEnergyComponent>()).enabled = true;
		CaptainBeaconDecayer captainBeaconDecayer = val.AddComponent<CaptainBeaconDecayer>();
		captainBeaconDecayer.lifetime = skillLifetime;
		val.GetComponent<EntityStateMachine>().mainStateType = mainStateType;
		beaconPrefab = PrefabAPI.InstantiateClone(val, "AdmiralSupplyDrop, Shocking", true);
		Object.Destroy((Object)(object)val);
	}

	public override void Install()
	{
		((T2Module)this).Install();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, origSkillDef, skillDef);
			SkillUtil.ReplaceVariant(skillFamily2, origSkillDef, skillDef);
		}
		else
		{
			SkillUtil.AddVariant(skillFamily1, skillDef, (UnlockableDef)null);
			SkillUtil.AddVariant(skillFamily2, skillDef, (UnlockableDef)null);
		}
	}

	public override void Uninstall()
	{
		((T2Module)this).Uninstall();
		if (T2Module<BeaconRebalance>.instance.removeOriginals)
		{
			SkillUtil.ReplaceVariant(skillFamily1, skillDef, origSkillDef);
			SkillUtil.ReplaceVariant(skillFamily2, skillDef, origSkillDef);
		}
		else
		{
			SkillUtil.RemoveVariant(skillFamily1, skillDef);
			SkillUtil.RemoveVariant(skillFamily2, skillDef);
		}
	}
}
internal class ShockedOrb : LightningOrb
{
	public GameObject shockVictim;
}
public class ShockStatusTweaks : T2Module<ShockStatusTweaks>
{
	[AutoConfigRoOSlider("{0:P2}", 0f, 1f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float shockChance { get; private set; } = 0.033f;


	[AutoConfigRoOSlider("{0:P1}", 0f, 2f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float shockDamageFrac { get; private set; } = 0.02f;


	[AutoConfigRoOSlider("{0:N0} m", 0f, 100f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float shockRadius { get; private set; } = 15f;


	[AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float shockProcCoef { get; private set; } = 0.1f;


	[AutoConfigRoOCheckbox(null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public bool doThresholdTweak { get; private set; } = true;


	public override string enabledConfigDescription => "Removes the health threshold from the Shocked status and causes it to deal AoE damage based on victim max health.";

	public override AutoConfigUpdateActionTypes enabledConfigUpdateActionTypes => (AutoConfigUpdateActionTypes)1;

	public override void InstallLanguage()
	{
		((T2Module)this).InstallLanguage();
		((T2Module)this).languageOverlays.Add(LanguageAPI.AddOverlay("KEYWORD_SHOCKING", "<style=cKeywordName>Shocking</style><style=cSub>Interrupts enemies and temporarily stuns them. A victim of Shocking will <style=cIsDamage>damage their nearby allies</style> for a fraction of their own maximum health per second."));
	}

	public override void Install()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		((T2Module)this).Install();
		ShockState.OnEnter += new hook_OnEnter(On_ShockStateOnEnter);
		ShockState.FixedUpdate += new hook_FixedUpdate(On_ShockStateFixedUpdate);
		SetStateOnHurt.OnTakeDamageServer += new Manipulator(IL_SSOHTakeDamageServer);
	}

	public override void Uninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		((T2Module)this).Uninstall();
		ShockState.OnEnter -= new hook_OnEnter(On_ShockStateOnEnter);
		ShockState.FixedUpdate -= new hook_FixedUpdate(On_ShockStateFixedUpdate);
		SetStateOnHurt.OnTakeDamageServer -= new Manipulator(IL_SSOHTakeDamageServer);
	}

	private void IL_SSOHTakeDamageServer(ILContext il)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		ILCursor val = new ILCursor(il);
		val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
		{
			(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<SetStateOnHurt>(x, "SetShock")
		});
		val.Emit(OpCodes.Ldarg_0);
		val.Emit(OpCodes.Ldarg_1);
		val.EmitDelegate<Action<SetStateOnHurt, DamageReport>>((Action<SetStateOnHurt, DamageReport>)delegate(SetStateOnHurt ssoh, DamageReport dr)
		{
			ShockHelper shockHelper = ((Component)ssoh.targetStateMachine).gameObject.GetComponent<ShockHelper>();
			if (!Object.op_Implicit((Object)(object)shockHelper))
			{
				shockHelper = ((Component)ssoh.targetStateMachine).gameObject.AddComponent<ShockHelper>();
			}
			shockHelper.currentAttacker = dr.attacker;
		});
	}

	private void On_ShockStateOnEnter(orig_OnEnter orig, ShockState self)
	{
		orig.Invoke(self);
		if (doThresholdTweak)
		{
			ShockState.healthFractionToForceExit = 100f;
		}
	}

	private void On_ShockStateFixedUpdate(orig_FixedUpdate orig, ShockState self)
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Invalid comparison between Unknown and I4
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Invalid comparison between Unknown and I4
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Invalid comparison between Unknown and I4
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Invalid comparison between Unknown and I4
		//IL_00f2: 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_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: 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_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self);
		if (!NetworkServer.active || !(((T2Module)this).rng.nextNormalizedFloat < shockChance))
		{
			return;
		}
		TeamComponent teamComponent = ((EntityState)self).outer.commonComponents.teamComponent;
		List<TeamComponent> list = new List<TeamComponent>();
		bool flag = (int)FriendlyFireManager.friendlyFireMode > 0;
		if (flag || (int)teamComponent.teamIndex == 2)
		{
			list.AddRange(TeamComponent.GetTeamMembers((TeamIndex)2));
		}
		if (flag || (int)teamComponent.teamIndex == 0)
		{
			list.AddRange(TeamComponent.GetTeamMembers((TeamIndex)0));
		}
		if (flag || (int)teamComponent.teamIndex == 1)
		{
			list.AddRange(TeamComponent.GetTeamMembers((TeamIndex)1));
		}
		float sqrad = shockRadius * shockRadius;
		Vector3 tpos = ((EntityState)self).outer.commonComponents.characterBody.transform.position;
		list.Remove(teamComponent);
		list.RemoveAll(delegate(TeamComponent x)
		{
			//IL_0006: 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)
			Vector3 val2 = ((Component)x).transform.position - tpos;
			return ((Vector3)(ref val2)).sqrMagnitude > sqrad || !Object.op_Implicit((Object)(object)x.body) || !Object.op_Implicit((Object)(object)x.body.mainHurtBox) || !((Behaviour)x.body).isActiveAndEnabled;
		});
		if (list.Count != 0)
		{
			TeamComponent val = ((T2Module)this).rng.NextElementUniform<TeamComponent>(list);
			GameObject attacker = null;
			ShockHelper component = ((EntityState)self).GetComponent<ShockHelper>();
			if (Object.op_Implicit((Object)(object)component))
			{
				attacker = component.currentAttacker;
			}
			OrbManager.instance.AddOrb((Orb)(object)new ShockedOrb
			{
				attacker = attacker,
				bouncesRemaining = 0,
				damageColorIndex = (DamageColorIndex)0,
				damageType = DamageTypeCombo.op_Implicit((DamageType)131072),
				damageValue = ((EntityState)self).outer.commonComponents.characterBody.maxHealth * shockDamageFrac,
				isCrit = false,
				lightningType = (LightningType)1,
				origin = tpos,
				procChainMask = default(ProcChainMask),
				procCoefficient = shockProcCoef,
				target = val.body.mainHurtBox,
				teamIndex = (TeamIndex)(-1),
				shockVictim = ((EntityState)self).gameObject
			});
		}
	}
}
public class ShockHelper : MonoBehaviour
{
	public GameObject currentAttacker;

	public int shockKills = 0;
}
public class ShotgunAutofire : T2Module<ShotgunAutofire>
{
	[AutoConfigRoOSlider("{0:N2} s", 0f, 10f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float fireDelayDynamic { get; private set; } = 0.2f;


	[AutoConfigRoOSlider("{0:N2} s", 0f, 10f, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public float fireDelayFixed { get; private set; } = 0f;


	public override bool managedEnable => true;

	public override string enabledConfigDescription => "Causes Vulcan Shotgun to autofire. Client-side.";

	public override AutoConfigFlags enabledConfigFlags => (AutoConfigFlags)0;

	public override void Install()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((T2Module)this).Install();
		ChargeCaptainShotgun.FixedUpdate += new hook_FixedUpdate(On_CapChargeShotgunFixedUpdate);
	}

	public override void Uninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((T2Module)this).Uninstall();
		ChargeCaptainShotgun.FixedUpdate -= new hook_FixedUpdate(On_CapChargeShotgunFixedUpdate);
	}

	private void On_CapChargeShotgunFixedUpdate(orig_FixedUpdate orig, ChargeCaptainShotgun self)
	{
		if (Util.HasEffectiveAuthority(((EntityState)self).outer.networkIdentity) && ((EntityState)self).fixedAge / self.chargeDuration > fireDelayDynamic + 1f && ((EntityState)self).fixedAge - self.chargeDuration > fireDelayFixed)
		{
			self.released = true;
		}
		orig.Invoke(self);
	}
}
public class ShotgunRebalance : T2Module<ShotgunRebalance>
{
	[AutoConfigRoOIntSlider("{0:N0}", 1, 30, null, null)]
	[AutoConfig(/*Could not decode attribute arguments.*/)]
	public int pelletCount { get; private set; } = 6;


	public override bool managedEnable => true;

	public override string enabledConfigDescription => "Reduces Vulcan Shotgun pellet count.";

	public override AutoConfigUpdateActionTypes enabledConfigUpdateActionTypes => (AutoConfigUpdateActionTypes)1;

	public override void InstallLanguage()
	{
		((T2Module)this).genericLanguageTokens["CAPTAIN_PRIMARY_DESCRIPTION"] = "Fire a blast of pellets that deal <style=cIsDamage>6x120% damage</style> with no falloff. Charging the attack narrows the <style=cIsUtility>spread</style>.";
		((T2Module)this).InstallLanguage();
	}

	public override void Install()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		((T2Module)this).Install();
		FireCaptainShotgun.ModifyBullet += new hook_ModifyBullet(On_FCSModifyBullet);
		FireCaptainShotgun.ctor += new hook_ctor(On_FireCaptainShotgunCtor);
	}

	public override void Uninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		((T2Module)this).Uninstall();
		FireCaptainShotgun.ModifyBullet -= new hook_ModifyBullet(On_FCSModifyBullet);
		FireCaptainShotgun.ctor -= new hook_ctor(On_FireCaptainShotgunCtor);
	}

	private void On_FCSModifyBullet(orig_ModifyBullet orig, FireCaptainShotgun self, BulletAttack bulletAttack)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self, bulletAttack);
		bulletAttack.falloffModel = (FalloffModel)0;
	}

	private void On_FireCaptainShotgunCtor(orig_ctor orig, FireCaptainShotgun self)
	{
		orig.Invoke(self);
		((GenericBulletBaseState)self).bulletCount = pelletCount;
	}
}
public class EntStateChargeSKGun : ChargeCaptainShotgun
{
	public override void OnEnter()
	{
		((ChargeCaptainShotgun)this).OnEnter();
		base.chargeDuration = Mathf.Max(base.chargeDuration, T2Module<SKGunSkill>.instance.minChargeTime);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime;
		((EntityState)this).characterBody.SetAimTimer(1f);
		((EntityState)this).characterBody.isSprinting = false;
		if (((EntityState)this).fixedAge >= base.chargeDuration)
		{
			if (Object.op_Implicit((Object)(object)base.chargeupVfxGameObject))
			{
				EntityState.Destroy((Object)(object)base.chargeupVfxGameObject);
				base.chargeupVfxGameObject = null;
			}
			if (!Object.op_Implicit((Object)(object)base.holdChargeVfxGameObject) && Object.op_Implicit((Object)(object)base.muzzleTransform))
			{
				base.holdChargeVfxGameObject = Object.Instantiate<GameObject>(ChargeCaptainShotgun.holdCharg