Decompiled source of GodzillasBreath v4.0.0

Mods/AtomicBreath.dll

Decompiled a week ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
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 AtomicBreathMod;
using BoneLib;
using BoneLib.BoneMenu;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Marrow;
using Il2CppSLZ.Marrow.Combat;
using Il2CppSLZ.Marrow.Data;
using Il2CppSLZ.Marrow.Interaction;
using Il2CppSLZ.Marrow.Warehouse;
using Il2CppSystem;
using LabFusion.Entities;
using LabFusion.Marrow.Extenders;
using LabFusion.Network;
using LabFusion.Network.Serialization;
using LabFusion.Player;
using LabFusion.SDK.Modules;
using MelonLoader;
using MelonLoader.Preferences;
using MelonLoader.Utils;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(AtomicBreathMain), "Atomic Breath", "4.0.0", "Ultimate Godzilla Avatar Pack", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AtomicBreathMod
{
	public class AtomicBreathMain : MelonMod
	{
		private enum BreathState
		{
			Idle,
			Charging,
			Firing,
			Tail,
			Cooldown
		}

		private enum Slot
		{
			Mouth,
			LeftHand,
			RightHand,
			Belly,
			Crotch,
			Butt,
			LeftEye,
			RightEye
		}

		private const float DamageTickSeconds = 0.1f;

		private const float DamageRadius = 1.2f;

		private const float DamageOverreach = 2f;

		private const float MouthDownOffset = 0.1f;

		private const float GooFlightSeconds = 0.55f;

		private const float GooSimStepSeconds = 0.04f;

		private const int GooSimSteps = 40;

		private const float GooMinSpeed = 1.5f;

		private const float HeadSafeDistance = 0.6f;

		private const float BeamTaperSeconds = 0.6f;

		private const float AuraFadeSeconds = 1.5f;

		private const float ChestDownOffset = 0.45f;

		private const float GroundSearchHeight = 3f;

		private const float GroundSearchDistance = 400f;

		private const float ProtectionPaddingSeconds = 1.5f;

		private const float ConvergeDistance = 60f;

		private const float HandForwardOffset = 0.12f;

		private const float BellyForwardOffset = 0.3f;

		private const float BellyDownOffset = 0.2f;

		private const float RemoteHitRadius = 0.8f;

		private const float RemoteHitWidthFactor = 0.55f;

		private const float LowerBodyDropOffset = 0.55f;

		private const float CrotchForwardOffset = 0.18f;

		private const float ButtBackOffset = 0.2f;

		private const float ShoulderSideOffset = 0.2f;

		private const float ShoulderUpOffset = 0.15f;

		private const float MinArmPointDistance = 0.2f;

		private const float MinDirectionSqrMagnitude = 0.01f;

		private const float ShinBlendSeconds = 0.35f;

		private const float ShinMinStageSeconds = 0.1f;

		private const float ShinSimpleBlendLimit = 0.5f;

		private const float ShinFireColorTolerance = 0.5f;

		private const float EyeForwardOffset = 0.12f;

		private const float EyeSideOffset = 0.035f;

		private const float EyeUpOffset = 0.02f;

		private const float MultiMouthWidth = 1f;

		private const float MultiHandWidth = 0.55f;

		private const float MultiBellyWidth = 0.8f;

		private const float SendIntervalSeconds = 0.05f;

		private const float RemoteTimeoutSeconds = 1f;

		private const float RemoteForgetSeconds = 10f;

		private const float RemoteExtendSeconds = 0.35f;

		private const float InterruptCooldownExtraSeconds = 1f;

		private const byte DummyId = 250;

		private const float DummySeconds = 40f;

		private const float DummyDistance = 14f;

		private const float DummyStopShort = 2f;

		private const float RecoilKickVelocity = 1.6f;

		private const float RecoilAcceleration = 5.5f;

		private const float RecoilVerticalFactor = 0.45f;

		private const float MinRecoilWidth = 0.25f;

		private static AtomicBreathMain instance;

		private readonly List<NukeEffect> nukes = new List<NukeEffect>();

		private readonly List<BeamActor> actors = new List<BeamActor>();

		private readonly Dictionary<byte, BeamActor> remotes = new Dictionary<byte, BeamActor>();

		private readonly List<byte> forgetList = new List<byte>();

		private readonly List<Slot> activeSlots = new List<Slot>();

		private BeamActor local;

		private BeamActor dummy;

		private float dummyEndTime;

		private BreathState state;

		private float stateTimer;

		private float damageTimer;

		private readonly BreathInput input = new BreathInput();

		private readonly BiteAttack bite = new BiteAttack();

		private float nukeTimer = -1f;

		private float sendTimer;

		private int lastSentPhase;

		private bool skipNuke;

		private bool wasEnabled = true;

		private Vector3 pendingNukePoint;

		private Vector3 smoothedDirection = Vector3.forward;

		private readonly Vector3[] followDirections = (Vector3[])(object)new Vector3[8];

		private float firingTotalSeconds = 4f;

		private float frameDelta = 0.016f;

		private bool damageAllowed = true;

		private bool tailMode;

		private float shinTailTime = -1f;

		private readonly List<ShinSequence> shins = new List<ShinSequence>();

		private const float ShinOriginForward = 6f;

		private const float TailRiseFactor = 0.3f;

		private const float TailWidthFactor = 0.6f;

		private float networkReadyTime;

		private const float NetworkGraceSeconds = 6f;

		private static readonly Color[] ShinCores = (Color[])(object)new Color[3]
		{
			new Color(0.8f, 0.78f, 0.85f, 1f),
			new Color(1f, 0.95f, 0.6f, 1f),
			new Color(1f, 0.9f, 1f, 1f)
		};

		private static readonly Color[] ShinGlows = (Color[])(object)new Color[3]
		{
			new Color(0.4f, 0.35f, 0.5f, 1f),
			new Color(1f, 0.4f, 0.05f, 1f),
			new Color(0.65f, 0.12f, 1f, 1f)
		};

		private static readonly float[] ShinIntensities = new float[3] { 0.3f, 0.9f, 1.4f };

		private static readonly float[] ShinWidths = new float[3] { 0.9f, 1.25f, 0.35f };

		public override void OnInitializeMelon()
		{
			Trace.Event("OnInitializeMelon start");
			instance = this;
			BreathSettings.Initialize();
			BreathSettings.InitializeExtra();
			BreathSettings.InitializeBite();
			Combat.InstallPatches(((MelonBase)this).HarmonyInstance);
			local = new BeamActor
			{
				IsLocal = true
			};
			ClashManager.ResultDecided += FusionBridge.SendClash;
			ClashManager.LocalBeamInterrupted += OnLocalBeamInterrupted;
			Trace.Event("OnInitializeMelon done");
		}

		public override void OnLateInitializeMelon()
		{
			Trace.Event("OnLateInitializeMelon start");
			FusionBridge.Initialize(((MelonBase)this).LoggerInstance);
			Trace.Event("Fusion bridge initialized");
			try
			{
				BreathMenu.Build();
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not build BoneMenu page: " + ex.Message);
			}
			Trace.Event("OnLateInitializeMelon done");
		}

		public override void OnSceneWasInitialized(int buildIndex, string sceneName)
		{
			Trace.ResetScene();
			Trace.Event("Scene initialized: " + sceneName);
			bite.Reset();
			BiteVictim.Release();
			local.ClearAfterSceneChange();
			foreach (BeamActor value in remotes.Values)
			{
				value.ClearAfterSceneChange();
			}
			remotes.Clear();
			dummy = null;
			nukes.Clear();
			ImpactDecals.Clear();
			GooPuddles.Clear();
			ClearShins();
			ClashManager.Reset();
			state = BreathState.Idle;
			nukeTimer = -1f;
			lastSentPhase = 0;
			Combat.RefreshPlayerColliders();
			networkReadyTime = Time.time + 6f;
			Trace.Event("Scene setup done");
		}

		public static void FireNow()
		{
			if (instance != null && BreathSettings.ModEnabled.Value)
			{
				Transform head = Player.Head;
				if (!((Object)(object)head == (Object)null) && instance.state == BreathState.Idle && !instance.bite.IsBusy)
				{
					instance.StartAttack(head);
				}
			}
		}

		private void StartAttack(Transform head)
		{
			if (BreathSettings.CurrentBeamStyle == BeamStyle.Bite || (BreathSettings.BiteWhenClose.Value && bite.HasTarget(head)))
			{
				bite.Start(head, local);
			}
			else
			{
				BeginCharge(head);
			}
		}

		public static void SpawnTestDummy()
		{
			if (instance != null)
			{
				instance.StartDummy();
			}
		}

		public override void OnUpdate()
		{
			//IL_01e8: 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)
			AvatarSwitcher.Tick();
			if (!BreathSettings.ModEnabled.Value)
			{
				if (wasEnabled)
				{
					ShutDown();
				}
				wasEnabled = false;
				DrainNetwork(apply: false);
				return;
			}
			wasEnabled = true;
			Transform head = Player.Head;
			if ((Object)(object)head == (Object)null)
			{
				return;
			}
			Trace.Once("scene.update", "First update with player head");
			float num = (frameDelta = Time.deltaTime);
			Combat.Tick(num);
			Trace.Once("scene.combat", "Combat tick ok");
			local.Id = (byte)(FusionBridge.IsNetworked ? FusionBridge.LocalId : 0);
			DrainNetwork(apply: true);
			UpdateRemotes(num);
			UpdateDummy(head);
			Trace.Once("scene.network", "Network/remotes ok");
			bool flag = BreathTriggered();
			if (bite.IsActive)
			{
				if (flag)
				{
					bite.RequestFling();
				}
			}
			else if (state == BreathState.Idle && !bite.IsBusy && flag)
			{
				StartAttack(head);
			}
			bite.Update(head, num, local);
			BiteVictim.Update(num);
			Trace.Once("scene.input", "Input ok");
			switch (state)
			{
			case BreathState.Charging:
				TickCharging(head, num);
				break;
			case BreathState.Firing:
				TickFiring(head, num);
				break;
			case BreathState.Tail:
				TickTail(head, num);
				break;
			case BreathState.Cooldown:
				stateTimer -= num;
				local.AuraLevel = Mathf.Max(0f, local.AuraLevel - num / 1.5f);
				if (stateTimer <= 0f)
				{
					state = BreathState.Idle;
				}
				break;
			case BreathState.Idle:
				local.AuraLevel = Mathf.Max(0f, local.AuraLevel - num / 1.5f);
				break;
			}
			local.Chest = GetChestPosition(head);
			actors.Clear();
			actors.Add(local);
			foreach (BeamActor value in remotes.Values)
			{
				actors.Add(value);
			}
			if (dummy != null)
			{
				actors.Add(dummy);
			}
			ClashManager.Update(actors, num);
			Trace.Once("scene.clash", "Clash update ok");
			if (state == BreathState.Firing || state == BreathState.Tail)
			{
				DealLocalDamage(head, num);
			}
			DealRemoteBeamDamage(head, num);
			UpdateShins(head, num);
			Trace.Once("scene.damage", "Damage/shins ok");
			float time = Time.time;
			foreach (BeamActor actor in actors)
			{
				actor.Render(time);
			}
			Trace.Once("scene.render", "Render ok");
			VisualsPlus.Tick(time);
			ImpactDecals.Update(time);
			GooPuddles.Update(time);
			SendNetworkState(num);
			UpdateNukes(num);
			Trace.Once("scene.frame", "First full frame ok");
		}

		private void BeginCharge(Transform head)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_006f: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_007b: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			Trace.Event("Charge start: " + BreathSettings.CurrentBeamStyle);
			StyleDefinition styleDefinition = BeamStyles.Get(BreathSettings.CurrentBeamStyle);
			BreathSettings.GetPalette(BreathSettings.CurrentColor, out var core, out var glow);
			if (StyleOverridesColor(styleDefinition))
			{
				core = styleDefinition.Core;
				glow = styleDefinition.Glow;
			}
			else
			{
				core = BreathSettings.ShiftHue(core, BreathSettings.HueShift.Value);
				glow = BreathSettings.ShiftHue(glow, BreathSettings.HueShift.Value);
			}
			local.Core = core;
			local.Glow = glow;
			local.Look.CopyFrom(styleDefinition.Look);
			local.Style = BreathSettings.CurrentBeamStyle;
			local.BeamLength = EffectiveBeamLength(styleDefinition);
			BuildActiveSlots();
			local.Count = activeSlots.Count;
			ComputeEmitters(head, head.forward, findEnds: false, 1f);
			state = BreathState.Charging;
			stateTimer = BreathSettings.ChargeSeconds.Value * styleDefinition.ChargeScale;
			local.AuraLevel = 0f;
			local.Extend = 0f;
			local.Phase = 1;
			local.Intensity = 1f;
			local.Simple = false;
			local.ForceSmoke = false;
			local.FlameJet = 0f;
			damageAllowed = true;
			for (int i = 0; i < followDirections.Length; i++)
			{
				followDirections[i] = Vector3.zero;
			}
			skipNuke = false;
		}

		private void TickCharging(Transform head, float deltaTime)
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			stateTimer -= deltaTime;
			float num = Mathf.Max(0.01f, BreathSettings.ChargeSeconds.Value * BeamStyles.Get(BreathSettings.CurrentBeamStyle).ChargeScale);
			local.AuraLevel = Mathf.Clamp01(1f - stateTimer / num);
			RefreshRainbow();
			ComputeEmitters(head, head.forward, findEnds: false, 1f);
			if (!(stateTimer > 0f))
			{
				Trace.Event("Beam start");
				state = BreathState.Firing;
				firingTotalSeconds = BreathSettings.BeamSeconds.Value + ShinExtraSeconds();
				stateTimer = firingTotalSeconds;
				damageTimer = 0f;
				smoothedDirection = head.forward;
				local.Phase = 2;
				if (BreathSettings.CurrentBeamStyle == BeamStyle.ShinGodzilla)
				{
					StartShinSequence(head);
				}
				local.Extend = 0f;
				ApplyRecoil(head.forward, deltaTime, kick: true);
			}
		}

		private void TickFiring(Transform head, float deltaTime)
		{
			//IL_0038: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			stateTimer -= deltaTime;
			damageTimer -= deltaTime;
			local.AuraLevel = 1f;
			Combat.ProtectPlayerFor(1.5f);
			smoothedDirection = SmoothDirection(smoothedDirection, head.forward, deltaTime);
			float num = firingTotalSeconds - stateTimer;
			float num2 = Mathf.Max(0.01f, BreathSettings.BeamExtendSeconds.Value);
			local.Extend = Visuals.EaseOut(num / num2);
			float widthFactor = Mathf.Max(0.05f, Mathf.Clamp01(stateTimer / 0.6f));
			ApplyBeamStyle(num, ref widthFactor);
			ComputeEmitters(head, smoothedDirection, findEnds: true, widthFactor);
			ApplyRecoil(smoothedDirection, deltaTime * widthFactor, kick: false);
			if (!(stateTimer > 0f))
			{
				EndBeam(interrupted: false);
			}
		}

		private void ApplyRecoil(Vector3 beamDirection, float deltaTime, bool kick)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			if (!BreathSettings.RecoilEnabled.Value || ((Vector3)(ref beamDirection)).sqrMagnitude < 0.01f)
			{
				return;
			}
			float strength = BreathSettings.RecoilForce.Value * Mathf.Sqrt(Mathf.Max(0.25f, BreathSettings.EffectiveBeamWidth));
			Vector3 push = -((Vector3)(ref beamDirection)).normalized;
			push.y *= 0.45f;
			try
			{
				PhysicsRig physicsRig = Player.PhysicsRig;
				if (!((Object)(object)physicsRig == (Object)null))
				{
					PushBody(physicsRig.rbFeet, push, strength, deltaTime, kick);
					PushBody(physicsRig.rbKnee, push, strength, deltaTime, kick);
					if ((Object)(object)physicsRig.torso != (Object)null)
					{
						PushBody(physicsRig.torso.rbPelvis, push, strength, deltaTime, kick);
						PushBody(physicsRig.torso.rbChest, push, strength, deltaTime, kick);
					}
				}
			}
			catch (Exception)
			{
			}
		}

		private static void PushBody(Rigidbody body, Vector3 push, float strength, float deltaTime, bool kick)
		{
			//IL_0027: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_001b: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)body == (Object)null))
			{
				if (kick)
				{
					body.AddForce(push * 1.6f * strength, (ForceMode)2);
				}
				body.AddForce(push * 5.5f * strength * deltaTime, (ForceMode)2);
			}
		}

		private void StartShinSequence(Transform head)
		{
			//IL_000b: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			Trace.Event("Shin sequence start");
			Vector3 origin = FindGround(head.position + FlatForward(head, head.forward) * 6f);
			float value = BreathSettings.ShinGasRadius.Value;
			float value2 = BreathSettings.ShinGasSpreadSeconds.Value;
			float num = Mathf.Max(value2, BreathSettings.ShinIgniteDelaySeconds.Value);
			float value3 = BreathSettings.ShinFireDurationSeconds.Value;
			shins.Add(new ShinSequence(origin, value, value2, num, value3, isOwner: true));
			FusionBridge.SendShin(origin, value, value2, num, value3);
			shinTailTime = (BreathSettings.ShinTailEnabled.Value ? (Time.time + num + BreathSettings.ShinTailDelaySeconds.Value) : (-1f));
		}

		private void ClearShins()
		{
			foreach (ShinSequence shin in shins)
			{
				shin.Dispose();
			}
			shins.Clear();
			shinTailTime = -1f;
			tailMode = false;
		}

		private void UpdateShins(Transform head, float deltaTime)
		{
			for (int num = shins.Count - 1; num >= 0; num--)
			{
				shins[num].Update(head, deltaTime);
				if (shins[num].Finished)
				{
					shins[num].Dispose();
					shins.RemoveAt(num);
				}
			}
			if (shinTailTime > 0f && Time.time >= shinTailTime && state == BreathState.Idle)
			{
				shinTailTime = -1f;
				BeginTail(head);
			}
		}

		private void BeginTail(Transform head)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			activeSlots.Clear();
			activeSlots.Add(Slot.Butt);
			tailMode = true;
			skipNuke = true;
			damageAllowed = true;
			local.Core = ShinCores[2];
			local.Glow = ShinGlows[2];
			local.Intensity = ShinIntensities[2];
			local.Simple = false;
			local.ForceSmoke = false;
			local.FlameJet = 0f;
			local.Style = BeamStyle.ShinGodzilla;
			local.BeamLength = BreathSettings.BeamLength.Value;
			local.Count = 1;
			ComputeEmitters(head, head.forward, findEnds: false, 1f);
			firingTotalSeconds = Mathf.Max(1f, BreathSettings.ShinTailBeamSeconds.Value);
			state = BreathState.Tail;
			stateTimer = firingTotalSeconds;
			damageTimer = 0f;
			local.AuraLevel = 1f;
			local.Extend = 0f;
			local.Phase = 2;
		}

		private void TickTail(Transform head, float deltaTime)
		{
			//IL_008f: 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_00c7: 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)
			stateTimer -= deltaTime;
			damageTimer -= deltaTime;
			local.AuraLevel = 1f;
			Combat.ProtectPlayerFor(1.5f);
			float num = firingTotalSeconds - stateTimer;
			local.Extend = Visuals.EaseOut(num / Mathf.Max(0.01f, BreathSettings.BeamExtendSeconds.Value));
			float num2 = Mathf.Max(0.05f, Mathf.Clamp01(stateTimer / 0.6f)) * 0.6f;
			ComputeEmitters(head, head.forward, findEnds: true, num2);
			if (local.Count > 0)
			{
				ApplyRecoil(local.Ends[0] - local.Starts[0], deltaTime * num2, kick: false);
			}
			if (!(stateTimer > 0f))
			{
				EndBeam(interrupted: false);
				tailMode = false;
			}
		}

		private void EndBeam(bool interrupted)
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			Trace.Event("Beam end" + (interrupted ? " (interrupted)" : ""));
			state = BreathState.Cooldown;
			stateTimer = BreathSettings.CooldownSeconds.Value + (interrupted ? 1f : 0f);
			local.Phase = 0;
			if (!interrupted && !skipNuke && BreathSettings.NukeEnabled.Value && local.Count != 0)
			{
				Vector3 val = (local.Clashing ? local.ClashPoint : local.GetVisibleEnd(0));
				pendingNukePoint = (BreathSettings.NukeAtBeamEnd.Value ? val : FindGround(val));
				nukeTimer = BreathSettings.NukeDelaySeconds.Value;
				Combat.ProtectPlayerFor(BreathSettings.NukeDelaySeconds.Value + NukeEffect.DamagePhaseSeconds);
			}
		}

		private void OnLocalBeamInterrupted()
		{
			skipNuke = true;
			if (state == BreathState.Charging || state == BreathState.Firing || state == BreathState.Tail)
			{
				EndBeam(interrupted: true);
				tailMode = false;
			}
			Combat.ProtectPlayerFor(NukeEffect.DamagePhaseSeconds);
		}

		private void ShutDown()
		{
			state = BreathState.Idle;
			nukeTimer = -1f;
			bite.ForceRelease(local);
			BiteVictim.Release();
			local.ForceOff();
			local.Dispose();
			foreach (BeamActor value in remotes.Values)
			{
				value.Dispose();
			}
			remotes.Clear();
			if (dummy != null)
			{
				dummy.Dispose();
			}
			foreach (NukeEffect nuke in nukes)
			{
				nuke.Dispose();
			}
			nukes.Clear();
			ClearShins();
			ImpactDecals.Clear();
			GooPuddles.Clear();
			dummy = null;
			ClashManager.Reset();
			SendNetworkState(0f, forceOff: true);
		}

		private void BuildActiveSlots()
		{
			activeSlots.Clear();
			switch (BreathSettings.CurrentEmitterMode)
			{
			case EmitterMode.RightHand:
				activeSlots.Add(Slot.RightHand);
				break;
			case EmitterMode.LeftHand:
				activeSlots.Add(Slot.LeftHand);
				break;
			case EmitterMode.BothHands:
				activeSlots.Add(Slot.LeftHand);
				activeSlots.Add(Slot.RightHand);
				break;
			case EmitterMode.Belly:
				activeSlots.Add(Slot.Belly);
				break;
			case EmitterMode.Crotch:
				activeSlots.Add(Slot.Crotch);
				break;
			case EmitterMode.Butt:
				activeSlots.Add(Slot.Butt);
				break;
			case EmitterMode.Everything:
				activeSlots.Add(Slot.Mouth);
				activeSlots.Add(Slot.LeftHand);
				activeSlots.Add(Slot.RightHand);
				activeSlots.Add(Slot.Belly);
				break;
			default:
				activeSlots.Add(Slot.Mouth);
				break;
			}
			switch (BeamStyles.Get(BreathSettings.CurrentBeamStyle).Emitters)
			{
			case EmitterOverride.Eyes:
				activeSlots.Clear();
				activeSlots.Add(Slot.LeftEye);
				activeSlots.Add(Slot.RightEye);
				break;
			case EmitterOverride.ThreeHeads:
				activeSlots.Clear();
				activeSlots.Add(Slot.Mouth);
				activeSlots.Add(Slot.LeftHand);
				activeSlots.Add(Slot.RightHand);
				break;
			}
		}

		private static bool StyleOverridesColor(StyleDefinition style)
		{
			if (style.HasOwnColor)
			{
				return BreathSettings.StyleUsesOwnColor.Value;
			}
			return false;
		}

		private static float EffectiveBeamLength(StyleDefinition style)
		{
			float value = BreathSettings.BeamLength.Value;
			if (!(style.Look.Goo > 0.5f))
			{
				return value;
			}
			return Mathf.Min(value, BreathSettings.GooRange.Value);
		}

		private void ComputeEmitters(Transform head, Vector3 aimDirection, bool findEnds, float widthFactor)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			Vector3 target = head.position + aimDirection * 60f;
			StyleDefinition styleDefinition = BeamStyles.Get(BreathSettings.CurrentBeamStyle);
			float num = EffectiveBeamLength(styleDefinition);
			bool flag = styleDefinition.Look.Goo > 0.5f;
			bool flag2 = activeSlots.Count == 1;
			for (int i = 0; i < activeSlots.Count; i++)
			{
				Slot slot = activeSlots[i];
				Vector3 slotPosition = GetSlotPosition(slot, head, aimDirection);
				Vector3 val = ChooseDirection(slot, head, slotPosition, aimDirection, target);
				local.Starts[i] = slotPosition;
				Vector3 val2 = ((!flag) ? (findEnds ? FindBeamEnd(head, slotPosition, val, num) : (slotPosition + val * num)) : (findEnds ? FindGooLanding(head, slotPosition, val, num) : (slotPosition + val * Mathf.Min(1f, num))));
				local.Ends[i] = val2;
				float num2 = (flag2 ? 1f : (slot switch
				{
					Slot.Belly => 0.8f, 
					Slot.Mouth => 1f, 
					_ => 0.55f, 
				}));
				local.WidthScales[i] = BreathSettings.EffectiveBeamWidth * num2 * widthFactor;
			}
		}

		private static Vector3 FlatForward(Transform head, Vector3 aimDirection)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Vector3.ProjectOnPlane(aimDirection, Vector3.up);
			if (((Vector3)(ref val)).sqrMagnitude < 0.01f)
			{
				val = Vector3.ProjectOnPlane(head.forward, Vector3.up);
			}
			if (!(((Vector3)(ref val)).sqrMagnitude < 0.01f))
			{
				return ((Vector3)(ref val)).normalized;
			}
			return Vector3.forward;
		}

		private Vector3 ChooseDirection(Slot slot, Transform head, Vector3 origin, Vector3 aimDirection, Vector3 target)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			bool value = BreathSettings.FollowEmitter.Value;
			Vector3 val = target - origin;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			if (tailMode && slot == Slot.Butt)
			{
				val = -FlatForward(head, aimDirection) + Vector3.up * 0.3f;
				return ((Vector3)(ref val)).normalized;
			}
			switch (slot)
			{
			case Slot.Mouth:
				return aimDirection;
			case Slot.Butt:
				if (!value)
				{
					val = new Vector3(0f - aimDirection.x, aimDirection.y, 0f - aimDirection.z);
					return ((Vector3)(ref val)).normalized;
				}
				return -FlatForward(head, aimDirection);
			case Slot.LeftEye:
			case Slot.RightEye:
				return normalized;
			case Slot.Belly:
			case Slot.Crotch:
				if (!value)
				{
					return normalized;
				}
				return FlatForward(head, aimDirection);
			default:
			{
				if (!value)
				{
					return normalized;
				}
				Hand val2 = ((slot == Slot.LeftHand) ? Player.LeftHand : Player.RightHand);
				if ((Object)(object)val2 == (Object)null)
				{
					return normalized;
				}
				float num = ((slot == Slot.LeftHand) ? (-0.2f) : 0.2f);
				Vector3 val3 = GetChestPosition(head) + head.right * num + Vector3.up * 0.15f;
				Vector3 val4 = ((Component)val2).transform.position - val3;
				if (((Vector3)(ref val4)).magnitude < 0.2f)
				{
					return normalized;
				}
				((Vector3)(ref val4)).Normalize();
				if (((Vector3)(ref followDirections[(int)slot])).sqrMagnitude < 0.01f)
				{
					followDirections[(int)slot] = val4;
				}
				followDirections[(int)slot] = SmoothDirection(followDirections[(int)slot], val4, frameDelta);
				return followDirections[(int)slot];
			}
			}
		}

		private static float ShinFireLikeness(Color glow)
		{
			//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_000c: 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_001a: 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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			Color val = ShinGlows[1];
			float num = glow.r - val.r;
			float num2 = glow.g - val.g;
			float num3 = glow.b - val.b;
			return Mathf.Clamp01(1f - Mathf.Sqrt(num * num + num2 * num2 + num3 * num3) / 0.5f);
		}

		private static float ShinExtraSeconds()
		{
			if (BreathSettings.CurrentBeamStyle != BeamStyle.ShinGodzilla)
			{
				return 0f;
			}
			return Mathf.Max(0.1f, BreathSettings.ShinGasSeconds.Value) + Mathf.Max(0.1f, BreathSettings.ShinFireSeconds.Value);
		}

		private void RefreshRainbow()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (BreathSettings.CurrentColor == BreathColor.Rainbow && !StyleOverridesColor(BeamStyles.Get(BreathSettings.CurrentBeamStyle)))
			{
				BreathSettings.GetPalette(BreathColor.Rainbow, out var core, out var glow);
				local.Core = core;
				local.Glow = glow;
			}
		}

		private void ApplyBeamStyle(float elapsed, ref float widthFactor)
		{
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: 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_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			local.Simple = false;
			local.ForceSmoke = false;
			local.FlameJet = 0f;
			local.Intensity = 1f;
			damageAllowed = true;
			StyleDefinition styleDefinition = BeamStyles.Get(BreathSettings.CurrentBeamStyle);
			local.Look.CopyFrom(styleDefinition.Look);
			if (BreathSettings.CurrentBeamStyle != BeamStyle.ShinGodzilla)
			{
				widthFactor *= styleDefinition.Width;
				local.Intensity = styleDefinition.Intensity;
				RefreshRainbow();
				return;
			}
			float num = Mathf.Max(0.1f, BreathSettings.ShinGasSeconds.Value);
			float num2 = Mathf.Max(0.1f, BreathSettings.ShinFireSeconds.Value);
			int num3;
			int num4;
			float num5;
			if (elapsed < num)
			{
				num3 = 0;
				num4 = 0;
				num5 = 0f;
			}
			else if (elapsed < num + num2)
			{
				num3 = 0;
				num4 = 1;
				num5 = Mathf.Clamp01((elapsed - num) / 0.35f);
			}
			else
			{
				num3 = 1;
				num4 = 2;
				num5 = Mathf.Clamp01((elapsed - num - num2) / 0.35f);
			}
			local.Core = Color.Lerp(ShinCores[num3], ShinCores[num4], num5);
			local.Glow = Color.Lerp(ShinGlows[num3], ShinGlows[num4], num5);
			local.Intensity = Mathf.Lerp(ShinIntensities[num3], ShinIntensities[num4], num5);
			widthFactor *= Mathf.Lerp(ShinWidths[num3], ShinWidths[num4], num5);
			local.Simple = num3 == 0 && num5 < 0.5f;
			local.ForceSmoke = elapsed < num + num2;
			local.FlameJet = ((num3 == 0) ? num5 : (1f - num5));
			damageAllowed = elapsed >= num;
		}

		private static Vector3 GetSlotPosition(Slot slot, Transform head, Vector3 aimDirection)
		{
			//IL_002f: 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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_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_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			switch (slot)
			{
			case Slot.LeftHand:
				return HandPosition(Player.LeftHand, head, aimDirection);
			case Slot.RightHand:
				return HandPosition(Player.RightHand, head, aimDirection);
			case Slot.Belly:
			{
				Vector3 val = Vector3.ProjectOnPlane(aimDirection, Vector3.up);
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				return GetChestPosition(head) + normalized * 0.3f + Vector3.down * 0.2f;
			}
			case Slot.LeftEye:
				return head.position + head.forward * 0.12f - head.right * 0.035f + head.up * 0.02f;
			case Slot.RightEye:
				return head.position + head.forward * 0.12f + head.right * 0.035f + head.up * 0.02f;
			case Slot.Crotch:
				return GetChestPosition(head) + FlatForward(head, aimDirection) * 0.18f + Vector3.down * 0.55f;
			case Slot.Butt:
				return GetChestPosition(head) - FlatForward(head, aimDirection) * 0.2f + Vector3.down * 0.55f;
			default:
				return head.position + aimDirection * BreathSettings.MouthForwardOffset.Value - head.up * 0.1f;
			}
		}

		private static Vector3 HandPosition(Hand hand, Transform head, Vector3 aimDirection)
		{
			//IL_002b: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)hand == (Object)null)
			{
				return head.position + aimDirection * BreathSettings.MouthForwardOffset.Value;
			}
			return ((Component)hand).transform.position + aimDirection * 0.12f;
		}

		private static Vector3 GetChestPosition(Transform head)
		{
			//IL_002c: 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_0016: 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)
			Transform chest = Player.Chest;
			if (!((Object)(object)chest != (Object)null))
			{
				return head.position - head.up * 0.45f;
			}
			return chest.position;
		}

		private void DealRemoteBeamDamage(Transform head, float deltaTime)
		{
			//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)
			//IL_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: 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_00d3: 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_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: 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_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: 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_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			if (!BreathSettings.PlayerDamageEnabled.Value || remotes.Count == 0)
			{
				return;
			}
			Vector3 chestPosition = GetChestPosition(head);
			Vector3 val = chestPosition + Vector3.down * 0.55f;
			Vector3 point = val + Vector3.down * 0.55f;
			foreach (BeamActor value in remotes.Values)
			{
				if (!value.IsFiring || value.IsDummy || (value.PlayerDamage <= 0f && value.PlayerPush <= 0f))
				{
					continue;
				}
				float percentOfMaxHealth = value.PlayerDamage * deltaTime;
				for (int i = 0; i < value.Count; i++)
				{
					Vector3 val2 = value.Starts[i];
					Vector3 visibleEnd = value.GetVisibleEnd(i);
					Vector3 val3 = visibleEnd - val2;
					if (((Vector3)(ref val3)).sqrMagnitude < 0.01f)
					{
						continue;
					}
					Vector3 end = visibleEnd + ((Vector3)(ref val3)).normalized * 2f;
					float radius = 0.8f + value.WidthScales[i] * 0.55f;
					if (NearSegment(head.position, val2, end, radius) || NearSegment(chestPosition, val2, end, radius) || NearSegment(val, val2, end, radius) || NearSegment(point, val2, end, radius))
					{
						Combat.DamageLocalPlayer(percentOfMaxHealth);
						if (value.PlayerPush > 0f)
						{
							Combat.PushLocalPlayer(((Vector3)(ref val3)).normalized * value.PlayerPush * deltaTime);
						}
						return;
					}
				}
			}
		}

		private static bool NearSegment(Vector3 point, Vector3 start, Vector3 end, float radius)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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)
			return DistanceToSegment(point, start, end) <= radius;
		}

		private static float DistanceToSegment(Vector3 point, Vector3 start, Vector3 end)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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_0007: 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_0021: 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_0035: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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)
			Vector3 val = end - start;
			float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
			if (sqrMagnitude < 0.0001f)
			{
				return Vector3.Distance(point, start);
			}
			float num = Mathf.Clamp01(Vector3.Dot(point - start, val) / sqrMagnitude);
			return Vector3.Distance(point, start + val * num);
		}

		private void DealLocalDamage(Transform head, float deltaTime)
		{
			//IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			if (damageTimer > 0f)
			{
				return;
			}
			damageTimer = 0.1f;
			if (BreathSettings.DamageEnabled.Value && local.IsFiring && damageAllowed)
			{
				for (int i = 0; i < local.Count; i++)
				{
					Vector3 visibleEnd = local.GetVisibleEnd(i);
					Vector3 val = visibleEnd - local.Starts[i];
					Vector3 normalized = ((Vector3)(ref val)).normalized;
					ApplyBeamDamage(head, local.Starts[i], normalized, visibleEnd);
				}
			}
		}

		private void DrainNetwork(bool apply)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			BeamPacket result;
			while (FusionBridge.IncomingBeams.TryDequeue(out result))
			{
				if (apply)
				{
					ApplyBeamPacket(result);
				}
			}
			NukePacket result2;
			while (FusionBridge.IncomingNukes.TryDequeue(out result2))
			{
				if (apply)
				{
					nukes.Add(new NukeEffect(result2.Position, result2.Radius, 0f, result2.Push, result2.Height, result2.Core, result2.Glow, result2.UseBreathColor, damageEnabled: false, result2.PlayerDamage));
					BreathAudio.PlayBoom(result2.Position, BreathSettings.SoundVolume.Value);
				}
			}
			ShinPacket result3;
			while (FusionBridge.IncomingShins.TryDequeue(out result3))
			{
				if (apply)
				{
					shins.Add(new ShinSequence(result3.Origin, result3.Radius, result3.SpreadSeconds, result3.IgniteSeconds, result3.FireSeconds, isOwner: false));
				}
			}
			ClashPacket result4;
			while (FusionBridge.IncomingClashes.TryDequeue(out result4))
			{
				if (apply)
				{
					ClashManager.ReceiveResult(result4.Low, result4.High, result4.Winner, result4.Point);
				}
			}
			BitePacket result5;
			while (FusionBridge.IncomingBites.TryDequeue(out result5))
			{
				if (apply)
				{
					BiteVictim.Receive(result5);
				}
			}
		}

		private void ApplyBeamPacket(BeamPacket packet)
		{
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: 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_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			if (packet.Sender != local.Id || !FusionBridge.IsNetworked)
			{
				if (!remotes.TryGetValue(packet.Sender, out var value))
				{
					value = new BeamActor
					{
						Id = packet.Sender
					};
					remotes[packet.Sender] = value;
				}
				if (packet.Phase == 2 && value.Phase != 2)
				{
					value.Extend = 0f;
				}
				value.Phase = packet.Phase;
				value.Style = (BeamStyle)((packet.Style < Enum.GetValues(typeof(BeamStyle)).Length) ? packet.Style : 0);
				StyleDefinition styleDefinition = BeamStyles.Get(value.Style);
				value.Look.CopyFrom(styleDefinition.Look);
				value.Intensity = ((value.Style == BeamStyle.ShinGodzilla) ? 1f : styleDefinition.Intensity);
				value.Count = packet.Count;
				value.Core = packet.Core;
				value.Glow = packet.Glow;
				value.FlameJet = ((value.Style == BeamStyle.ShinGodzilla && packet.Phase == 2) ? ShinFireLikeness(packet.Glow) : 0f);
				value.BeamLength = packet.BeamLength;
				value.Chest = packet.Chest;
				value.LastReceivedTime = Time.time;
				if (packet.Phase == 1)
				{
					value.AuraLevel = packet.AuraLevel;
				}
				value.PlayerDamage = packet.PlayerDamage;
				value.PlayerPush = packet.PlayerPush;
				if (packet.Phase == 2)
				{
					value.AuraLevel = 1f;
				}
				for (int i = 0; i < 4; i++)
				{
					value.Starts[i] = packet.Starts[i];
					value.Ends[i] = packet.Ends[i];
					value.WidthScales[i] = packet.Widths[i];
				}
			}
		}

		private void UpdateRemotes(float deltaTime)
		{
			forgetList.Clear();
			foreach (KeyValuePair<byte, BeamActor> remote in remotes)
			{
				BeamActor value = remote.Value;
				float num = Time.time - value.LastReceivedTime;
				if (value.Phase != 0 && num > 1f)
				{
					value.Phase = 0;
				}
				if (value.Phase == 2)
				{
					value.Extend = Mathf.Min(1f, value.Extend + deltaTime / 0.35f);
				}
				if (value.Phase == 0)
				{
					value.AuraLevel = Mathf.Max(0f, value.AuraLevel - deltaTime / 1.5f);
				}
				if (value.Phase == 0 && num > 10f)
				{
					forgetList.Add(remote.Key);
				}
			}
			foreach (byte forget in forgetList)
			{
				remotes[forget].Dispose();
				remotes.Remove(forget);
			}
		}

		private void SendNetworkState(float deltaTime, bool forceOff = false)
		{
			if (!FusionBridge.IsNetworked || Time.time < networkReadyTime || !FusionBridge.IsLobbyReady)
			{
				lastSentPhase = 0;
				return;
			}
			if (forceOff)
			{
				local.Phase = 0;
			}
			bool flag = local.Phase != lastSentPhase;
			sendTimer -= deltaTime;
			if (flag || (local.Phase != 0 && !(sendTimer > 0f)))
			{
				sendTimer = 0.05f;
				lastSentPhase = local.Phase;
				FusionBridge.SendBeam(local, flag);
			}
		}

		private void StartDummy()
		{
			//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)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_009b: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			Trace.Event("Dummy start");
			Transform head = Player.Head;
			if (!((Object)(object)head == (Object)null))
			{
				Vector3 val = Vector3.ProjectOnPlane(head.forward, Vector3.up);
				Vector3 val2 = ((Vector3)(ref val)).normalized;
				if (((Vector3)(ref val2)).sqrMagnitude < 0.01f)
				{
					val2 = Vector3.forward;
				}
				dummy = new BeamActor
				{
					Id = 250,
					IsDummy = true,
					Count = 1,
					Phase = 2
				};
				BreathSettings.GetPalette(BreathColor.BurningRed, out dummy.Core, out dummy.Glow);
				dummy.Starts[0] = head.position + val2 * 14f;
				dummy.WidthScales[0] = BreathSettings.EffectiveBeamWidth;
				dummyEndTime = Time.time + 40f;
			}
		}

		private void UpdateDummy(Transform head)
		{
			//IL_0035: 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_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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			if (dummy == null)
			{
				return;
			}
			if (Time.time > dummyEndTime)
			{
				dummy.ForceOff();
				dummy.Dispose();
				dummy = null;
				return;
			}
			Vector3 val = head.position - dummy.Starts[0];
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (!(magnitude < 3f))
			{
				dummy.Ends[0] = dummy.Starts[0] + val / magnitude * (magnitude - 2f);
				dummy.Extend = 1f;
				dummy.BeamLength = BreathSettings.BeamLength.Value;
				dummy.Phase = 2;
			}
		}

		private void UpdateNukes(float deltaTime)
		{
			if (nukeTimer >= 0f)
			{
				nukeTimer -= deltaTime;
				if (nukeTimer < 0f)
				{
					SpawnNuke();
				}
			}
			for (int num = nukes.Count - 1; num >= 0; num--)
			{
				nukes[num].Update(deltaTime);
				if (!nukes[num].IsAlive)
				{
					nukes.RemoveAt(num);
				}
			}
		}

		private void SpawnNuke()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
			Trace.Event("Nuke spawn");
			nukeTimer = -1f;
			Combat.ProtectPlayerFor(NukeEffect.DamagePhaseSeconds);
			float value = BreathSettings.NukeRadius.Value;
			float value2 = BreathSettings.NukeCloudHeight.Value;
			bool value3 = BreathSettings.NukeUsesBreathColor.Value;
			nukes.Add(new NukeEffect(pendingNukePoint, value, BreathSettings.NukeDamage.Value, BreathSettings.NukePushForce.Value, value2, local.Core, local.Glow, value3));
			BreathAudio.PlayBoom(pendingNukePoint, BreathSettings.SoundVolume.Value);
			FusionBridge.SendNuke(pendingNukePoint, value, value2, local.Core, local.Glow, value3);
		}

		private static Vector3 SmoothDirection(Vector3 current, Vector3 target, float deltaTime)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			float value = BreathSettings.BeamSmoothing.Value;
			if (value <= 0.001f)
			{
				return target;
			}
			float num = 1f - Mathf.Exp((0f - deltaTime) / value);
			Vector3 val = Vector3.Slerp(current, target, num);
			return ((Vector3)(ref val)).normalized;
		}

		private bool BreathTriggered()
		{
			if (TestKeyPressed())
			{
				return true;
			}
			return input.Triggered(BreathSettings.CurrentTriggerMode, BreathSettings.TriggerHoldSeconds.Value);
		}

		private static bool TestKeyPressed()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			KeyCode testKeyCode = BreathSettings.TestKeyCode;
			if ((int)testKeyCode == 0)
			{
				return false;
			}
			try
			{
				return Input.GetKeyDown(testKeyCode);
			}
			catch (Exception)
			{
				return false;
			}
		}

		private static Vector3 FindBeamEnd(Transform head, Vector3 start, Vector3 direction, float length)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: 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_006f: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			Il2CppStructArray<RaycastHit> val = Physics.RaycastAll(start, direction, length, -1, (QueryTriggerInteraction)1);
			float num = length;
			if (val != null)
			{
				foreach (RaycastHit item in (Il2CppArrayBase<RaycastHit>)(object)val)
				{
					RaycastHit current = item;
					if (!((Object)(object)((RaycastHit)(ref current)).collider == (Object)null) && !Combat.IsPlayerCollider(((RaycastHit)(ref current)).collider, head.position, 0.6f) && ((RaycastHit)(ref current)).distance < num)
					{
						num = ((RaycastHit)(ref current)).distance;
					}
				}
			}
			return start + direction * num;
		}

		private static Vector3 FindGooLanding(Transform head, Vector3 start, Vector3 aim, float reach)
		{
			//IL_0012: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Max(1.5f, reach / 0.55f);
			Vector3 val = aim * num;
			Vector3 val2 = start;
			for (int i = 0; i < 40; i++)
			{
				Vector3 val3 = val2 + val * 0.04f;
				Vector3 val4 = val3 - val2;
				float magnitude = ((Vector3)(ref val4)).magnitude;
				if (magnitude > 0.001f)
				{
					Vector3 val5 = FindBeamEnd(head, val2, val4 / magnitude, magnitude);
					Vector3 val6 = val5 - val2;
					if (((Vector3)(ref val6)).sqrMagnitude < magnitude * magnitude - 0.0001f)
					{
						return val5;
					}
				}
				val2 = val3;
				val += Physics.gravity * 0.04f;
			}
			return FindGround(val2);
		}

		private static Vector3 FindGround(Vector3 point)
		{
			//IL_0013: 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_0018: 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_001a: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_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)
			Transform head = Player.Head;
			Vector3 headPosition = (((Object)(object)head != (Object)null) ? head.position : point);
			Il2CppStructArray<RaycastHit> val = Physics.RaycastAll(point + Vector3.up * 3f, Vector3.down, 400f, -1, (QueryTriggerInteraction)1);
			float num = float.MaxValue;
			Vector3 result = point;
			if (val != null)
			{
				foreach (RaycastHit item in (Il2CppArrayBase<RaycastHit>)(object)val)
				{
					RaycastHit current = item;
					if (!((Object)(object)((RaycastHit)(ref current)).collider == (Object)null) && !Combat.IsPlayerCollider(((RaycastHit)(ref current)).collider, headPosition, 0.6f) && ((RaycastHit)(ref current)).distance < num)
					{
						num = ((RaycastHit)(ref current)).distance;
						result = ((RaycastHit)(ref current)).point;
					}
				}
			}
			return result;
		}

		private static void ApplyBeamDamage(Transform head, Vector3 start, Vector3 direction, Vector3 end)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: 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)
			Vector3 val = end + direction * 2f;
			Il2CppReferenceArray<Collider> val2 = Physics.OverlapCapsule(start, val, 1.2f);
			if (val2 == null)
			{
				return;
			}
			float damage = BreathSettings.DamagePerSecond.Value * 0.1f;
			float num = BreathSettings.PushForce.Value * 0.1f;
			HashSet<int> hashSet = new HashSet<int>();
			foreach (Collider item in (Il2CppArrayBase<Collider>)(object)val2)
			{
				if (!((Object)(object)item == (Object)null) && !Combat.IsPlayerCollider(item, head.position, 0.6f))
				{
					Rigidbody attachedRigidbody = item.attachedRigidbody;
					if ((Object)(object)attachedRigidbody != (Object)null && !attachedRigidbody.isKinematic && !Combat.IsPlayerBody(attachedRigidbody) && hashSet.Add(((Object)attachedRigidbody).GetInstanceID()))
					{
						attachedRigidbody.AddForce(direction * num, (ForceMode)2);
					}
					Combat.SendAttack(item, start, direction, damage);
				}
			}
		}
	}
	public static class AvatarSwitcher
	{
		public const string PolyBlankBarcode = "c3534c5a-94b2-40a4-912a-24a8506f6c79";

		private const float RepeatGuardSeconds = 1f;

		private static float lastSwitchTime = -10f;

		public static void Tick()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			KeyCode polyBlankKeyCode = BreathSettings.PolyBlankKeyCode;
			if ((int)polyBlankKeyCode != 0)
			{
				bool keyDown;
				try
				{
					keyDown = Input.GetKeyDown(polyBlankKeyCode);
				}
				catch (Exception)
				{
					return;
				}
				if (keyDown)
				{
					SwitchToPolyBlank();
				}
			}
		}

		public static void SwitchToPolyBlank()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			if (Time.time - lastSwitchTime < 1f)
			{
				return;
			}
			lastSwitchTime = Time.time;
			try
			{
				RigManager rigManager = Player.RigManager;
				if ((Object)(object)rigManager == (Object)null)
				{
					MelonLogger.Warning("Atomic Breath: no player rig to switch avatars on.");
					return;
				}
				rigManager.SwapAvatarCrate(new Barcode("c3534c5a-94b2-40a4-912a-24a8506f6c79"), true, (Action<bool>)null);
				MelonLogger.Msg("Atomic Breath: switched to Poly Blank.");
			}
			catch (Exception ex)
			{
				MelonLogger.Warning("Atomic Breath could not switch to Poly Blank: " + ex.Message);
			}
		}
	}
	public class BeamActor
	{
		public const int MaxEmitters = 4;

		public const int PhaseOff = 0;

		public const int PhaseCharging = 1;

		public const int PhaseFiring = 2;

		private const float SmokeSeconds = 3.5f;

		private const float DefaultBeamLength = 100f;

		public byte Id;

		public bool IsLocal;

		public bool IsDummy;

		public int Phase;

		public int Count;

		public readonly Vector3[] Starts = (Vector3[])(object)new Vector3[4];

		public readonly Vector3[] Ends = (Vector3[])(object)new Vector3[4];

		public readonly float[] WidthScales = new float[4];

		public Color Core = Color.white;

		public Color Glow = Color.cyan;

		public Vector3 Chest;

		public float AuraLevel;

		public float PlayerDamage;

		public float PlayerPush;

		public bool OverrideNetworkDamage;

		public float Extend = 1f;

		public float BeamLength = 100f;

		public float LastReceivedTime;

		public float SuppressedUntil;

		public BeamStyle Style;

		public float Intensity = 1f;

		public bool Simple;

		public readonly BeamLook Look = new BeamLook();

		public bool ForceSmoke;

		public float FlameJet;

		public bool Clashing;

		public Vector3 ClashPoint;

		private readonly BreathEffect[] effects = new BreathEffect[4];

		private readonly int[] appliedPhase = new int[4];

		private readonly float[] smokeUntil = new float[4];

		private readonly Color[] appliedCore = (Color[])(object)new Color[4];

		private readonly Color[] appliedGlow = (Color[])(object)new Color[4];

		private readonly bool[] forcedSmoke = new bool[4];

		private BiteEffect biteEffect;

		public bool IsFiring
		{
			get
			{
				if (Phase == 2 && Time.time >= SuppressedUntil)
				{
					return Count > 0;
				}
				return false;
			}
		}

		public Vector3 GetVisibleEnd(int index)
		{
			//IL_0017: 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_001c: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = (Clashing ? ClashPoint : Ends[index]);
			return Starts[index] + (val - Starts[index]) * Extend;
		}

		public void Render(float time)
		{
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_00fc: 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)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: 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_017f: 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_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: 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_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			bool flag = Style == BeamStyle.Bite;
			if (!flag)
			{
				for (int i = 0; i < Count; i++)
				{
					EnsureEffect(i);
				}
			}
			int num = ((Phase != 2 || IsFiring) ? Phase : 0);
			if (flag)
			{
				num = 0;
			}
			for (int j = 0; j < 4; j++)
			{
				BreathEffect breathEffect = effects[j];
				if (breathEffect == null)
				{
					continue;
				}
				if (!breathEffect.IsValid)
				{
					effects[j] = null;
					appliedPhase[j] = 0;
					continue;
				}
				int num2 = ((j < Count) ? num : 0);
				if (num2 != appliedPhase[j])
				{
					ApplyPhase(j, num2);
					forcedSmoke[j] = false;
				}
				if (num2 != 0)
				{
					if (Core != appliedCore[j] || Glow != appliedGlow[j])
					{
						appliedCore[j] = Core;
						appliedGlow[j] = Glow;
						breathEffect.SetColors(Core, Glow);
					}
					breathEffect.SetLook(Intensity, Simple, Look);
				}
				switch (num2)
				{
				case 2:
				{
					if (ForceSmoke != forcedSmoke[j])
					{
						forcedSmoke[j] = ForceSmoke;
						breathEffect.SetSmoke(ForceSmoke);
					}
					Vector3 visibleEnd = GetVisibleEnd(j);
					Vector3 val = visibleEnd - Starts[j];
					if (((Vector3)(ref val)).sqrMagnitude > 0.0001f)
					{
						breathEffect.FollowMouth(Starts[j], Quaternion.LookRotation(val));
					}
					breathEffect.SetFlameJet((Style == BeamStyle.ShinGodzilla) ? FlameJet : 0f, WidthScales[j]);
					breathEffect.UpdateBeam(Starts[j], visibleEnd, time, WidthScales[j]);
					break;
				}
				case 1:
					breathEffect.FollowMouth(Starts[j], Quaternion.identity);
					breathEffect.SetChargeLevel(AuraLevel);
					break;
				}
				if (smokeUntil[j] > 0f && Time.time > smokeUntil[j])
				{
					smokeUntil[j] = 0f;
					breathEffect.SetSmoke(active: false);
				}
			}
			BreathEffect breathEffect2 = effects[0];
			if (breathEffect2 != null && breathEffect2.IsValid)
			{
				breathEffect2.SetAura((BreathSettings.ChargeGlowEnabled.Value && !flag) ? AuraLevel : 0f, Chest, BreathSettings.ChargeGlowStrength.Value);
			}
			RenderBite(time, flag && IsFiring);
		}

		private void RenderBite(float time, bool closed)
		{
			//IL_003a: 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_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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			if (biteEffect != null && !biteEffect.IsValid)
			{
				biteEffect = null;
			}
			if (biteEffect == null)
			{
				if (!closed)
				{
					return;
				}
				biteEffect = new BiteEffect();
			}
			Vector3 aim = Ends[0] - Starts[0];
			biteEffect.Update(closed, Starts[0], aim, time, BreathSettings.BiteJawScale.Value, Intensity > 0.5f);
		}

		public void ForceOff()
		{
			Phase = 0;
			AuraLevel = 0f;
			Clashing = false;
			for (int i = 0; i < 4; i++)
			{
				if (effects[i] != null && effects[i].IsValid && appliedPhase[i] != 0)
				{
					ApplyPhase(i, 0);
				}
			}
			if (biteEffect != null)
			{
				biteEffect.Dispose();
			}
			biteEffect = null;
		}

		public void Dispose()
		{
			for (int i = 0; i < 4; i++)
			{
				if (effects[i] != null)
				{
					effects[i].Dispose();
				}
				effects[i] = null;
				appliedPhase[i] = 0;
			}
			if (biteEffect != null)
			{
				biteEffect.Dispose();
			}
			biteEffect = null;
		}

		public void ClearAfterSceneChange()
		{
			for (int i = 0; i < 4; i++)
			{
				effects[i] = null;
				appliedPhase[i] = 0;
				smokeUntil[i] = 0f;
			}
			Phase = 0;
			Clashing = false;
			biteEffect = null;
		}

		private void EnsureEffect(int index)
		{
			if (effects[index] == null || !effects[index].IsValid)
			{
				Trace.Event("Creating effect " + index + (IsLocal ? " (local)" : ""));
				effects[index] = new BreathEffect(IsLocal, index == 0);
				appliedPhase[index] = 0;
				Trace.Event("Effect " + index + " created");
			}
		}

		private void ApplyPhase(int index, int newPhase)
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			BreathEffect breathEffect = effects[index];
			int num = appliedPhase[index];
			appliedPhase[index] = newPhase;
			bool flag = index == 0;
			if (num == 1)
			{
				breathEffect.SetCharging(active: false);
				if (flag)
				{
					breathEffect.Audio.StopCharge();
				}
			}
			if (num == 2)
			{
				breathEffect.SetFiring(active: false, BeamLength);
				if (flag)
				{
					breathEffect.Audio.StopBeam();
				}
				if (BreathSettings.SmokeEnabled.Value)
				{
					breathEffect.SetSmoke(active: true);
					smokeUntil[index] = Time.time + 3.5f;
				}
			}
			switch (newPhase)
			{
			case 1:
				breathEffect.SetColors(Core, Glow);
				breathEffect.SetSmoke(active: false);
				smokeUntil[index] = 0f;
				breathEffect.SetCharging(active: true);
				if (flag)
				{
					breathEffect.Audio.PlayCharge(BreathSettings.ChargeSeconds.Value * BeamStyles.Get(Style).ChargeScale, BreathSettings.SoundVolume.Value, Style);
				}
				break;
			case 2:
				breathEffect.SetColors(Core, Glow);
				breathEffect.SetSmoke(active: false);
				smokeUntil[index] = 0f;
				breathEffect.SetFiring(active: true, BeamLength);
				if (flag)
				{
					breathEffect.Audio.StopCharge();
					breathEffect.Audio.StartBeam(BreathSettings.SoundVolume.Value, Style);
				}
				break;
			}
		}
	}
	public enum EmitterOverride
	{
		None,
		Eyes,
		ThreeHeads
	}
	public class BeamLook
	{
		public float Wobble = 1f;

		public float Spirals = 1f;

		public float Lightning = 1f;

		public float PulseAmount;

		public float PulseHz;

		public float Stutter;

		public float ZigZag;

		public float Goo;

		public void CopyFrom(BeamLook other)
		{
			Wobble = other.Wobble;
			Spirals = other.Spirals;
			Lightning = other.Lightning;
			PulseAmount = other.PulseAmount;
			PulseHz = other.PulseHz;
			Stutter = other.Stutter;
			ZigZag = other.ZigZag;
			Goo = other.Goo;
		}
	}
	public class StyleDefinition
	{
		public Color Core = Color.white;

		public Color Glow = Color.cyan;

		public bool HasOwnColor;

		public float Width = 1f;

		public float Intensity = 1f;

		public float ChargeScale = 1f;

		public EmitterOverride Emitters;

		public readonly BeamLook Look = new BeamLook();
	}
	public static class BeamStyles
	{
		private static readonly Dictionary<BeamStyle, StyleDefinition> Cache = new Dictionary<BeamStyle, StyleDefinition>();

		public static StyleDefinition Get(BeamStyle style)
		{
			if (Cache.TryGetValue(style, out var value))
			{
				return value;
			}
			StyleDefinition styleDefinition = Build(style);
			Cache[style] = styleDefinition;
			return styleDefinition;
		}

		private static StyleDefinition Build(BeamStyle style)
		{
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: 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_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0586: Unknown result type (might be due to invalid IL or missing references)
			//IL_0604: Unknown result type (might be due to invalid IL or missing references)
			//IL_0618: Unknown result type (might be due to invalid IL or missing references)
			//IL_0696: Unknown result type (might be due to invalid IL or missing references)
			//IL_06aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0738: Unknown result type (might be due to invalid IL or missing references)
			//IL_074c: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0863: Unknown result type (might be due to invalid IL or missing references)
			//IL_0877: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0910: Unknown result type (might be due to invalid IL or missing references)
			//IL_099e: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a30: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0caa: Unknown result type (might be due to invalid IL or missing references)
			StyleDefinition styleDefinition = new StyleDefinition();
			switch (style)
			{
			case BeamStyle.ShinGodzilla:
				styleDefinition.Look.Wobble = 1.2f;
				styleDefinition.Look.Spirals = 0.6f;
				styleDefinition.Look.Lightning = 1f;
				styleDefinition.Look.PulseAmount = 0.25f;
				styleDefinition.Look.PulseHz = 3f;
				break;
			case BeamStyle.GiganEyeLasers:
				Set(styleDefinition, new Color(1f, 0.9f, 0.9f), new Color(1f, 0.05f, 0.05f), 0.3f, 1.7f, 0.4f);
				styleDefinition.Emitters = EmitterOverride.Eyes;
				styleDefinition.Look.Wobble = 0.12f;
				styleDefinition.Look.Spirals = 0f;
				styleDefinition.Look.Lightning = 0.3f;
				styleDefinition.Look.PulseAmount = 0.15f;
				styleDefinition.Look.PulseHz = 8f;
				break;
			case BeamStyle.Mechagodzilla:
				Set(styleDefinition, new Color(0.9f, 1f, 1f), new Color(0.2f, 0.75f, 1f), 0.9f, 1.3f, 0.8f);
				styleDefinition.Look.Wobble = 0.3f;
				styleDefinition.Look.Spirals = 0.5f;
				styleDefinition.Look.Lightning = 1.6f;
				styleDefinition.Look.Stutter = 0.6f;
				styleDefinition.Look.PulseAmount = 0.5f;
				styleDefinition.Look.PulseHz = 6f;
				break;
			case BeamStyle.KingGhidorah:
				Set(styleDefinition, new Color(1f, 1f, 0.85f), new Color(1f, 0.8f, 0.1f), 0.7f, 1.2f, 0.9f);
				styleDefinition.Emitters = EmitterOverride.ThreeHeads;
				styleDefinition.Look.Wobble = 0.4f;
				styleDefinition.Look.Spirals = 0f;
				styleDefinition.Look.Lightning = 2f;
				styleDefinition.Look.ZigZag = 1f;
				break;
			case BeamStyle.SpaceGodzilla:
				Set(styleDefinition, new Color(1f, 0.85f, 1f), new Color(0.6f, 0.1f, 1f), 1.3f, 1.4f, 1.2f);
				styleDefinition.Look.Wobble = 1.5f;
				styleDefinition.Look.Spirals = 1.4f;
				styleDefinition.Look.Lightning = 2f;
				styleDefinition.Look.PulseAmount = 0.4f;
				styleDefinition.Look.PulseHz = 2f;
				break;
			case BeamStyle.Destoroyah:
				Set(styleDefinition, new Color(1f, 0.85f, 0.9f), new Color(0.75f, 0.05f, 0.35f), 1.5f, 1.3f, 1.3f);
				styleDefinition.Look.Wobble = 1.8f;
				styleDefinition.Look.Spirals = 0.8f;
				styleDefinition.Look.Lightning = 0.8f;
				styleDefinition.Look.PulseAmount = 0.3f;
				styleDefinition.Look.PulseHz = 2f;
				break;
			case BeamStyle.HeiseiSpiralRay:
				Set(styleDefinition, new Color(1f, 0.95f, 0.85f), new Color(1f, 0.2f, 0.05f), 1.2f, 1.5f, 1.4f);
				styleDefinition.Look.Wobble = 0.6f;
				styleDefinition.Look.Spirals = 2.2f;
				styleDefinition.Look.Lightning = 1f;
				styleDefinition.Look.PulseAmount = 0.3f;
				styleDefinition.Look.PulseHz = 3f;
				break;
			case BeamStyle.Biollante:
				Set(styleDefinition, new Color(0.9f, 1f, 0.8f), new Color(0.3f, 1f, 0.15f), 1.4f, 0.9f, 1f);
				styleDefinition.Look.Wobble = 2.5f;
				styleDefinition.Look.Spirals = 0.3f;
				styleDefinition.Look.Lightning = 0.2f;
				styleDefinition.Look.PulseAmount = 0.6f;
				styleDefinition.Look.PulseHz = 3f;
				break;
			case BeamStyle.LegendaryGodzilla:
				Set(styleDefinition, new Color(0.9f, 1f, 1f), new Color(0.15f, 0.55f, 1f), 1.1f, 1.5f, 1.6f);
				styleDefinition.Look.Wobble = 0.8f;
				styleDefinition.Look.Spirals = 1f;
				styleDefinition.Look.Lightning = 1.2f;
				styleDefinition.Look.PulseAmount = 0.8f;
				styleDefinition.Look.PulseHz = 4f;
				break;
			case BeamStyle.BurningGodzilla:
				Set(styleDefinition, new Color(1f, 0.95f, 0.8f), new Color(1f, 0.22f, 0.04f), 1.35f, 1.7f, 1.1f);
				styleDefinition.Look.Wobble = 1.3f;
				styleDefinition.Look.Spirals = 1.6f;
				styleDefinition.Look.Lightning = 1.4f;
				styleDefinition.Look.PulseAmount = 0.5f;
				styleDefinition.Look.PulseHz = 3f;
				break;
			case BeamStyle.GodzillaMinusOne:
				Set(styleDefinition, new Color(0.95f, 0.98f, 1f), new Color(0.2f, 0.5f, 1f), 0.95f, 1.9f, 1.9f);
				styleDefinition.Look.Wobble = 0.45f;
				styleDefinition.Look.Spirals = 0.3f;
				styleDefinition.Look.Lightning = 1.6f;
				styleDefinition.Look.PulseAmount = 0.9f;
				styleDefinition.Look.PulseHz = 5f;
				break;
			case BeamStyle.GodzillaEarth:
				Set(styleDefinition, new Color(0.9f, 0.85f, 1f), new Color(0.35f, 0.2f, 1f), 0.45f, 2.1f, 1.4f);
				styleDefinition.Look.Wobble = 0.1f;
				styleDefinition.Look.Spirals = 0f;
				styleDefinition.Look.Lightning = 2.5f;
				styleDefinition.Look.Stutter = 0.2f;
				styleDefinition.Look.PulseAmount = 0.3f;
				styleDefinition.Look.PulseHz = 9f;
				break;
			case BeamStyle.Mothra:
				Set(styleDefinition, new Color(0.9f, 1f, 0.9f), new Color(0.2f, 1f, 0.5f), 0.35f, 1.25f, 0.6f);
				styleDefinition.Emitters = EmitterOverride.Eyes;
				styleDefinition.Look.Wobble = 0.2f;
				styleDefinition.Look.Spirals = 0f;
				styleDefinition.Look.Lightning = 0.5f;
				styleDefinition.Look.PulseAmount = 0.3f;
				styleDefinition.Look.PulseHz = 10f;
				break;
			case BeamStyle.FireRodan:
				Set(styleDefinition, new Color(1f, 0.9f, 1f), new Color(0.8f, 0.2f, 1f), 0.8f, 1.3f, 0.9f);
				styleDefinition.Look.Wobble = 1f;
				styleDefinition.Look.Spirals = 0.8f;
				styleDefinition.Look.Lightning = 1.2f;
				styleDefinition.Look.PulseAmount = 0.35f;
				styleDefinition.Look.PulseHz = 2.5f;
				break;
			case BeamStyle.Hedorah:
				Set(styleDefinition, new Color(1f, 0.8f, 0.7f), new Color(0.9f, 0.1f, 0.05f), 0.4f, 1.3f, 0.7f);
				styleDefinit