Decompiled source of BetterArsonist v1.0.1

BetterArsonist.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using ArsonistMod;
using ArsonistMod.Content.Controllers;
using ArsonistMod.Modules;
using ArsonistMod.Modules.Characters;
using ArsonistMod.Modules.Networking;
using ArsonistMod.Modules.Survivors;
using ArsonistMod.SkillStates;
using ArsonistMod.SkillStates.Arsonist.Secondary;
using ArsonistMod.SkillStates.ZeroPointBlast;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using BetterArsonist.Changes;
using BetterArsonist.Modules;
using EntityStates;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using RoR2;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BetterArsonist
{
	[BepInPlugin("com.Bloonjitsu7.BetterArsonist", "BetterArsonist", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "Bloonjitsu7.BetterArsonist";

		public const string PluginAuthor = "Bloonjitsu7";

		public const string PluginName = "BetterArsonist";

		public const string PluginVersion = "1.0.0";

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			new ContentPacks().Initialize();
			SurvivorChanges survivorChanges = new SurvivorChanges();
			survivorChanges.Initialize();
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace BetterArsonist.Modules
{
	public static class DamageTypes
	{
		public static ModdedDamageType arsonistLifesteal = DamageAPI.ReserveDamageType();
	}
	public static class States
	{
		internal static List<Type> entityStates = new List<Type>();

		internal static void RegisterStates()
		{
			entityStates.Add(typeof(MasochismFire));
		}
	}
	public static class Projectiles
	{
		internal static GameObject masoFireBall;

		public static GameObject baseFireBall = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_LemurianBruiser.LemurianBigFireball_prefab).WaitForCompletion();

		internal static List<GameObject> projectilePrefabs = new List<GameObject>();

		internal static bool HasArsonistMod => Chainloader.PluginInfos.ContainsKey("com.PopcornFactory.Arsonist");

		internal static void RegisterProjectiles()
		{
			if (HasArsonistMod)
			{
				CreateMasochismFireBall();
				projectilePrefabs.Add(masoFireBall);
			}
			else
			{
				Log.Warning("Arsonist Not Found!");
			}
		}

		private static void CreateMasochismFireBall()
		{
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			masoFireBall = PrefabAPI.InstantiateClone(baseFireBall, "masoFireBall", true);
			Rigidbody val = masoFireBall.GetComponent<Rigidbody>();
			if (!Object.op_Implicit((Object)(object)val))
			{
				val = masoFireBall.AddComponent<Rigidbody>();
			}
			Object.DestroyImmediate((Object)(object)masoFireBall.GetComponent<ProjectileImpactExplosion>());
			ProjectileImpactExplosion val2 = masoFireBall.AddComponent<ProjectileImpactExplosion>();
			InitializeImpactExplosion(val2);
			((ProjectileExplosion)val2).blastRadius = 5f;
			((ProjectileExplosion)val2).blastProcCoefficient = 0.8f;
			val2.destroyOnEnemy = true;
			val2.destroyOnWorld = true;
			val2.lifetime = 4f;
			val2.impactEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_LemurianBruiser.OmniExplosionVFXLemurianBruiserFireballImpact_prefab).WaitForCompletion();
			((ProjectileExplosion)val2).falloffModel = (FalloffModel)3;
			((ProjectileExplosion)val2).blastDamageCoefficient = 1f;
			val2.timerAfterImpact = false;
			val2.lifetimeAfterImpact = 0f;
			((Component)val2).GetComponent<ProjectileDamage>().damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)1);
			ProjectileController component = masoFireBall.GetComponent<ProjectileController>();
			component.rigidbody = val;
			component.rigidbody.useGravity = false;
			component.rigidbody.mass = 1f;
			component.procCoefficient = 0.8f;
			component.ghostPrefab = AssetsArsonist.fireballWeakGhost;
			component.startSound = "";
		}

		private static void InitializeImpactExplosion(ProjectileImpactExplosion projectileImpactExplosion)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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)
			((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = 1f;
			((ProjectileExplosion)projectileImpactExplosion).blastProcCoefficient = 1f;
			((ProjectileExplosion)projectileImpactExplosion).blastRadius = 1f;
			((ProjectileExplosion)projectileImpactExplosion).bonusBlastForce = Vector3.zero;
			((ProjectileExplosion)projectileImpactExplosion).childrenCount = 0;
			((ProjectileExplosion)projectileImpactExplosion).childrenDamageCoefficient = 0f;
			((ProjectileExplosion)projectileImpactExplosion).childrenProjectilePrefab = null;
			projectileImpactExplosion.destroyOnEnemy = true;
			projectileImpactExplosion.destroyOnWorld = true;
			projectileImpactExplosion.detonateOnEnemy = true;
			projectileImpactExplosion.impactOnWorld = true;
			((ProjectileExplosion)projectileImpactExplosion).falloffModel = (FalloffModel)0;
			((ProjectileExplosion)projectileImpactExplosion).fireChildren = false;
			projectileImpactExplosion.lifetime = 0f;
			projectileImpactExplosion.lifetimeAfterImpact = 0f;
			projectileImpactExplosion.lifetimeRandomOffset = 0f;
			projectileImpactExplosion.offsetForLifetimeExpiredSound = 0f;
			projectileImpactExplosion.timerAfterImpact = false;
			((Component)projectileImpactExplosion).GetComponent<ProjectileDamage>().damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)1);
		}
	}
	public static class Buffs
	{
		internal static List<BuffDef> buffDefs = new List<BuffDef>();

		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown, bool isHidden)
		{
			//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)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = buffName;
			val.buffColor = buffColor;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.eliteDef = null;
			val.iconSprite = buffIcon;
			val.isCooldown = isCooldown;
			val.isHidden = isHidden;
			buffDefs.Add(val);
			return val;
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public string identifier => "com.Bloonjitsu7.BloonModpackBaseMod";

		public void Initialize()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			States.RegisterStates();
			Projectiles.RegisterProjectiles();
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)this);
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.buffDefs.Add(Buffs.buffDefs.ToArray());
			contentPack.entityStateTypes.Add(States.entityStates.ToArray());
			contentPack.projectilePrefabs.Add(Projectiles.projectilePrefabs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
}
namespace BetterArsonist.Changes
{
	public class SurvivorChanges : BaseState
	{
		private Hook fireSprayHook;

		private Hook flamethrowerHook;

		private Hook zeroPointHook;

		private ILHook zeroPointHookIL;

		private Hook flareSalvoHook;

		private Hook flareUpdateHook;

		private Hook flareUpdateHook2;

		private Hook flareEnterHook;

		private Hook masochismConHook;

		private Hook masochismConHook2;

		private Hook spiteConHook;

		private Hook spiteStartHook;

		private Hook addHeatHook;

		private Hook energyHook;

		private Hook arsonistHook;

		private static GameObject fireExplosionPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion();

		public static GameObject lemfireBall = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Lemurian/Fireball.prefab").WaitForCompletion();

		public static float zeroPointJump = 0f;

		public static float zeroPointLongJump = 0f;

		public void Initialize()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Expected O, but got Unknown
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Expected O, but got Unknown
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Expected O, but got Unknown
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Expected O, but got Unknown
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Expected O, but got Unknown
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Expected O, but got Unknown
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Expected O, but got Unknown
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Expected O, but got Unknown
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Expected O, but got Unknown
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Expected O, but got Unknown
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Expected O, but got Unknown
			UpdateText();
			SetupArsonist();
			MethodInfo methodInfo = AccessTools.Method(typeof(FireSpray), "FireBall", (Type[])null, (Type[])null);
			fireSprayHook = new Hook((MethodBase)methodInfo, (Delegate)new Action<Action<FireSpray>, FireSpray>(OnFireBall));
			MethodInfo methodInfo2 = AccessTools.Method(typeof(Flamethrower), "FixedUpdate", (Type[])null, (Type[])null);
			flamethrowerHook = new Hook((MethodBase)methodInfo2, (Delegate)new Action<Action<Flamethrower>, Flamethrower>(OnFlamethrowerUpdate));
			MethodInfo methodInfo3 = AccessTools.Method(typeof(ZeroPointBlastStart), "OnEnter", (Type[])null, (Type[])null);
			zeroPointHook = new Hook((MethodBase)methodInfo3, (Delegate)new Action<Action<ZeroPointBlastStart>, ZeroPointBlastStart>(OnZeroPointEnter));
			MethodInfo methodInfo4 = AccessTools.Method(typeof(ZeroPointBlastStart), "OnEnter", (Type[])null, (Type[])null);
			zeroPointHookIL = new ILHook((MethodBase)methodInfo4, new Manipulator(IL_ZeroPointEnter));
			MethodInfo methodInfo5 = AccessTools.Method(typeof(Flare), "OnEnter", (Type[])null, (Type[])null);
			flareEnterHook = new Hook((MethodBase)methodInfo5, (Delegate)new Action<Action<Flare>, Flare>(OnFlareEnter));
			MethodInfo methodInfo6 = AccessTools.Method(typeof(FlareEffectControllerStrong), "FireSalvos", (Type[])null, (Type[])null);
			flareSalvoHook = new Hook((MethodBase)methodInfo6, (Delegate)new Action<Action<FlareEffectControllerStrong>, FlareEffectControllerStrong>(OnFlareSalvo));
			MethodInfo methodInfo7 = AccessTools.Method(typeof(FlareEffectControllerStrong), "FixedUpdate", (Type[])null, (Type[])null);
			flareUpdateHook = new Hook((MethodBase)methodInfo7, (Delegate)new Action<Action<FlareEffectControllerStrong>, FlareEffectControllerStrong>(OnFlareUpdateStrong));
			MethodInfo methodInfo8 = AccessTools.Method(typeof(FlareEffectControllerStrongChild), "FixedUpdate", (Type[])null, (Type[])null);
			flareUpdateHook2 = new Hook((MethodBase)methodInfo8, (Delegate)new Action<Action<FlareEffectControllerStrongChild>, FlareEffectControllerStrongChild>(OnFlareUpdateChild));
			MethodInfo methodInfo9 = AccessTools.Method(typeof(MasochismController), "Start", (Type[])null, (Type[])null);
			masochismConHook = new Hook((MethodBase)methodInfo9, (Delegate)new Action<Action<MasochismController>, MasochismController>(OnMasochismControllerStart));
			MethodInfo methodInfo10 = AccessTools.Method(typeof(MasochismController), "DetermineMasoActivateable", (Type[])null, (Type[])null);
			masochismConHook2 = new Hook((MethodBase)methodInfo10, (Delegate)new Action<Action<MasochismController>, MasochismController>(OnMasoActivatable));
			MethodInfo methodInfo11 = AccessTools.Method(typeof(SpiteController), "ActivateMaso", (Type[])null, (Type[])null);
			spiteConHook = new Hook((MethodBase)methodInfo11, (Delegate)new Action<Action<SpiteController>, SpiteController>(OnSpiteActivated));
			MethodInfo methodInfo12 = AccessTools.Method(typeof(SpiteController), "Start", (Type[])null, (Type[])null);
			spiteStartHook = new Hook((MethodBase)methodInfo12, (Delegate)new Action<Action<SpiteController>, SpiteController>(OnSpiteStart));
			MethodInfo methodInfo13 = AccessTools.Method(typeof(EnergySystem), "AddHeat", new Type[2]
			{
				typeof(float),
				typeof(bool)
			}, (Type[])null);
			addHeatHook = new Hook((MethodBase)methodInfo13, (Delegate)new Action<Action<EnergySystem, float, bool>, EnergySystem, float, bool>(OnAddHeat));
			MethodInfo methodInfo14 = AccessTools.Method(typeof(EnergySystem), "CalculateEnergyStats", (Type[])null, (Type[])null);
			energyHook = new Hook((MethodBase)methodInfo14, (Delegate)new Action<Action<EnergySystem>, EnergySystem>(OnCalculateEnergy));
			HealthComponent.TakeDamage += new hook_TakeDamage(OnTakeDamageMasochism);
			DotController.InflictDot_refInflictDotInfo += new hook_InflictDot_refInflictDotInfo(OnInflictDot);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(OnArsonistStats);
		}

		public void SetupArsonist()
		{
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			StaticValues.overheatAttackSpeedDebuff = 1f;
			StaticValues.flamethrowerWeakDamageCoefficient = 0.75f;
			StaticValues.flamethrowerStrongDamageCoefficient = 0.75f;
			StaticValues.altFlamethrowerWeakDamageCoefficient = 0.9f;
			StaticValues.altFlamethrowerStrongDamageCoefficient = 0.9f;
			StaticValues.flamethrowerBaseTickRate = 3;
			StaticValues.flamethrowerEnergyCost = 20f;
			StaticValues.zeropointpounchDamageCoefficient = 3.5f;
			StaticValues.flareSalvoRadius = 15f;
			StaticValues.flareStrongDamageCoefficient = 3f;
			StaticValues.flareStrongChildDamageCoefficient = 3f;
			Config.masochismSurgeHealOnHitPercentage.Value = 0f;
			StaticValues.masochismSurgeMoveSpeedMultiplier = 1f;
			StaticValues.masochismBasePulseSelfDamageTimer = 9999f;
			StaticValues.masochismSurgeSelfDamage = 0f;
			StaticValues.masochismEnergyIncreaseOverTimePercentage = 0.05f;
			StaticValues.masochismSurgeMultiplierPerStack = 1f;
			StaticValues.masochismSurgeFinalBlastCoefficient = 3f;
			StaticValues.cleanseDamageCoefficient = 1.5f;
			StaticValues.SegmentedValuesOnGaugeAlt = new Vector3(0.625f, 0.275f, 0.1f);
			StaticValues.levelEnergy = 0f;
			StaticValues.backupEnergyGain = 0f;
			StaticValues.lysateEnergyGain = 0f;
			StaticValues.hardlightEnergyGain = 0f;
			StaticValues.levelBlueEnergy = 0f;
			StaticValues.backupBlueGain = 0f;
			StaticValues.lysateBlueGain = 0f;
			StaticValues.hardlightBlueGain = 0f;
			Config.masochismMinimumRequiredToActivate.Value = 1;
			Arsonist.neoMasochismSkillDef.activationState = new SerializableEntityStateType(typeof(MasochismFire));
		}

		private void UpdateText()
		{
			string text = "<style=cKeywordName>Heat Gauge</style> <style=cSub>Your skills can build up or vent <color=#ff5e00>Heat</color>. <color=#ff5e00>Heat</color> automatically cools over time, scaling with <style=cIsDamage>attack speed</style>. If <color=#ff5e00>Heat</color> builds up past <color=#ff5e00>100</color>, you <style=cIsHealth>Overheat</style>.";
			LanguageAPI.Add("KEYWORD_MODDED_GAUGE", text);
			string text2 = "<style=cKeywordName>Heat</style> <style=cSub>Builds up <color=#ff5e00>Heat</color> when used. If used in <style=cIsHealth>Overheat</style>, you <style=cIsHealth>take damage</style> instead.";
			LanguageAPI.Add("KEYWORD_MODDED_HEAT", text2);
			string text3 = "<style=cKeywordName>Overheat</style> <style=cSub>While in <style=cIsHealth>Overheat</style>, you <style=cIsUtility>move 25% faster</style> and some skills have <style=cIsHealth>longer cooldowns</style>. All skills that build up additional <color=#ff5e00>Heat</color> cause you to <style=cIsHealth>take damage</style> proporational to the <color=#ff5e00>Heat</color>.";
			LanguageAPI.Add("KEYWORD_MODDED_OVERHEAT", text3);
			string text4 = "<style=cKeywordName>Anticipation</style> <style=cSub>For every <color=#ff5e00>100 Heat</color> lost and/or gained, recieve 1 stack of <color=#ff5e00>Anticipation</color>, up to maximum of 10. Your special skills require <color=#ff5e00>Anticipation</color> to use.";
			LanguageAPI.Add("KEYWORD_MODDED_ANTICIPATION", text4);
			string text5 = "<color=#ff5e00>Heat Gauge.</color> Your skills deal standard damage in all portions of the gauge.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_PASSIVE_NORMAL_GAUGE_DESCRIPTION", text5);
			string text6 = "<color=#ff5e00>Heat Gauge.</color> Your skills deal <style=cIsDamage>0.7x</style> damage while in the <color=#ffffff>white portion</color> of the gauge, and <style=cIsDamage>2.5x</style> damage in the <color=#006eff>blue portion</color>.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_PASSIVE_BLUE_GAUGE_DESCRIPTION", text6);
			ArsonistPassive component = CharacterBase.instance.bodyPrefab.GetComponent<ArsonistPassive>();
			component.normalGaugePassive.skillDescriptionToken = "MODDED_ARSONIST_BODY_PASSIVE_NORMAL_GAUGE_DESCRIPTION";
			component.normalGaugePassive.keywordTokens = new string[2] { "KEYWORD_MODDED_GAUGE", "KEYWORD_MODDED_OVERHEAT" };
			component.blueGaugePassive.skillDescriptionToken = "MODDED_ARSONIST_BODY_PASSIVE_BLUE_GAUGE_DESCRIPTION";
			component.blueGaugePassive.keywordTokens = new string[2] { "KEYWORD_MODDED_GAUGE", "KEYWORD_MODDED_OVERHEAT" };
			string text7 = "<color=#ff5e00>Heat.</color> <style=cIsDamage>Ignite.</style> Fire a ball of fire that deals <style=cIsDamage>225% damage</style> in an area on impact.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_PRIMARY_FIREBALL_DESCRIPTION", text7);
			Arsonist.primarySkillDef.skillDescriptionToken = "MODDED_ARSONIST_BODY_PRIMARY_FIREBALL_DESCRIPTION";
			Arsonist.primarySkillDef.keywordTokens = new string[2] { "KEYWORD_MODDED_HEAT", "KEYWORD_IGNITE" };
			string text8 = "<color=#ff5e00>Heat.</color> <style=cIsDamage>Ignite.</style> Fire a beam of fire that deals <style=cIsDamage>450% damage</style> per second. Has increased <style=cIsDamage>ignite</style> chance the closer you are to the target.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_PRIMARY_FLAMETHROWER_DESCRIPTION", text8);
			Arsonist.flamethrowerSkillDef.skillDescriptionToken = "MODDED_ARSONIST_BODY_PRIMARY_FLAMETHROWER_DESCRIPTION";
			Arsonist.flamethrowerSkillDef.keywordTokens = new string[2] { "KEYWORD_MODDED_HEAT", "KEYWORD_IGNITE" };
			string text9 = "Vents <style=cIsUtility>30%</style> of your <color=#ff5e00>Current Heat</color>. Fire a flare that can stick to enemies, dealing <style=cIsDamage>500% damage</style> over <style=cIsUtility>5s</style> before exploding into <style=cIsDamage>5 additional flares</style>. Deals <style=cIsDamage>20% more damage</style> per stack of <style=cIsDamage>ignite</style> on the enemy if not in <style=cIsHealth>Overheat</style>.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_SECONDARY_FLARE_DESCRIPTION", text9);
			Arsonist.flareSkillDef.skillDescriptionToken = "MODDED_ARSONIST_BODY_SECONDARY_FLARE_DESCRIPTION";
			Arsonist.flareSkillDef.keywordTokens = new string[1] { "KEYWORD_MODDED_OVERHEAT" };
			string text10 = "<style=cIsUtility>Agile.</style> Vents <style=cIsUtility>50%</style> of your <color=#ff5e00>Current Heat</color> to launch yourself forwards, blasting enemies for <style=cIsDamage>350% damage</style>. Launch distance increases with the amount of <color=#ff5e00>Heat</color> vented, and it deals no damage in <style=cIsHealth>Overheat</style>.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_SECONDARY_PUNCH_DESCRIPTION", text10);
			Arsonist.punchSkillDef.skillDescriptionToken = "MODDED_ARSONIST_BODY_SECONDARY_PUNCH_DESCRIPTION";
			Arsonist.punchSkillDef.keywordTokens = new string[2] { "KEYWORD_AGILE", "KEYWORD_MODDED_OVERHEAT" };
			string text11 = "<style=cIsUtility>Agile.</style> Vents <style=cIsUtility>50%</style> <color=#ff5e00>TOTAL Heat</color>. While not in <style=cIsHealth>Overheat</style>, briefly increases your <style=cIsUtility>movement speed</style> and <style=cIsHealing>health regeneration</style>, and ignites nearby foes for <style=cIsDamage>150% damage</style>. Accelerates cooling in <style=cIsHealth>Overheat</style>, at the cost of a much longer recharge time.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_UTILITY_CLEANSE_DESCRIPTION", text11);
			Arsonist.cleanseSkillDef.skillDescriptionToken = "MODDED_ARSONIST_BODY_UTILITY_CLEANSE_DESCRIPTION";
			Arsonist.cleanseSkillDef.keywordTokens = new string[2] { "KEYWORD_AGILE", "KEYWORD_MODDED_OVERHEAT" };
			string text12 = "<style=cIsDamage>Ignite.</style> Cannot be used in <style=cIsHealth>Overheat</style>. Consumes all <color=#ff5e00>Anticipation</color> to launch a spread of <style=cIsDamage>5 fireballs</style> with <style=cIsHealing>20% lifesteal</style>, each dealing <style=cIsDamage>60% damage</style> per <color=#ff5e00>Anticipation</color> stack. <style=cIsHealth>Overheat</style> immediately after.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_SPECIAL_MASOCHISM_DESCRIPTION", text12);
			Arsonist.neoMasochismSkillDef.skillDescriptionToken = "MODDED_ARSONIST_BODY_SPECIAL_MASOCHISM_DESCRIPTION";
			Arsonist.neoMasochismSkillDef.keywordTokens = new string[3] { "KEYWORD_MODDED_ANTICIPATION", "KEYWORD_IGNITE", "KEYWORD_MODDED_OVERHEAT" };
			string text13 = "Resets your <color=#ff5e00>Heat Gauge</color>. For <style=cIsUtility>1s</style> per <color=#ff5e00>Anticipation</color> stack, gain <style=cIsUtility>Double Tap</style> and convert <style=cIsDamage>100%</style> of incoming damage into fire damage over time. Once this effect ends, <style=cIsHealth>Overheat</style> and <style=cIsDamage>detonate</style> in an area around you for <style=cIsDamage>300% damage</style> per <color=#ff5e00>Anticipation</color> stack used.";
			LanguageAPI.Add("MODDED_ARSONIST_BODY_SPECIAL_SPITE_DESCRIPTION", text13);
			Arsonist.masochismSurgeSkillDef.skillDescriptionToken = "MODDED_ARSONIST_BODY_SPECIAL_SPITE_DESCRIPTION";
			Arsonist.masochismSurgeSkillDef.keywordTokens = new string[3] { "KEYWORD_MODDED_ANTICIPATION", "POPCORN_ARSONIST_BODY_KEYWORD_MASO_DOUBLE_TAP", "KEYWORD_MODDED_OVERHEAT" };
		}

		public void OnArsonistHook(Action<ArsonistPlugin> orig, ArsonistPlugin self)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			orig(self);
			DotController.InflictDot_refInflictDotInfo -= new hook_InflictDot_refInflictDotInfo(self.DotController_InflictDot_refInflictDotInfo);
		}

		private void OnTakeDamageMasochism(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Invalid comparison between Unknown and I4
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Invalid comparison between Unknown and I4
			//IL_0071: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: 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)
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body))
			{
				if ((Object)(object)damageInfo.attacker != (Object)null)
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					if ((Object)(object)component != (Object)null && DamageAPI.HasModdedDamageType(damageInfo, DamageTypes.arsonistLifesteal))
					{
						component.healthComponent.Heal(damageInfo.damage * 0.2f, default(ProcChainMask), true);
					}
				}
				bool flag = false;
				_ = damageInfo.dotIndex;
				if (true)
				{
					flag = (int)damageInfo.dotIndex == 1 || (int)damageInfo.dotIndex == 2 || (int)damageInfo.dotIndex == 7;
				}
				BuffDef masochismSurgeActiveBuff = Buffs.masochismSurgeActiveBuff;
				if (self.body.HasBuff(Buffs.masochismSurgeActiveBuff) && !flag)
				{
					float damage = damageInfo.damage;
					InflictDotInfo val = default(InflictDotInfo);
					val.totalDamage = damage;
					val.damageMultiplier = 1f;
					val.attackerObject = ((Component)self.body).gameObject;
					val.victimObject = ((Component)self.body).gameObject;
					val.duration = 5f;
					val.dotIndex = (DotIndex)1;
					InflictDotInfo val2 = val;
					DotController.InflictDot(ref val2);
					damageInfo.damage = 0f;
				}
			}
			orig.Invoke(self, damageInfo);
		}

		private void OnInflictDot(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Invalid comparison between Unknown and I4
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Invalid comparison between Unknown and I4
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Invalid comparison between Unknown and I4
			if ((Object)(object)inflictDotInfo.victimObject != (Object)null && (Object)(object)inflictDotInfo.attackerObject != (Object)null && (Object)(object)inflictDotInfo.victimObject == (Object)(object)inflictDotInfo.attackerObject)
			{
				CharacterBody component = inflictDotInfo.victimObject.GetComponent<CharacterBody>();
				if ((Object)(object)component != (Object)null && component.baseNameToken == "POPCORN_ARSONIST_BODY_NAME" && ((int)inflictDotInfo.dotIndex == 1 || (int)inflictDotInfo.dotIndex == 2 || (int)inflictDotInfo.dotIndex == 7) && inflictDotInfo.damageMultiplier == 0f)
				{
					Log.Message("Success!");
					inflictDotInfo.damageMultiplier = 1f;
				}
			}
			orig.Invoke(ref inflictDotInfo);
		}

		public void OnCalculateEnergy(Action<EnergySystem> orig, EnergySystem self)
		{
			orig(self);
			self.costmultiplierOverheat = 1f;
			self.costflatOverheat = 0f;
		}

		private void OnArsonistStats(CharacterBody sender, StatHookEventArgs args)
		{
			EnergySystem component = ((Component)sender).GetComponent<EnergySystem>();
			if ((Object)(object)component != (Object)null && component.currentOverheat >= component.maxOverheat)
			{
				args.moveSpeedMultAdd += 0.25f;
			}
			BuffDef cleanseSpeedBoost = Buffs.cleanseSpeedBoost;
			if (sender.HasBuff(cleanseSpeedBoost))
			{
				args.baseRegenAdd += 5f;
				args.levelRegenAdd += 1f;
			}
		}

		public void OnAddHeat(Action<EnergySystem, float, bool> orig, EnergySystem self, float Energy, bool isNatural)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_0064: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			if (Energy > 0f && self.currentOverheat >= self.maxOverheat && (Object)(object)self.characterBody.healthComponent != (Object)null)
			{
				DamageInfo val = new DamageInfo
				{
					attacker = null,
					crit = false,
					damage = self.characterBody.healthComponent.fullCombinedHealth * (Energy / 200f),
					damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)64), (DamageTypeExtended)262144, (DamageSource)0),
					damageColorIndex = (DamageColorIndex)3,
					inflictor = ((Component)self.characterBody).gameObject,
					position = ((Component)self.characterBody).gameObject.transform.position,
					procCoefficient = 0f
				};
				self.characterBody.healthComponent.TakeDamage(val);
				self.currentOverheat += Energy;
			}
			else
			{
				orig(self, Energy, isNatural);
			}
		}

		public void OnSpiteActivated(Action<SpiteController> orig, SpiteController self)
		{
			orig(self);
			self.masoStacks++;
		}

		public void OnSpiteStart(Action<SpiteController> orig, SpiteController self)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			orig(self);
			self.finalBlastAttack.attackerFiltering = (AttackerFiltering)2;
		}

		public void OnMasochismControllerStart(Action<MasochismController> orig, MasochismController self)
		{
			Config.masochismMinimumRequiredToActivate.Value = 1;
			orig(self);
		}

		public void OnMasoActivatable(Action<MasochismController> orig, MasochismController self)
		{
			if (self.energySystem.currentOverheat < self.energySystem.maxOverheat)
			{
				orig(self);
			}
			else
			{
				self.skillLoc.special.stock = 0;
			}
		}

		public void OnFlareSalvo(Action<FlareEffectControllerStrong> orig, FlareEffectControllerStrong self)
		{
			//IL_001d: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				int num = 5;
				Vector3 position = self.charbody.transform.position;
				float num2 = MathF.PI * 2f / (float)num;
				float num3 = 0f;
				Log.Message(self.charbody.radius);
				for (int i = 0; i < num; i++)
				{
					float num4 = StaticValues.flareSalvoRadius * Mathf.Cos(num3);
					float num5 = StaticValues.flareSalvoRadius * Mathf.Sin(num3);
					float flareSalvoRadius = StaticValues.flareSalvoRadius;
					Vector3 val = new Vector3(num4, flareSalvoRadius, num5);
					Vector3 normalized = ((Vector3)(ref val)).normalized;
					self.FireProjectileSalvo(normalized, new Vector3(position.x + num4 / 9f * self.charbody.radius, position.y, position.z + num5 / 9f * self.charbody.radius));
					num3 += num2;
				}
			}
		}

		public void OnFlareUpdateStrong(Action<FlareEffectControllerStrong> orig, FlareEffectControllerStrong self)
		{
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Expected O, but got Unknown
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Expected O, but got Unknown
			//IL_0107: 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_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)self.charbody))
			{
				if (NetworkServer.active)
				{
					if (self.timer > StaticValues.flareInterval)
					{
						if (self.timesFired < StaticValues.flareTickNum)
						{
							EnergySystem component = ((Component)self.arsonistBody).GetComponent<EnergySystem>();
							float num = self.arsonistBody.damage * StaticValues.flareStrongDamageCoefficient / (float)StaticValues.flareTickNum;
							if ((self.charbody.HasBuff(Buffs.OnFire) || self.charbody.HasBuff(Buffs.StrongerBurn)) && component.currentOverheat < component.maxOverheat)
							{
								num *= 1f + (float)(self.charbody.GetBuffCount(Buffs.OnFire) + self.charbody.GetBuffCount(Buffs.StrongerBurn)) * 0.2f;
							}
							self.timesFired++;
							self.timer = 0f;
							NetMessageExtensions.Send((INetMessage)new TakeDamageNetworkRequest(self.charbody.masterObjectId, self.arsonistBody.masterObjectId, num, true), (NetworkDestination)1);
							NetMessageExtensions.Send((INetMessage)new PlaySoundNetworkRequest(((NetworkBehaviour)self.charbody).netId, 3747272580u), (NetworkDestination)1);
						}
						else
						{
							self.hasFired = true;
							self.FireExplosion();
							EffectManager.SpawnEffect(AssetsArsonist.elderlemurianexplosionEffect, new EffectData
							{
								origin = self.charbody.transform.position,
								scale = StaticValues.flareBlastRadius,
								rotation = new Quaternion(0f, 0f, 0f, 0f)
							}, true);
							Object.Destroy((Object)(object)self);
							Object.Destroy((Object)(object)self.effectObj);
						}
					}
					else
					{
						self.timer += Time.fixedDeltaTime;
					}
				}
				else if (self.timer > StaticValues.flareInterval * (float)StaticValues.flareTickNum)
				{
					self.timer += Time.fixedDeltaTime;
				}
				else
				{
					EffectManager.SpawnEffect(AssetsArsonist.elderlemurianexplosionEffect, new EffectData
					{
						origin = self.charbody.transform.position,
						scale = StaticValues.flareBlastRadius,
						rotation = new Quaternion(0f, 0f, 0f, 0f)
					}, true);
					Object.Destroy((Object)(object)self);
					Object.Destroy((Object)(object)self.effectObj);
				}
			}
			else
			{
				Object.Destroy((Object)(object)self.effectObj);
			}
		}

		public void OnFlareUpdateChild(Action<FlareEffectControllerStrongChild> orig, FlareEffectControllerStrongChild self)
		{
			//IL_01f1: 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)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Expected O, but got Unknown
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)self.charbody))
			{
				if (((NetworkBehaviour)self.arsonistBody).hasAuthority)
				{
					if (self.timer > StaticValues.flareInterval)
					{
						if (self.timesFired < StaticValues.flareTickNum)
						{
							EnergySystem component = ((Component)self.arsonistBody).GetComponent<EnergySystem>();
							float num = self.arsonistBody.damage * StaticValues.flareStrongDamageCoefficient / (float)StaticValues.flareTickNum;
							if ((self.charbody.HasBuff(Buffs.OnFire) || self.charbody.HasBuff(Buffs.StrongerBurn)) && component.currentOverheat < component.maxOverheat)
							{
								num *= 1f + (float)(self.charbody.GetBuffCount(Buffs.OnFire) + self.charbody.GetBuffCount(Buffs.StrongerBurn)) * 0.2f;
							}
							self.timesFired++;
							self.timer = 0f;
							NetMessageExtensions.Send((INetMessage)new TakeDamageNetworkRequest(self.charbody.masterObjectId, self.arsonistBody.masterObjectId, num, true), (NetworkDestination)1);
						}
						else
						{
							self.FireExplosion();
							EffectManager.SpawnEffect(AssetsArsonist.elderlemurianexplosionEffect, new EffectData
							{
								origin = self.charbody.transform.position,
								scale = StaticValues.flareBlastRadius,
								rotation = new Quaternion(0f, 0f, 0f, 0f)
							}, true);
							Object.Destroy((Object)(object)self);
							Object.Destroy((Object)(object)self.effectObj);
						}
					}
					else
					{
						self.timer += Time.fixedDeltaTime;
					}
				}
				else if (self.timer > StaticValues.flareInterval * (float)StaticValues.flareTickNum)
				{
					self.timer += Time.fixedDeltaTime;
				}
				else
				{
					EffectManager.SpawnEffect(AssetsArsonist.elderlemurianexplosionEffect, new EffectData
					{
						origin = self.charbody.transform.position,
						scale = StaticValues.flareBlastRadius,
						rotation = new Quaternion(0f, 0f, 0f, 0f)
					}, true);
					Object.Destroy((Object)(object)self);
					Object.Destroy((Object)(object)self.effectObj);
				}
			}
			else
			{
				Object.Destroy((Object)(object)self);
				Object.Destroy((Object)(object)self.effectObj);
			}
		}

		public void OnFlareEnter(Action<Flare> orig, Flare self)
		{
			orig(self);
			self.isStrong = true;
		}

		public void OnZeroPointEnter(Action<ZeroPointBlastStart> orig, ZeroPointBlastStart self)
		{
			self.energySystem = ((Component)((EntityState)self).characterBody).gameObject.GetComponent<EnergySystem>();
			bool flag = self.energySystem.currentOverheat < self.energySystem.maxOverheat && ((EntityState)self).isAuthority;
			if (flag)
			{
				zeroPointJump = 4f * (1f + self.energySystem.currentOverheat * StaticValues.zeropointHeatReductionMultiplier * 0.02f);
				ZeroPointBlastStart.initialSpeedCoefficient = 7f * (1f + self.energySystem.currentOverheat * StaticValues.zeropointHeatReductionMultiplier * 0.012f);
				ZeroPointBlastStart.finalSpeedCoefficient = 4f * (1f + self.energySystem.currentOverheat * StaticValues.zeropointHeatReductionMultiplier * 0.012f);
			}
			else
			{
				zeroPointJump = 8f;
				ZeroPointBlastStart.initialSpeedCoefficient = 11.2f;
				ZeroPointBlastStart.finalSpeedCoefficient = 6.4f;
			}
			zeroPointLongJump = zeroPointJump * 1.5f;
			orig(self);
			if (!flag)
			{
				self.blastAttack.baseDamage = 0f;
				self.damageCoefficient = 0f;
			}
		}

		public void IL_ZeroPointEnter(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			ILCursor val2 = val;
			MoveType val3 = (MoveType)0;
			if (val2.TryGotoNext(val3, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 6f)
			}))
			{
				val.Next.Operand = zeroPointLongJump;
				ILCursor val4 = val;
				if (val4.TryGotoNext(val3, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 4f)
				}))
				{
					val.Next.Operand = zeroPointJump;
				}
				else
				{
					Log.Error(((MemberReference)il.Method).Name + " Hook 2 failed!");
				}
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
		}

		public void OnFlamethrowerUpdate(Action<Flamethrower> orig, Flamethrower self)
		{
			self.interval = self.duration / 3f;
			self.energyCost = self.Energy * ((EntityState)self).characterBody.attackSpeed;
			orig(self);
		}

		public void OnFireBall(Action<FireSpray> orig, FireSpray self)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			self.energySystem.AddHeat(self.energyCost);
			Ray aimRay = ((BaseState)self).GetAimRay();
			float num = (self.isBlue ? self.altStrongDamageCoefficient : self.strongdamageCoefficient);
			Vector3 displacedOrigin = self.GetDisplacedOrigin(aimRay);
			if (((EntityState)self).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(Projectiles.artificerFirebolt, displacedOrigin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)self).gameObject, ((BaseState)self).damageStat * num, self.strongforce, Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, self.strongspeedOverride, (DamageTypeCombo?)new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)128), (DamageTypeExtended)0, (DamageSource)1));
			}
		}
	}
	public class MasochismFire : BaseSkillState
	{
		private Animator animator;

		public MasochismController maso;

		public ArsonistController arsonistCon;

		public float stopwatch;

		public static float baseActivationTime = 0.16f;

		public static float baseDuration = 0.75f;

		public float duration;

		public EnergySystem energySystem;

		public override void OnEnter()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			energySystem = ((Component)((EntityState)this).characterBody).gameObject.GetComponent<EnergySystem>();
			maso = ((Component)((EntityState)this).characterBody).gameObject.GetComponent<MasochismController>();
			((EntityState)this).characterBody.isSprinting = false;
			Ray aimRay = ((BaseState)this).GetAimRay();
			duration = 0.75f / ((EntityState)this).characterBody.attackSpeed;
			((EntityState)this).characterBody.SetAimTimer(duration);
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetBool("attacking", true);
			((EntityState)this).GetModelAnimator().SetFloat("Attack.playbackRate", ((BaseState)this).attackSpeedStat);
			((EntityState)this).PlayCrossfade("Gesture, Override", "FireSpray", "Attack.playbackRate", duration, 0.1f);
			ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator();
			Transform val = modelChildLocator.FindChild("GunMuzzle");
			Vector3 displacedOrigin = GetDisplacedOrigin(aimRay);
			float num = (float)maso.masoStacks * 0.6f;
			float num2 = 0f;
			float num3 = 0f;
			bool crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			if (((EntityState)this).isAuthority)
			{
				DamageTypeCombo value = default(DamageTypeCombo);
				for (int num4 = 5; num4 > 0; num4--)
				{
					switch (num4)
					{
					case 1:
						num2 = 0f;
						num3 = -3f;
						break;
					case 2:
						num2 = 3f;
						num3 = -0.75f;
						break;
					case 3:
						num2 = -3f;
						num3 = -0.75f;
						break;
					case 4:
						num2 = 1.75f;
						num3 = 2.5f;
						break;
					case 5:
						num2 = -1.75f;
						num3 = 2.5f;
						break;
					}
					Vector3 val2 = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num2, num3);
					FireProjectileInfo val3 = default(FireProjectileInfo);
					val3.projectilePrefab = Projectiles.masoFireBall;
					val3.position = displacedOrigin;
					val3.rotation = Util.QuaternionSafeLookRotation(val2);
					val3.owner = ((EntityState)this).gameObject;
					val3.damage = ((BaseState)this).damageStat * num;
					val3.force = 500f;
					val3.crit = crit;
					((FireProjectileInfo)(ref val3)).speedOverride = 80f;
					((DamageTypeCombo)(ref value))..ctor(DamageTypeCombo.op_Implicit((DamageType)128), (DamageTypeExtended)0, (DamageSource)8);
					DamageAPI.AddModdedDamageType(ref value, DamageTypes.arsonistLifesteal);
					val3.damageTypeOverride = value;
					ProjectileManager.instance.FireProjectile(val3);
				}
			}
			Util.PlaySound("Play_lunar_wisp_attack2_launch", ((EntityState)this).gameObject);
			float num5 = 3200f;
			if (((BaseState)this).isGrounded)
			{
				num5 *= 0.25f;
			}
			((EntityState)this).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * (0f - num5), false, false);
			energySystem.AddHeat(energySystem.maxOverheat * 2f);
		}

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

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

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

		public Vector3 GetDisplacedOrigin(Ray aimRay)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			float num = 2.5f;
			float num2 = 1.25f;
			Vector3 direction;
			Vector3 result;
			if (!CheckLookingDown(aimRay))
			{
				Vector3 origin = ((Ray)(ref aimRay)).origin;
				direction = ((Ray)(ref aimRay)).direction;
				result = origin + num2 * ((Vector3)(ref direction)).normalized;
			}
			else
			{
				Vector3 origin2 = ((Ray)(ref aimRay)).origin;
				direction = ((Ray)(ref aimRay)).direction;
				result = origin2 + num * ((Vector3)(ref direction)).normalized;
			}
			return result;
		}

		private bool CheckLookingDown(Ray aimRay)
		{
			//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)
			return Vector3.Dot(((Ray)(ref aimRay)).direction, Vector3.down) > 0.6f;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}