Decompiled source of MonsterLabZ v3.0.9

plugins/MonsterLabZ/MonsterLabZ.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CreatureManager;
using HarmonyLib;
using ItemManager;
using JetBrains.Annotations;
using LocalizationManager;
using LocationManager;
using Microsoft.CodeAnalysis;
using SoftReferenceableAssets;
using TMPro;
using UnityEngine;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Core.Tokens;
using YamlDotNet.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.Converters;
using YamlDotNet.Serialization.EventEmitters;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization.NodeDeserializers;
using YamlDotNet.Serialization.NodeTypeResolvers;
using YamlDotNet.Serialization.ObjectFactories;
using YamlDotNet.Serialization.ObjectGraphTraversalStrategies;
using YamlDotNet.Serialization.ObjectGraphVisitors;
using YamlDotNet.Serialization.Schemas;
using YamlDotNet.Serialization.TypeInspectors;
using YamlDotNet.Serialization.TypeResolvers;
using YamlDotNet.Serialization.Utilities;
using YamlDotNet.Serialization.ValueDeserializers;

[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Guid("150BFDAF-FF35-4302-B7CC-BEDCE69118D5")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyProduct("MonsterLabZ")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("https://valheim.thunderstore.io/package/MonsterLabZ/MonsterLabZ")]
[assembly: AssemblyTitle("MonsterLabZ")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[<ff648590-8803-4818-8ade-4f2cde93812a>Embedded]
	internal sealed class <ff648590-8803-4818-8ade-4f2cde93812a>EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	[<ff648590-8803-4818-8ade-4f2cde93812a>Embedded]
	[CompilerGenerated]
	internal sealed class <d23ff2c1-30f6-4034-927f-9061f7d45c78>NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public <d23ff2c1-30f6-4034-927f-9061f7d45c78>NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public <d23ff2c1-30f6-4034-927f-9061f7d45c78>NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[<ff648590-8803-4818-8ade-4f2cde93812a>Embedded]
	[CompilerGenerated]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class <902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public <902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace MonsterLabz
{
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	public class DeepSeaCreature : MonoBehaviour, IWaterInteractable
	{
		public float m_height = 0.2f;

		private readonly int[] m_liquids = new int[2];

		private MonsterAI m_avoidLand;

		private Rigidbody m_body;

		private Humanoid m_canSwim;

		private Humanoid m_flying;

		private float m_inWater = 27f;

		private LiquidSurface m_liquidSurface;

		private LODGroup m_lodGroup;

		private bool m_lodVisible = true;

		private ZNetView m_nview;

		private Vector3 m_originalLocalRef;

		private float m_waterDepth;

		private WaterVolume m_waterVolume;

		private void Awake()
		{
			m_nview = ((Component)this).GetComponent<ZNetView>();
			m_body = ((Component)this).GetComponent<Rigidbody>();
			m_flying = ((Component)this).GetComponent<Humanoid>();
			m_canSwim = ((Component)this).GetComponent<Humanoid>();
			m_avoidLand = ((Component)this).GetComponent<MonsterAI>();
			m_waterVolume = WaterVolume.Instances.FirstOrDefault();
		}

		private void Start()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			m_waterDepth = m_waterVolume.Depth(((Component)this).transform.position);
		}

		public string DebugInformation(WaterVolume waterVolume)
		{
			StringBuilder stringBuilder = new StringBuilder();
			Type type = ((object)waterVolume).GetType();
			float[] array = (float[])type.GetField("m_normalizedDepth", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(waterVolume);
			stringBuilder.AppendLine($"m_normalizedDepth: {array?.Length}");
			if (array != null && array.Length != 0)
			{
				stringBuilder.AppendLine("->\tValues: " + string.Join(",", array) + "\n");
			}
			stringBuilder.AppendLine(string.Format("{0}: {1}", "m_heightmap", waterVolume.m_heightmap));
			stringBuilder.AppendLine(string.Format("{0}: {1}", "m_forceDepth", waterVolume.m_forceDepth));
			stringBuilder.AppendLine(string.Format("{0}: {1}", "m_surfaceOffset", waterVolume.m_surfaceOffset));
			stringBuilder.AppendLine(string.Format("{0}: {1}", "m_useGlobalWind", waterVolume.m_useGlobalWind));
			return stringBuilder.ToString();
		}

		private void FixedUpdate()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			if ((double)m_inWater <= -10000.0 || (double)m_inWater < (double)((Component)this).transform.position.y + (double)m_height)
			{
				m_body.useGravity = true;
				((Character)m_flying).m_flying = false;
				m_avoidLand.m_avoidLand = true;
				((Character)m_canSwim).m_canSwim = true;
				if (CustomIsOutOfWater())
				{
					return;
				}
			}
			else
			{
				m_body.useGravity = false;
			}
			((Character)m_flying).m_flying = true;
			m_avoidLand.m_avoidLand = false;
			((Character)m_canSwim).m_canSwim = false;
			if ((Object)(object)m_waterVolume != (Object)null && !CustomIsOutOfWater())
			{
			}
		}

		public void SetLiquidLevel(float level, LiquidType type, Component liquidObj)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			if ((int)type == 0)
			{
				m_inWater = level;
			}
			m_liquidSurface = null;
			m_waterVolume = null;
			WaterVolume val = (WaterVolume)(object)((liquidObj is WaterVolume) ? liquidObj : null);
			if (val == null)
			{
				LiquidSurface val2 = (LiquidSurface)(object)((liquidObj is LiquidSurface) ? liquidObj : null);
				if (val2 != null)
				{
					m_liquidSurface = val2;
				}
			}
			else
			{
				m_waterVolume = val;
			}
		}

		public Transform GetTransform()
		{
			return ((Object)(object)this == (Object)null) ? null : ((Component)this).transform;
		}

		public int Increment(LiquidType type)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return ++m_liquids[type];
		}

		public int Decrement(LiquidType type)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return --m_liquids[type];
		}

		public bool CustomIsOutOfWater()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return (double)m_inWater < (double)((Component)this).transform.position.y - (double)m_height;
		}

		protected void SetVisible(bool visible)
		{
			//IL_005b: 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)
			if (!((Object)(object)m_lodGroup == (Object)null) && m_lodVisible != visible)
			{
				m_lodVisible = visible;
				if (m_lodVisible)
				{
					m_lodGroup.localReferencePoint = m_originalLocalRef;
				}
				else
				{
					m_lodGroup.localReferencePoint = new Vector3(999999f, 999999f, 999999f);
				}
			}
		}
	}
}
namespace MonsterLabZ
{
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class Ship : MonoBehaviour
	{
		[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(0)]
		public enum Speed
		{
			Stop,
			Back,
			Slow,
			Half,
			Full
		}

		private bool m_forwardPressed;

		private bool m_backwardPressed;

		private float m_sendRudderTime;

		private Vector3 windChangeVelocity = Vector3.zero;

		private bool sailWasInPosition;

		[Header("Objects")]
		public GameObject m_sailObject;

		public GameObject m_mastObject;

		public GameObject m_rudderObject;

		public ShipControlls m_shipControlls;

		public Transform m_controlGuiPos;

		[Header("Misc")]
		public BoxCollider m_floatCollider;

		public float m_waterLevelOffset;

		public float m_forceDistance = 1f;

		public float m_force = 0.5f;

		public float m_damping = 0.05f;

		public float m_dampingSideway = 0.05f;

		public float m_dampingForward = 0.01f;

		public float m_angularDamping = 0.01f;

		public float m_disableLevel = -0.5f;

		public float m_sailForceOffset;

		public float m_sailForceFactor = 0.1f;

		public float m_rudderSpeed = 0.5f;

		public float m_stearForceOffset = -10f;

		public float m_stearForce = 0.5f;

		public float m_stearVelForceFactor = 0.1f;

		public float m_backwardForce = 50f;

		public float m_rudderRotationMax = 30f;

		public float m_rudderRotationSpeed = 30f;

		public float m_minWaterImpactForce = 2.5f;

		public float m_minWaterImpactInterval = 2f;

		public float m_waterImpactDamage = 10f;

		public float m_upsideDownDmgInterval = 1f;

		public float m_upsideDownDmg = 20f;

		public EffectList m_waterImpactEffect = new EffectList();

		private Speed m_speed;

		private float m_rudder;

		private float m_rudderValue;

		private Vector3 m_sailForce = Vector3.zero;

		private List<BaseAI> m_players = new List<BaseAI>();

		private static List<Ship> m_currentShips = new List<Ship>();

		private Rigidbody m_body;

		private ZNetView m_nview;

		private Cloth m_sailCloth;

		private float m_lastDepth = -9999f;

		private float m_lastWaterImpactTime;

		private float m_upsideDownDmgTimer;

		private float m_rudderPaddleTimer;

		private void Awake()
		{
			m_nview = ((Component)this).GetComponent<ZNetView>();
			m_body = ((Component)this).GetComponent<Rigidbody>();
			Humanoid component = ((Component)this).GetComponent<Humanoid>();
			if (Object.op_Implicit((Object)(object)component))
			{
				((Character)component).m_onDeath = (Action)Delegate.Combine(((Character)component).m_onDeath, new Action(OnDestroyed));
			}
			if (m_nview.GetZDO() == null)
			{
				((Behaviour)this).enabled = false;
			}
			m_body.maxDepenetrationVelocity = 2f;
			Heightmap.ForceGenerateAll();
			m_sailCloth = m_sailObject.GetComponentInChildren<Cloth>();
		}

		public bool CanBeRemoved()
		{
			return m_players.Count > 0;
		}

		private void Start()
		{
			m_nview.Register("Stop", (Action<long>)RPC_Stop);
			m_nview.Register("Forward", (Action<long>)RPC_Forward);
			m_nview.Register("Backward", (Action<long>)RPC_Backward);
			m_nview.Register<float>("Rudder", (Action<long, float>)RPC_Rudder);
			((MonoBehaviour)this).InvokeRepeating("UpdateOwner", 2f, 2f);
		}

		private void PrintStats()
		{
			//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)
			if (m_players.Count != 0)
			{
				Vector3 velocity = m_body.velocity;
				ZLog.Log((object)("Vel:" + ((Vector3)(ref velocity)).magnitude.ToString("0.0")));
			}
		}

		public void ApplyControlls(Vector3 dir)
		{
			//IL_0001: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			bool flag = (double)dir.z > 0.5;
			bool flag2 = (double)dir.z < -0.5;
			if (flag && !m_forwardPressed)
			{
				Forward();
			}
			if (flag2 && !m_backwardPressed)
			{
				Backward();
			}
			float fixedDeltaTime = Time.fixedDeltaTime;
			float num = Mathf.Lerp(0.5f, 1f, Mathf.Abs(m_rudderValue));
			m_rudder = dir.x * num;
			m_rudderValue += m_rudder * m_rudderSpeed * fixedDeltaTime;
			m_rudderValue = Mathf.Clamp(m_rudderValue, -1f, 1f);
			if ((double)Time.time - (double)m_sendRudderTime > 0.20000000298023224)
			{
				m_sendRudderTime = Time.time;
				m_nview.InvokeRPC("Rudder", new object[1] { m_rudderValue });
			}
			m_forwardPressed = flag;
			m_backwardPressed = flag2;
		}

		public void Forward()
		{
			m_nview.InvokeRPC("Forward", Array.Empty<object>());
		}

		public void Backward()
		{
			m_nview.InvokeRPC("Backward", Array.Empty<object>());
		}

		public void Rudder(float rudder)
		{
			((MonoBehaviour)m_nview).Invoke("Rudder", rudder);
		}

		private void RPC_Rudder(long sender, float value)
		{
			m_rudderValue = value;
		}

		public void Stop()
		{
			m_nview.InvokeRPC("Stop", Array.Empty<object>());
		}

		private void RPC_Stop(long sender)
		{
			m_speed = Speed.Stop;
		}

		private void RPC_Forward(long sender)
		{
			switch (m_speed)
			{
			case Speed.Stop:
				m_speed = Speed.Slow;
				break;
			case Speed.Back:
				m_speed = Speed.Stop;
				break;
			case Speed.Slow:
				m_speed = Speed.Half;
				break;
			case Speed.Half:
				m_speed = Speed.Full;
				break;
			}
		}

		private void RPC_Backward(long sender)
		{
			switch (m_speed)
			{
			case Speed.Stop:
				m_speed = Speed.Back;
				break;
			case Speed.Slow:
				m_speed = Speed.Stop;
				break;
			case Speed.Half:
				m_speed = Speed.Slow;
				break;
			case Speed.Full:
				m_speed = Speed.Half;
				break;
			case Speed.Back:
				break;
			}
		}

		private void FixedUpdate()
		{
			//IL_0082: 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_0093: 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_00ae: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: 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_00e8: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: 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_014c: 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_0163: 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_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: 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_019e: 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_01b6: 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)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: 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_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0405: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_0443: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0510: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0535: Unknown result type (might be due to invalid IL or missing references)
			//IL_05be: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0600: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_0622: Unknown result type (might be due to invalid IL or missing references)
			//IL_0629: Unknown result type (might be due to invalid IL or missing references)
			//IL_0630: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_067e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_068a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0695: Unknown result type (might be due to invalid IL or missing references)
			//IL_069a: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0700: Unknown result type (might be due to invalid IL or missing references)
			//IL_0709: Unknown result type (might be due to invalid IL or missing references)
			//IL_070e: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0732: Unknown result type (might be due to invalid IL or missing references)
			//IL_0737: Unknown result type (might be due to invalid IL or missing references)
			//IL_0742: Unknown result type (might be due to invalid IL or missing references)
			//IL_0758: Unknown result type (might be due to invalid IL or missing references)
			//IL_075d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0762: Unknown result type (might be due to invalid IL or missing references)
			//IL_0766: Unknown result type (might be due to invalid IL or missing references)
			//IL_076e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_078f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0794: Unknown result type (might be due to invalid IL or missing references)
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_0809: Unknown result type (might be due to invalid IL or missing references)
			//IL_080d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0800: Unknown result type (might be due to invalid IL or missing references)
			UpdateControlls(Time.fixedDeltaTime);
			UpdateSail(Time.fixedDeltaTime);
			if (Object.op_Implicit((Object)(object)m_nview) && !m_nview.IsOwner())
			{
				return;
			}
			UpdateUpsideDmg(Time.fixedDeltaTime);
			if (m_players.Count == 0)
			{
				m_speed = Speed.Full;
				m_rudderValue = 0f;
			}
			float num = 1f;
			Vector3 worldCenterOfMass = m_body.worldCenterOfMass;
			Vector3 val = ((Component)m_floatCollider).transform.position + ((Component)m_floatCollider).transform.forward * m_floatCollider.size.z / 2f;
			Vector3 val2 = ((Component)m_floatCollider).transform.position - ((Component)m_floatCollider).transform.forward * m_floatCollider.size.z / 2f;
			Vector3 val3 = ((Component)m_floatCollider).transform.position - ((Component)m_floatCollider).transform.right * m_floatCollider.size.x / 2f;
			Vector3 val4 = ((Component)m_floatCollider).transform.position + ((Component)m_floatCollider).transform.right * m_floatCollider.size.x / 2f;
			double num2 = Floating.GetLiquidLevel(worldCenterOfMass, num, (LiquidType)10);
			float liquidLevel = Floating.GetLiquidLevel(val3, num, (LiquidType)10);
			float liquidLevel2 = Floating.GetLiquidLevel(val4, num, (LiquidType)10);
			float liquidLevel3 = Floating.GetLiquidLevel(val, num, (LiquidType)10);
			float liquidLevel4 = Floating.GetLiquidLevel(val2, num, (LiquidType)10);
			double num3 = liquidLevel;
			float num4 = (float)((num2 + num3 + (double)liquidLevel2 + (double)liquidLevel3 + (double)liquidLevel4) / 5.0);
			float num5 = worldCenterOfMass.y - num4 - m_waterLevelOffset;
			if (!((double)num5 > (double)m_disableLevel))
			{
				m_body.WakeUp();
				UpdateWaterForce(num5, Time.fixedDeltaTime);
				Vector3 val5 = default(Vector3);
				((Vector3)(ref val5))..ctor(val3.x, liquidLevel, val3.z);
				Vector3 val6 = default(Vector3);
				((Vector3)(ref val6))..ctor(val4.x, liquidLevel2, val4.z);
				Vector3 val7 = default(Vector3);
				((Vector3)(ref val7))..ctor(val.x, liquidLevel3, val.z);
				Vector3 val8 = default(Vector3);
				((Vector3)(ref val8))..ctor(val2.x, liquidLevel4, val2.z);
				float fixedDeltaTime = Time.fixedDeltaTime;
				float num6 = fixedDeltaTime * 50f;
				float num7 = Mathf.Clamp01(Mathf.Abs(num5) / m_forceDistance);
				m_body.AddForceAtPosition(Vector3.up * m_force * num7 * num6, worldCenterOfMass, (ForceMode)2);
				float num8 = Vector3.Dot(m_body.velocity, ((Component)this).transform.forward);
				float num9 = Vector3.Dot(m_body.velocity, ((Component)this).transform.right);
				Vector3 velocity = m_body.velocity;
				float num10 = velocity.y * velocity.y * Mathf.Sign(velocity.y) * m_damping * num7;
				float num11 = num8 * num8 * Mathf.Sign(num8) * m_dampingForward * num7;
				float num12 = num9 * num9 * Mathf.Sign(num9) * m_dampingSideway * num7;
				velocity.y -= Mathf.Clamp(num10, -1f, 1f);
				Vector3 velocity2 = velocity - ((Component)this).transform.forward * Mathf.Clamp(num11, -1f, 1f) - ((Component)this).transform.right * Mathf.Clamp(num12, -1f, 1f);
				double num13 = ((Vector3)(ref velocity2)).magnitude;
				Vector3 velocity3 = m_body.velocity;
				double num14 = ((Vector3)(ref velocity3)).magnitude;
				if (num13 > num14)
				{
					Vector3 normalized = ((Vector3)(ref velocity2)).normalized;
					velocity3 = m_body.velocity;
					double num15 = ((Vector3)(ref velocity3)).magnitude;
					velocity2 = normalized * (float)num15;
				}
				if (m_players.Count < 0)
				{
					velocity2.x *= 0.1f;
					velocity2.z *= 0.1f;
				}
				m_body.velocity = velocity2;
				Rigidbody body = m_body;
				body.angularVelocity -= m_body.angularVelocity * m_angularDamping * num7;
				float num16 = 0.15f;
				float num17 = 0.5f;
				float num18 = Mathf.Clamp((val7.y - val.y) * num16, 0f - num17, num17);
				float num19 = Mathf.Clamp((val8.y - val2.y) * num16, 0f - num17, num17);
				float num20 = Mathf.Clamp((val5.y - val3.y) * num16, 0f - num17, num17);
				float num21 = Mathf.Clamp((val6.y - val4.y) * num16, 0f - num17, num17);
				float num22 = Mathf.Sign(num18) * Mathf.Abs(Mathf.Pow(num18, 2f));
				float num23 = Mathf.Sign(num19) * Mathf.Abs(Mathf.Pow(num19, 2f));
				float num24 = Mathf.Sign(num20) * Mathf.Abs(Mathf.Pow(num20, 2f));
				float num25 = Mathf.Sign(num21) * Mathf.Abs(Mathf.Pow(num21, 2f));
				m_body.AddForceAtPosition(Vector3.up * num22 * num6, val, (ForceMode)2);
				m_body.AddForceAtPosition(Vector3.up * num23 * num6, val2, (ForceMode)2);
				m_body.AddForceAtPosition(Vector3.up * num24 * num6, val3, (ForceMode)2);
				m_body.AddForceAtPosition(Vector3.up * num25 * num6, val4, (ForceMode)2);
				float sailSize = 0f;
				if (m_speed == Speed.Full)
				{
					sailSize = 1f;
				}
				else if (m_speed == Speed.Half)
				{
					sailSize = 0.5f;
				}
				m_body.AddForceAtPosition(GetSailForce(sailSize, fixedDeltaTime), worldCenterOfMass + ((Component)this).transform.up * m_sailForceOffset, (ForceMode)2);
				Vector3 val9 = ((Component)this).transform.position + ((Component)this).transform.forward * m_stearForceOffset;
				m_body.AddForceAtPosition(((Component)this).transform.right * (num8 * m_stearVelForceFactor) * (0f - m_rudderValue) * fixedDeltaTime, val9, (ForceMode)2);
				Vector3 val10 = Vector3.zero;
				switch (m_speed)
				{
				case Speed.Back:
					val10 += -((Component)this).transform.forward * m_backwardForce * (1f - Mathf.Abs(m_rudderValue));
					break;
				case Speed.Slow:
					val10 += ((Component)this).transform.forward * m_backwardForce * (1f - Mathf.Abs(m_rudderValue));
					break;
				}
				if (m_speed == Speed.Back || m_speed == Speed.Slow)
				{
					float num26 = ((m_speed == Speed.Back) ? (-1f) : 1f);
					val10 += ((Component)this).transform.right * m_stearForce * (0f - m_rudderValue) * num26;
				}
				m_body.AddForceAtPosition(val10 * fixedDeltaTime, val9, (ForceMode)2);
				ApplyEdgeForce(Time.fixedDeltaTime);
			}
		}

		private void UpdateUpsideDmg(float dt)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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)
			//IL_00a1: Expected O, but got Unknown
			if ((double)((Component)this).transform.up.y >= 0.0)
			{
				return;
			}
			m_upsideDownDmgTimer += dt;
			if (!((double)m_upsideDownDmgTimer <= (double)m_upsideDownDmgInterval))
			{
				m_upsideDownDmgTimer = 0f;
				IDestructible component = ((Component)this).GetComponent<IDestructible>();
				if (component != null)
				{
					component.Damage(new HitData
					{
						m_damage = 
						{
							m_blunt = m_upsideDownDmg
						},
						m_point = ((Component)this).transform.position,
						m_dir = Vector3.up
					});
				}
			}
		}

		private Vector3 GetSailForce(float sailSize, float dt)
		{
			//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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_007a: 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_0085: 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)
			Vector3 windDir = EnvMan.instance.GetWindDir();
			float num = Mathf.Lerp(0.25f, 1f, EnvMan.instance.GetWindIntensity());
			float num2 = GetWindAngleFactor() * num;
			Vector3 forward = ((Component)this).transform.forward;
			m_sailForce = Vector3.SmoothDamp(m_sailForce, Vector3.Normalize(windDir + forward) * num2 * m_sailForceFactor * sailSize, ref windChangeVelocity, 1f, 99f);
			return m_sailForce;
		}

		public float GetWindAngleFactor()
		{
			//IL_0006: 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)
			float num = Vector3.Dot(EnvMan.instance.GetWindDir(), -((Component)this).transform.forward);
			return Mathf.Lerp(0.7f, 1f, 1f - Mathf.Abs(num)) * (1f - Utils.LerpStep(0.75f, 0.8f, num));
		}

		private void UpdateWaterForce(float depth, float dt)
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: 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: Expected O, but got Unknown
			if ((double)m_lastDepth == -9999.0)
			{
				m_lastDepth = depth;
				return;
			}
			double num = (double)depth - (double)m_lastDepth;
			m_lastDepth = depth;
			double num2 = dt;
			float num3 = (float)(num / num2);
			if ((double)num3 > 0.0 || (double)Mathf.Abs(num3) <= (double)m_minWaterImpactForce || (double)Time.time - (double)m_lastWaterImpactTime <= (double)m_minWaterImpactInterval)
			{
				return;
			}
			m_lastWaterImpactTime = Time.time;
			m_waterImpactEffect.Create(((Component)this).transform.position, ((Component)this).transform.rotation, (Transform)null, 1f, -1);
			if (m_players.Count > 0)
			{
				IDestructible component = ((Component)this).GetComponent<IDestructible>();
				if (component != null)
				{
					component.Damage(new HitData
					{
						m_damage = 
						{
							m_blunt = m_waterImpactDamage
						},
						m_point = ((Component)this).transform.position,
						m_dir = Vector3.up
					});
				}
			}
		}

		private void ApplyEdgeForce(float dt)
		{
			//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_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_0052: 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)
			Vector3 position = ((Component)this).transform.position;
			float magnitude = ((Vector3)(ref position)).magnitude;
			float num = 10420f;
			if (!((double)magnitude <= (double)num))
			{
				m_body.AddForce(Vector3.Normalize(((Component)this).transform.position) * (Utils.LerpStep(num, 10500f, magnitude) * 8f) * dt, (ForceMode)2);
			}
		}

		private void FixTilt()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_012b: 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_00f5: 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)
			float num = Mathf.Asin(((Component)this).transform.right.y);
			float num2 = Mathf.Asin(((Component)this).transform.forward.y);
			if ((double)Mathf.Abs(num) > 0.5235987901687622)
			{
				if ((double)num > 0.0)
				{
					((Component)this).transform.RotateAround(((Component)this).transform.position, ((Component)this).transform.forward, (float)((0.0 - (double)Time.fixedDeltaTime) * 20.0));
				}
				else
				{
					((Component)this).transform.RotateAround(((Component)this).transform.position, ((Component)this).transform.forward, Time.fixedDeltaTime * 20f);
				}
			}
			if (!((double)Mathf.Abs(num2) <= 0.5235987901687622))
			{
				if ((double)num2 > 0.0)
				{
					((Component)this).transform.RotateAround(((Component)this).transform.position, ((Component)this).transform.right, (float)((0.0 - (double)Time.fixedDeltaTime) * 20.0));
				}
				else
				{
					((Component)this).transform.RotateAround(((Component)this).transform.position, ((Component)this).transform.right, Time.fixedDeltaTime * 20f);
				}
			}
		}

		private void UpdateControlls(float dt)
		{
			if (m_nview.IsOwner())
			{
				m_nview.GetZDO().Set("forward", (int)m_speed);
				m_nview.GetZDO().Set("rudder", m_rudderValue);
				return;
			}
			m_speed = (Speed)m_nview.GetZDO().GetInt("forward", 0);
			if (!((double)Time.time - (double)m_sendRudderTime <= 1.0))
			{
				m_rudderValue = m_nview.GetZDO().GetFloat("rudder", 0f);
			}
		}

		public bool IsSailUp()
		{
			return m_speed == Speed.Half || m_speed == Speed.Full;
		}

		private void UpdateSail(float dt)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: 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_0095: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			UpdateSailSize(dt);
			Vector3 val = Vector3.Cross(Vector3.Cross(EnvMan.instance.GetWindDir(), ((Component)this).transform.up), ((Component)this).transform.up);
			if (m_speed == Speed.Full || m_speed == Speed.Half)
			{
				float num = (float)(0.5 + (double)Vector3.Dot(((Component)this).transform.forward, val) * 0.5);
				m_mastObject.transform.rotation = Quaternion.RotateTowards(m_mastObject.transform.rotation, Quaternion.LookRotation(-Vector3.Lerp(val, Vector3.Normalize(val - ((Component)this).transform.forward), num), ((Component)this).transform.up), 30f * dt);
			}
			else if (m_speed == Speed.Back)
			{
				m_mastObject.transform.rotation = Quaternion.RotateTowards(m_mastObject.transform.rotation, Quaternion.RotateTowards(Quaternion.LookRotation(-((Component)this).transform.forward, ((Component)this).transform.up), Quaternion.LookRotation(-val, ((Component)this).transform.up), 80f), 30f * dt);
			}
		}

		private void UpdateRudder(float dt, bool HasPlayerOnboard)
		{
			//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_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_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00a9: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)m_rudderObject))
			{
				return;
			}
			Quaternion val = Quaternion.Euler(0f, m_rudderRotationMax * (0f - m_rudderValue), 0f);
			if (HasPlayerOnboard)
			{
				if (m_speed == Speed.Full)
				{
					m_rudderPaddleTimer += dt;
					val *= Quaternion.Euler(0f, Mathf.Sin(m_rudderPaddleTimer * 6f) * 20f, 0f);
				}
				else if (m_speed == Speed.Back)
				{
					m_rudderPaddleTimer += dt;
					val *= Quaternion.Euler(0f, Mathf.Sin(m_rudderPaddleTimer * -3f) * 40f, 0f);
				}
			}
			m_rudderObject.transform.localRotation = Quaternion.Slerp(m_rudderObject.transform.localRotation, val, 0.5f);
		}

		private void UpdateSailSize(float dt)
		{
			//IL_0061: 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_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			float num = 0f;
			switch (m_speed)
			{
			case Speed.Stop:
				num = 0.1f;
				break;
			case Speed.Back:
				num = 0.1f;
				break;
			case Speed.Slow:
				num = 0.1f;
				break;
			case Speed.Half:
				num = 0.5f;
				break;
			case Speed.Full:
				num = 1f;
				break;
			}
			Vector3 localScale = m_sailObject.transform.localScale;
			bool flag = (double)Mathf.Abs(localScale.y - num) < 0.009999999776482582;
			if (!flag)
			{
				localScale.y = Mathf.MoveTowards(localScale.y, num, dt);
				m_sailObject.transform.localScale = localScale;
			}
			if (Object.op_Implicit((Object)(object)m_sailCloth))
			{
				if (m_speed == Speed.Stop || m_speed == Speed.Slow || m_speed == Speed.Back)
				{
					if (flag && m_sailCloth.enabled)
					{
						m_sailCloth.enabled = false;
					}
				}
				else if (flag)
				{
					if (!sailWasInPosition)
					{
						m_sailCloth.enabled = false;
						m_sailCloth.enabled = true;
					}
				}
				else
				{
					m_sailCloth.enabled = true;
				}
			}
			sailWasInPosition = flag;
		}

		private void OnTriggerEnter(Collider collider)
		{
			BaseAI component = ((Component)collider).GetComponent<BaseAI>();
			if (Object.op_Implicit((Object)(object)component))
			{
				m_players.Add(component);
				if ((Object)(object)component == (Object)(object)((Component)this).gameObject.GetComponent<BaseAI>())
				{
					m_currentShips.Add(this);
				}
			}
		}

		private void OnTriggerExit(Collider collider)
		{
			BaseAI component = ((Component)collider).GetComponent<BaseAI>();
			if (Object.op_Implicit((Object)(object)component))
			{
				m_players.Remove(component);
				if ((Object)(object)component == (Object)(object)((Component)this).gameObject.GetComponent<Humanoid>())
				{
					m_currentShips.Remove(this);
				}
			}
		}

		public bool IsPlayerInBoat(BaseAI baseAI)
		{
			return m_players.Contains(baseAI);
		}

		public bool HasPlayerOnboard()
		{
			return m_players.Count > 0;
		}

		private void OnDestroyed()
		{
			if (m_nview.IsValid() && m_nview.IsOwner())
			{
				m_currentShips.Remove(this);
			}
		}

		public static Ship GetLocalShip()
		{
			return (m_currentShips.Count == 0) ? null : m_currentShips[m_currentShips.Count - 1];
		}

		public bool HaveControllingPlayer()
		{
			return m_players.Count != 0 && m_shipControlls.HaveValidUser();
		}

		public bool IsOwner()
		{
			return m_nview.IsValid() && m_nview.IsOwner();
		}

		public float GetSpeed()
		{
			//IL_0006: 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)
			return Vector3.Dot(m_body.velocity, ((Component)this).transform.forward);
		}

		public Speed GetSpeedSetting()
		{
			return m_speed;
		}

		public float GetRudder()
		{
			return m_rudder;
		}

		public float GetRudderValue()
		{
			return m_rudderValue;
		}

		public float GetShipYawAngle()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			Camera mainCamera = Utils.GetMainCamera();
			return ((Object)(object)mainCamera == (Object)null) ? 0f : (0f - Utils.YawFromDirection(((Component)mainCamera).transform.InverseTransformDirection(((Component)this).transform.forward)));
		}

		public float GetWindAngle()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			return 0f - Utils.YawFromDirection(((Component)this).transform.InverseTransformDirection(EnvMan.instance.GetWindDir()));
		}

		private void OnDrawGizmosSelected()
		{
			//IL_0001: 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_001d: 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_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_0059: 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)
			Gizmos.color = Color.red;
			Gizmos.DrawWireSphere(((Component)this).transform.position + ((Component)this).transform.forward * m_stearForceOffset, 0.25f);
			Gizmos.color = Color.yellow;
			Gizmos.DrawWireSphere(((Component)this).transform.position + ((Component)this).transform.up * m_sailForceOffset, 0.25f);
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class AIShipEffects : MonoBehaviour
	{
		public Transform m_shadow;

		public float m_offset = 0.01f;

		public float m_minimumWakeVel = 5f;

		public GameObject m_speedWakeRoot;

		public GameObject m_wakeSoundRoot;

		public GameObject m_inWaterSoundRoot;

		public float m_audioFadeDuration = 2f;

		public AudioSource m_sailSound;

		public float m_sailFadeDuration = 1f;

		public GameObject m_splashEffects;

		private float m_sailBaseVol = 1f;

		private ParticleSystem[] m_wakeParticles;

		[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(new byte[] { 1, 0, 1 })]
		private List<KeyValuePair<AudioSource, float>> m_wakeSounds = new List<KeyValuePair<AudioSource, float>>();

		[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(new byte[] { 1, 0, 1 })]
		private List<KeyValuePair<AudioSource, float>> m_inWaterSounds = new List<KeyValuePair<AudioSource, float>>();

		private Rigidbody m_body;

		private Ship m_ship;

		private void Awake()
		{
			ZNetView componentInParent = ((Component)this).GetComponentInParent<ZNetView>();
			if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.GetZDO() == null)
			{
				((Behaviour)this).enabled = false;
				return;
			}
			m_body = ((Component)this).GetComponentInParent<Rigidbody>();
			m_ship = ((Component)this).GetComponentInParent<Ship>();
			if (Object.op_Implicit((Object)(object)m_speedWakeRoot))
			{
				m_wakeParticles = m_speedWakeRoot.GetComponentsInChildren<ParticleSystem>();
			}
			if (Object.op_Implicit((Object)(object)m_wakeSoundRoot))
			{
				AudioSource[] componentsInChildren = m_wakeSoundRoot.GetComponentsInChildren<AudioSource>();
				foreach (AudioSource val in componentsInChildren)
				{
					val.pitch = Random.Range(0.9f, 1.1f);
					m_wakeSounds.Add(new KeyValuePair<AudioSource, float>(val, val.volume));
				}
			}
			if (Object.op_Implicit((Object)(object)m_inWaterSoundRoot))
			{
				AudioSource[] componentsInChildren2 = m_inWaterSoundRoot.GetComponentsInChildren<AudioSource>();
				foreach (AudioSource val2 in componentsInChildren2)
				{
					val2.pitch = Random.Range(0.9f, 1.1f);
					m_inWaterSounds.Add(new KeyValuePair<AudioSource, float>(val2, val2.volume));
				}
			}
			if (Object.op_Implicit((Object)(object)m_sailSound))
			{
				m_sailBaseVol = m_sailSound.volume;
				m_sailSound.pitch = Random.Range(0.9f, 1.1f);
			}
		}

		private void LateUpdate()
		{
			//IL_0007: 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_0024: 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_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			float liquidLevel = Floating.GetLiquidLevel(((Component)this).transform.position, 1f, (LiquidType)10);
			Vector3 position = ((Component)this).transform.position;
			float deltaTime = Time.deltaTime;
			if ((double)position.y > (double)liquidLevel)
			{
				SetWake(enabled: false, deltaTime);
				FadeSounds(m_inWaterSounds, enabled: false, deltaTime);
				return;
			}
			Vector3 velocity = m_body.velocity;
			bool enabled = (double)((Vector3)(ref velocity)).magnitude > (double)m_minimumWakeVel;
			FadeSounds(m_inWaterSounds, enabled: true, deltaTime);
			SetWake(enabled, deltaTime);
			if (Object.op_Implicit((Object)(object)m_sailSound))
			{
				FadeSound(m_sailSound, m_ship.IsSailUp() ? m_sailBaseVol : 0f, m_sailFadeDuration, deltaTime);
			}
		}

		private void SetWake(bool enabled, float dt)
		{
			//IL_0013: 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)
			ParticleSystem[] wakeParticles = m_wakeParticles;
			foreach (ParticleSystem val in wakeParticles)
			{
				EmissionModule emission = val.emission;
				((EmissionModule)(ref emission)).enabled = enabled;
			}
			FadeSounds(m_wakeSounds, enabled, dt);
		}

		private void FadeSounds([<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(new byte[] { 1, 0, 1 })] List<KeyValuePair<AudioSource, float>> sources, bool enabled, float dt)
		{
			foreach (KeyValuePair<AudioSource, float> source in sources)
			{
				if (enabled)
				{
					FadeSound(source.Key, source.Value, m_audioFadeDuration, dt);
				}
				else
				{
					FadeSound(source.Key, 0f, m_audioFadeDuration, dt);
				}
			}
		}

		private void FadeSound(AudioSource source, float target, float fadeDuration, float dt)
		{
			float num = dt / fadeDuration;
			if ((double)target > 0.0)
			{
				if (!source.isPlaying)
				{
					source.Play();
				}
				source.volume = Mathf.MoveTowards(source.volume, target, num);
			}
			else if (source.isPlaying)
			{
				source.volume = Mathf.MoveTowards(source.volume, 0f, num);
				if (!((double)source.volume > 0.0))
				{
					source.Stop();
				}
			}
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public static class CommonResources
	{
		public static GameObject DwarfGoblinSpear;

		public static ItemData DwarfGoblinSpearData;

		public static void findCommonResources(ZNetScene ZNS)
		{
			DwarfGoblinSpear = ZNS.m_prefabs.Where([<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(0)] (GameObject p) => ((Object)p).name == "DwarfGoblinSpear").FirstOrDefault();
			DwarfGoblinSpearData = DwarfGoblinSpear.GetComponent<ItemDrop>().m_itemData;
		}
	}
	public class AmbienceSpawn : MonoBehaviour
	{
		private const float m_minPlayerDistance = 250f;

		private const float m_blockedMinTime = 4f;

		[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(1)]
		public GameObject m_AmbientPrefab;

		public float m_interval = 0.5f;

		private float m_lastSpawnTime;

		private float m_time;

		private void Start()
		{
			m_time = Random.Range(0f, m_interval);
		}

		private void Update()
		{
			m_time += Time.deltaTime;
			if (!((double)m_time <= (double)m_interval))
			{
				m_time = 0f;
				Spawn();
			}
		}

		private void Spawn()
		{
			//IL_0016: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			Player localPlayer = Player.m_localPlayer;
			if ((Object)(object)localPlayer == (Object)null || (double)Vector3.Distance(((Component)localPlayer).transform.position, ((Component)this).transform.position) > 250.0)
			{
				m_lastSpawnTime = Time.time;
				return;
			}
			Object.Instantiate<GameObject>(m_AmbientPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation);
			m_lastSpawnTime = Time.time;
		}
	}
	public class BillboardMove : MonoBehaviour
	{
		public float scrollSpeed = 0.5f;

		[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(1)]
		public Renderer rend;

		private void Start()
		{
			rend = ((Component)this).GetComponent<Renderer>();
		}

		private void Update()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			float num = Time.time * scrollSpeed;
			rend.material.SetTextureOffset("_MainTex", new Vector2(num, 0f));
		}
	}
	public class RotateTor : MonoBehaviour
	{
		public float TorRotationSpeed;

		private void Update()
		{
			//IL_000d: 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_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_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_003c: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			Quaternion val = Quaternion.AngleAxis(TorRotationSpeed * Time.deltaTime, Vector3.down);
			Quaternion val2 = Quaternion.AngleAxis(TorRotationSpeed * Time.deltaTime, Vector3.down);
			Transform transform = ((Component)this).transform;
			transform.rotation *= val;
			Transform transform2 = ((Component)this).transform;
			transform2.rotation *= val2;
		}
	}
	public class RotateTor1 : MonoBehaviour
	{
		public float TorRotationSpeed;

		private void Update()
		{
			//IL_000d: 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_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_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_003c: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			Quaternion val = Quaternion.AngleAxis(TorRotationSpeed * Time.deltaTime, Vector3.down);
			Quaternion val2 = Quaternion.AngleAxis(TorRotationSpeed * Time.deltaTime, Vector3.down);
			Transform transform = ((Component)this).transform;
			transform.rotation *= val;
			Transform transform2 = ((Component)this).transform;
			transform2.rotation *= val2;
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class SetTextureOffset : MonoBehaviour
	{
		public Vector2 offsetValue;

		public Renderer rend;

		private void Start()
		{
			rend = ((Component)this).GetComponent<Renderer>();
			((MonoBehaviour)this).StartCoroutine(MoveTheTexture());
		}

		private IEnumerator MoveTheTexture()
		{
			while (true)
			{
				yield return (object)new WaitForSeconds(5f);
				offsetValue = rend.material.GetTextureOffset("_MainTex");
				offsetValue.y += 1f / 3f;
				rend.material.SetTextureOffset("_MainTex", new Vector2(offsetValue.x, offsetValue.y));
			}
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class TorGravity : MonoBehaviour
	{
		public float ForceGN;

		public float BodyKf;

		private HashSet<Rigidbody> affectedBod = new HashSet<Rigidbody>();

		private Rigidbody componRigidbody;

		private void Start()
		{
			componRigidbody = ((Component)this).GetComponent<Rigidbody>();
		}

		private void OnTriggerEnter(Collider other)
		{
			if ((Object)(object)other.attachedRigidbody != (Object)null)
			{
				affectedBod.Add(other.attachedRigidbody);
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if ((Object)(object)other.attachedRigidbody != (Object)null)
			{
				affectedBod.Remove(other.attachedRigidbody);
			}
		}

		private void FixedUpdate()
		{
			//IL_001f: 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_002f: 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_003c: 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)
			//IL_006e: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			foreach (Rigidbody item in affectedBod)
			{
				Vector3 val = ((Component)this).transform.position - item.position;
				Vector3 val2 = ((Component)this).transform.position - item.position;
				float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude;
				float num = ForceGN * (item.mass - componRigidbody.mass) / sqrMagnitude;
				item.AddForce(val * num * BodyKf);
			}
		}
	}
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	public class TornadoGravity : MonoBehaviour
	{
		public float ForceG;

		public float BodyKoeff;

		public float OrbitSpeed;

		private HashSet<Rigidbody> affectedBodies = new HashSet<Rigidbody>();

		private Rigidbody componentRigidbody;

		private void Start()
		{
			componentRigidbody = ((Component)this).GetComponent<Rigidbody>();
		}

		private void OnTriggerEnter(Collider other)
		{
			if ((Object)(object)other.attachedRigidbody != (Object)null)
			{
				affectedBodies.Add(other.attachedRigidbody);
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if ((Object)(object)other.attachedRigidbody != (Object)null)
			{
				affectedBodies.Remove(other.attachedRigidbody);
			}
		}

		private void FixedUpdate()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_008a: 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)
			foreach (Rigidbody affectedBody in affectedBodies)
			{
				Vector3 val = ((Component)this).transform.position - affectedBody.position;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				val = ((Component)this).transform.position - affectedBody.position;
				float magnitude = ((Vector3)(ref val)).magnitude;
				float num = ForceG * affectedBody.mass * componentRigidbody.mass / (magnitude * magnitude);
				affectedBody.AddForce(normalized * num * BodyKoeff);
				((Component)affectedBody).transform.RotateAround(Vector3.zero, Vector3.down, 10f * OrbitSpeed * 120f);
			}
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class WaterSafing : MonoBehaviour
	{
		public float power;

		private void Start()
		{
		}

		private void Update()
		{
		}

		private void OnTriggerStay(Collider col)
		{
			//IL_0022: 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)
			if (((Component)col).tag == "Physical")
			{
				((Component)col).GetComponent<Rigidbody>().AddForce(((Component)this).transform.up * power);
			}
			if (((Component)col).tag == "Player")
			{
				if (Input.GetKey((KeyCode)32))
				{
					((Component)col).GetComponent<CharacterController>().skinWidth = 3f;
				}
				else
				{
					((Component)col).GetComponent<CharacterController>().skinWidth = 0.08f;
				}
			}
		}

		private void OnTriggerExit(Collider col)
		{
			if (((Component)col).tag == "Player")
			{
				((Component)col).GetComponent<CharacterController>().skinWidth = 0.08f;
			}
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class ML_PlantGrow : SlowUpdate, Hoverable
	{
		[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(0)]
		private enum Status
		{
			Healthy
		}

		public string m_name = "Plant";

		public float m_growTime = 10f;

		public float m_growTimeMax = 2000f;

		public GameObject[] m_grownPrefabs = (GameObject[])(object)new GameObject[0];

		public float m_minScale = 1f;

		public float m_maxScale = 1f;

		public float m_growRadius = 1f;

		public bool m_destroyIfCantGrow;

		[SerializeField]
		private GameObject m_healthy;

		[SerializeField]
		private GameObject m_healthyGrown;

		public EffectList m_growEffect = new EffectList();

		private Status m_status;

		private ZNetView m_nview;

		private float m_updateTime;

		private float m_spawnTime;

		private static int m_spaceMask;

		private static int m_roofMask;

		public override void Awake()
		{
			((SlowUpdate)this).Awake();
			m_nview = ((Component)this).gameObject.GetComponent<ZNetView>();
			if (m_nview.GetZDO() != null)
			{
				if (m_nview.IsOwner() && m_nview.GetZDO().GetLong("plantTime", 0L) == 0)
				{
					m_nview.GetZDO().Set("plantTime", ZNet.instance.GetTime().Ticks);
				}
				m_spawnTime = Time.time;
			}
		}

		public string GetHoverText()
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			Status status = m_status;
			Status val = status;
			if ((int)val == 0)
			{
				return Localization.instance.Localize(m_name + " ( $piece_plant_healthy )");
			}
			return "";
		}

		public string GetHoverName()
		{
			return Localization.instance.Localize(m_name);
		}

		private double TimeSincePlanted()
		{
			DateTime dateTime = new DateTime(m_nview.GetZDO().GetLong("plantTime", ZNet.instance.GetTime().Ticks));
			return (ZNet.instance.GetTime() - dateTime).TotalSeconds;
		}

		public override void SUpdate()
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Invalid comparison between Unknown and I4
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Invalid comparison between Unknown and I4
			if (m_nview.IsValid() && !((double)Time.time - (double)m_updateTime < 10.0))
			{
				m_updateTime = Time.time;
				double num = TimeSincePlanted();
				UpdateHealth(num);
				float growTime = GetGrowTime();
				if (Object.op_Implicit((Object)(object)m_healthyGrown))
				{
					bool flag = num > (double)growTime * 0.5;
					m_healthy.SetActive(!flag && (int)m_status == 0);
					m_healthyGrown.SetActive(flag && (int)m_status == 0);
				}
				else
				{
					m_healthy.SetActive((int)m_status == 0);
				}
				if (m_nview.IsOwner() && !((double)Time.time - (double)m_spawnTime <= 10.0) && !(num <= (double)growTime))
				{
					Grow();
				}
			}
		}

		private float GetGrowTime()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			State state = Random.state;
			float value = Random.value;
			Random.state = state;
			return Mathf.Lerp(m_growTime, m_growTimeMax, value);
		}

		private void Grow()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//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_0075: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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)
			if ((int)m_status > 0)
			{
				if (m_destroyIfCantGrow)
				{
					Destroy();
				}
				return;
			}
			GameObject val = m_grownPrefabs[Random.Range(0, m_grownPrefabs.Length)];
			Quaternion val2 = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
			Vector3 position = ((Component)this).transform.position;
			Quaternion val3 = val2;
			GameObject val4 = Object.Instantiate<GameObject>(val, position, val3);
			ZNetView component = val4.GetComponent<ZNetView>();
			float num = Random.Range(m_minScale, m_maxScale);
			Vector3 localScale = default(Vector3);
			((Vector3)(ref localScale))..ctor(num, num, num);
			component.SetLocalScale(localScale);
			TreeBase component2 = val4.GetComponent<TreeBase>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.Grow();
			}
			m_nview.Destroy();
			m_growEffect.Create(((Component)this).transform.position, val2, (Transform)null, num, -1);
		}

		private void UpdateHealth(double timeSincePlanted)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (timeSincePlanted < 10.0)
			{
				m_status = (Status)0;
			}
		}

		private void Destroy()
		{
			//IL_0013: 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_002d: Expected O, but got Unknown
			IDestructible component = ((Component)this).GetComponent<IDestructible>();
			if (component != null)
			{
				component.Damage(new HitData
				{
					m_damage = 
					{
						m_damage = 9999f
					}
				});
			}
		}

		private Status GetStatus()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return m_status;
		}
	}
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	public class HitAreaSFX : MonoBehaviour, IDestructible
	{
		public Action<HitData, HitAreaSFX> m_onHit;

		public float m_health = 100000f;

		[NonSerialized]
		public GameObject m_parentObject;

		public float m_hitNoise;

		public EffectList m_hitEffect = new EffectList();

		public DestructibleType GetDestructibleType()
		{
			return (DestructibleType)1;
		}

		public void Damage(HitData hit)
		{
			//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_005c: Unknown result type (might be due to invalid IL or missing references)
			float totalDamage = hit.GetTotalDamage();
			if ((double)totalDamage <= 0.0)
			{
				return;
			}
			m_hitEffect.Create(hit.m_point, Quaternion.identity, ((Component)this).transform, 1f, -1);
			if ((double)m_hitNoise > 0.0)
			{
				Player closestPlayer = Player.GetClosestPlayer(hit.m_point, 10f);
				if (Object.op_Implicit((Object)(object)closestPlayer))
				{
					((Character)closestPlayer).AddNoise(m_hitNoise);
				}
			}
			if (m_onHit != null)
			{
				m_onHit(hit, this);
			}
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class InstantiatePrefabBoatKinematic : MonoBehaviour
	{
		public List<GameObject> m_spawnPrefab;

		private List<GameObject> m_spawnedMobs = new List<GameObject>();

		public bool m_attach;

		public bool m_moveToTop;

		public void Start()
		{
			//IL_0025: 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)
			foreach (GameObject item in m_spawnPrefab)
			{
				GameObject val = Object.Instantiate<GameObject>(item, ((Component)((Component)this).transform).transform.position, ((Component)((Component)this).transform).transform.rotation);
				val.transform.SetParent(((Component)this).transform, true);
				m_spawnedMobs.Add(val);
			}
		}

		public void OnDestroy()
		{
			foreach (GameObject spawnedMob in m_spawnedMobs)
			{
				if ((Object)(object)spawnedMob != (Object)null)
				{
					spawnedMob.transform.parent = null;
					spawnedMob.GetComponent<Rigidbody>().isKinematic = false;
				}
			}
		}
	}
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	public class InstantiatePrefabBoat : MonoBehaviour
	{
		public List<GameObject> m_spawnPrefab;

		private List<GameObject> m_spawnedMobs = new List<GameObject>();

		public bool m_attach;

		public bool m_moveToTop;

		public void Start()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			ZLog.Log((object)(((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod().Name + "()"));
			foreach (GameObject item in m_spawnPrefab)
			{
				ZLog.Log((object)("[" + ((object)this).GetType().Name + "] Spawning " + ((Object)item).name));
				GameObject val = Object.Instantiate<GameObject>(item, ((Component)((Component)this).transform).transform.position, ((Component)((Component)this).transform).transform.rotation);
				val.transform.SetParent(((Component)this).transform, true);
				m_spawnedMobs.Add(val);
			}
		}

		public void OnDestroy()
		{
			ZLog.Log((object)(((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod().Name + "()"));
			foreach (GameObject spawnedMob in m_spawnedMobs)
			{
				if ((Object)(object)spawnedMob != (Object)null)
				{
					ZLog.Log((object)("[" + ((object)this).GetType().Name + "] Reparent " + ((Object)spawnedMob).name));
					spawnedMob.transform.parent = null;
				}
			}
		}
	}
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	public class InstantiatePrefabSpawn : MonoBehaviour
	{
		public List<GameObject> m_spawnPrefab;

		private List<GameObject> m_spawnedMobs = new List<GameObject>();

		public bool m_attach;

		public bool m_moveToTop;

		public void Start()
		{
			//IL_0078: 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)
			ZLog.Log((object)(((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod().Name + "()"));
			foreach (GameObject item in m_spawnPrefab)
			{
				ZLog.Log((object)("[" + ((object)this).GetType().Name + "] Spawning " + ((Object)item).name));
				GameObject val = Object.Instantiate<GameObject>(item, ((Component)((Component)this).transform).transform.position, ((Component)((Component)this).transform).transform.rotation);
				val.transform.SetParent(((Component)this).transform, true);
				val.layer = 17;
				m_spawnedMobs.Add(val);
			}
		}

		public void OnDestroy()
		{
			ZLog.Log((object)(((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod().Name + "()"));
			foreach (GameObject spawnedMob in m_spawnedMobs)
			{
				if ((Object)(object)spawnedMob != (Object)null)
				{
					ZLog.Log((object)("[" + ((object)this).GetType().Name + "] Reparent " + ((Object)spawnedMob).name));
					spawnedMob.transform.parent = null;
					spawnedMob.GetComponent<Rigidbody>().isKinematic = false;
					spawnedMob.layer = 9;
					Humanoid component = spawnedMob.GetComponent<Humanoid>();
					if ((Object)(object)component != (Object)null)
					{
						component.m_rightItem = CommonResources.DwarfGoblinSpearData;
						component.m_inventory.m_inventory[0] = CommonResources.DwarfGoblinSpearData;
						((Character)component).m_turnSpeed = 300f;
						((Character)component).m_runTurnSpeed = 100f;
					}
				}
			}
		}
	}
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	public class InstantiatePrefabLoxRider : MonoBehaviour
	{
		public List<GameObject> m_spawnPrefab;

		private List<GameObject> m_spawnedMobs = new List<GameObject>();

		public bool m_attach;

		public bool m_moveToTop;

		public void Start()
		{
			//IL_0025: 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)
			foreach (GameObject item in m_spawnPrefab)
			{
				GameObject val = Object.Instantiate<GameObject>(item, ((Component)((Component)this).transform).transform.position, ((Component)((Component)this).transform).transform.rotation);
				val.transform.SetParent(((Component)this).transform, true);
				val.layer = 17;
				m_spawnedMobs.Add(val);
			}
		}

		public void OnDestroy()
		{
			foreach (GameObject spawnedMob in m_spawnedMobs)
			{
				if ((Object)(object)spawnedMob != (Object)null)
				{
					spawnedMob.transform.parent = null;
					spawnedMob.GetComponent<Rigidbody>().isKinematic = false;
					spawnedMob.layer = 9;
					Humanoid component = spawnedMob.GetComponent<Humanoid>();
					if ((Object)(object)component != (Object)null)
					{
						component.m_rightItem = CommonResources.DwarfGoblinSpearData;
						component.m_inventory.m_inventory[0] = CommonResources.DwarfGoblinSpearData;
						((Character)component).m_turnSpeed = 300f;
						((Character)component).m_runTurnSpeed = 100f;
					}
				}
			}
		}
	}
	public static class ML_Sword_Frigga
	{
		public static void init()
		{
			Item item = new Item("dybassets", "ML_Sword_Frigga_1");
			item.Configurable = Configurability.Disabled;
			Item item2 = new Item("dybassets", "ML_Sword_Spider_L_1");
			item2.Configurable = Configurability.Disabled;
			Item item3 = new Item("dybassets", "ML_Sword_Spider_R_1");
			item3.Configurable = Configurability.Disabled;
			GameObject val = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spider_1");
			GameObject val2 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spawn_1");
			GameObject val3 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_SpawnP_1");
			Item item4 = new Item("dybassets", "ML_Sword_Frigga_2");
			item4.Configurable = Configurability.Disabled;
			Item item5 = new Item("dybassets", "ML_Sword_Spider_L_2");
			item5.Configurable = Configurability.Disabled;
			Item item6 = new Item("dybassets", "ML_Sword_Spider_R_2");
			item6.Configurable = Configurability.Disabled;
			GameObject val4 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spider_2");
			GameObject val5 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spawn_2");
			GameObject val6 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_SpawnP_2");
			Item item7 = new Item("dybassets", "ML_Sword_Frigga_3_Cold");
			item7.Configurable = Configurability.Disabled;
			Item item8 = new Item("dybassets", "ML_Sword_Spider_L_3_Cold");
			item8.Configurable = Configurability.Disabled;
			Item item9 = new Item("dybassets", "ML_Sword_Spider_R_3_Cold");
			item9.Configurable = Configurability.Disabled;
			GameObject val7 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spider_3_Cold");
			GameObject val8 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spawn_3_Cold");
			GameObject val9 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_SpawnP_3_Cold");
			Item item10 = new Item("dybassets", "ML_Sword_Frigga_3_Fire");
			item10.Configurable = Configurability.Disabled;
			Item item11 = new Item("dybassets", "ML_Sword_Spider_L_3_Fire");
			item11.Configurable = Configurability.Disabled;
			Item item12 = new Item("dybassets", "ML_Sword_Spider_R_3_Fire");
			item12.Configurable = Configurability.Disabled;
			GameObject val10 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spider_3_Fire");
			GameObject val11 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spawn_3_Fire");
			GameObject val12 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_SpawnP_3_Fire");
			Item item13 = new Item("dybassets", "ML_Sword_Frigga_3_Light");
			item13.Configurable = Configurability.Disabled;
			Item item14 = new Item("dybassets", "ML_Sword_Spider_L_3_Light");
			item14.Configurable = Configurability.Disabled;
			Item item15 = new Item("dybassets", "ML_Sword_Spider_R_3_Light");
			item15.Configurable = Configurability.Disabled;
			GameObject val13 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spider_3_Light");
			GameObject val14 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_Spawn_3_Light");
			GameObject val15 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ML_Sword_Frigga_SpawnP_3_Light");
			GameObject val16 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "vfx_ml_spawn");
			GameObject val17 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "vfx_ml_despawn");
		}
	}
	public class OceanLocations
	{
		internal static void LocationsAwake()
		{
			//IL_002a: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: 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)
			new Location("dybassets", "ML_ShipWreck02")
			{
				MapIcon = "bossicon.png",
				ShowMapIcon = ShowIcon.Never,
				SpawnArea = (BiomeArea)2,
				Biome = (Biome)256,
				SpawnDistance = new LocationManager.Range(50f, 10000f),
				SpawnAltitude = new LocationManager.Range(-1000f, -20f),
				MinimumDistanceFromGroup = 1000f,
				Count = 10,
				Unique = false
			};
			new Location("dybassets", "ML_ShipWreck03")
			{
				MapIcon = "bossicon.png",
				ShowMapIcon = ShowIcon.Never,
				SpawnArea = (BiomeArea)2,
				Biome = (Biome)256,
				SpawnDistance = new LocationManager.Range(50f, 10000f),
				SpawnAltitude = new LocationManager.Range(-1000f, -20f),
				MinimumDistanceFromGroup = 1000f,
				Count = 10,
				Unique = false
			};
			new Location("dybassets", "Balder_Altar")
			{
				Prioritize = true,
				MapIcon = "bossicon.png",
				ShowMapIcon = ShowIcon.Never,
				SpawnArea = (BiomeArea)2,
				Biome = (Biome)256,
				SpawnDistance = new LocationManager.Range(200f, 3000f),
				SpawnAltitude = new LocationManager.Range(-1000f, -25f),
				MinimumDistanceFromGroup = 1000f,
				Count = 1,
				Unique = false
			};
		}
	}
	public class Locations
	{
		internal static void LocationsAwake()
		{
			//IL_0032: 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_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			new Location("dybassets", "AshHuldraQueen_Altar")
			{
				Prioritize = true,
				MapIcon = "bossicon.png",
				ShowMapIcon = ShowIcon.Never,
				Biome = (Biome)32,
				SpawnArea = (BiomeArea)2,
				SpawnDistance = new LocationManager.Range(50f, 10000f),
				SpawnAltitude = new LocationManager.Range(5f, 1000f),
				MinimumDistanceFromGroup = 2000f,
				Count = 1,
				Unique = false
			};
			new Location("dybassets", "AshlandsCave_01")
			{
				Prioritize = true,
				MapIcon = "bossicon.png",
				ShowMapIcon = ShowIcon.Never,
				Biome = (Biome)32,
				SpawnDistance = new LocationManager.Range(500f, 10000f),
				SpawnAltitude = new LocationManager.Range(20f, 1000f),
				MinimumDistanceFromGroup = 2000f,
				Count = 7,
				Unique = false
			};
			new Location("dybassets", "AshlandsCave_02")
			{
				Prioritize = true,
				MapIcon = "bossicon.png",
				ShowMapIcon = ShowIcon.Never,
				Biome = (Biome)32,
				SpawnDistance = new LocationManager.Range(500f, 10000f),
				SpawnAltitude = new LocationManager.Range(20f, 1000f),
				MinimumDistanceFromGroup = 2000f,
				Count = 7,
				Unique = false
			};
			new Location("dybassets", "SpiderCave01")
			{
				Prioritize = true,
				MapIcon = "bossicon.png",
				ShowMapIcon = ShowIcon.Never,
				Biome = (Biome)8,
				SpawnArea = (BiomeArea)3,
				SpawnDistance = new LocationManager.Range(500f, 1000f),
				SpawnAltitude = new LocationManager.Range(5f, 1000f),
				MinimumDistanceFromGroup = 3000f,
				Count = 1,
				Unique = false
			};
			new Location("dybassets", "Mystical_Well0")
			{
				Prioritize = true,
				MapIcon = "ML_Hammer_Icon.png",
				ShowMapIcon = ShowIcon.Always,
				Biome = (Biome)1,
				SpawnDistance = new LocationManager.Range(100f, 500f),
				SpawnAltitude = new LocationManager.Range(10f, 1000f),
				MinimumDistanceFromGroup = 3000f,
				Count = 1,
				Unique = false
			};
		}
	}
	[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
	[BepInPlugin("MonsterLabZ", "MonsterLabZ", "3.0.9")]
	[<d23ff2c1-30f6-4034-927f-9061f7d45c78>Nullable(0)]
	public class MonsterLabZ : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(ZNetScene), "Awake")]
		[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(0)]
		private static class ZNetScene_Awake_PostPatch
		{
			[<902d42e0-15f1-4173-907f-c4d9b087bf55>NullableContext(1)]
			public static void Postfix(ZNetScene __instance)
			{
				if (!((Object)(object)__instance == (Object)null) && !fixedReferences)
				{
					ShaderSwapper.GatherCustomShaders(ref __instance);
					List<GameObject> prefabList = new List<GameObject>();
					GameObject[] array = __instance.m_prefabs.Where((GameObject p) => ((Object)p).name.StartsWith("ML_")).ToArray();
					if (array != null && array.Length != 0)
					{
						prefabList.AddRange(array);
					}
					array = __instance.m_prefabs.Where((GameObject p) => ((Object)p).name.StartsWith("MLNPC")).ToArray();
					if (array != null && array.Length != 0)
					{
						prefabList.AddRange(array);
					}
					if (prefabList.Count > 0)
					{
						ShaderSwapper.FixCustomShaders(ref prefabList);
					}
					CommonResources.findCommonResources(__instance);
					fixedReferences = true;
				}
			}
		}

		private const string ModName = "MonsterLabZ";

		private const string ModVersion = "3.0.9";

		private const string ModGUID = "MonsterLabZ";

		public static ManualLogSource Log;

		private static bool fixedReferences;

		public void Awake()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Expected O, but got Unknown
			Localizer.Load();
			Locations.LocationsAwake();
			OceanLocations.LocationsAwake();
			ML_DebugMonsters.init();
			ML_NaturalDisasters.init();
			NPC_Items.init();
			Butterfly.init();
			DeepSea_Serpent.init();
			EvilShadow.init();
			FireGolem.init();
			NormalGhostWarrior.init();
			DwarfGoblin.init();
			GoblinShip.init();
			DraugrShip.init();
			IceGolem.init();
			Kraken.init();
			Molluscan.init();
			NightmareDragon.init();
			NormalSkeleton.init();
			FireSkeleton.init();
			IceSkeleton.init();
			PoisonSkeleton.init();
			Frigga.init();
			Svartalfar.init();
			Succubus.init();
			Surtr.init();
			WraithWarrior.init();
			Spiders.init();
			ObsidianGolem.init();
			ML_Surtling.init();
			NPC_Female.init();
			NPC_Male.init();
			Greydwarf.init();
			ChaosSkeleton.init();
			ML_CustomProps.init();
			ML_Sword_Frigga.init();
			ML_Mistile.init();
			ML_Tentaroot.init();
			ML_Hatchlings.init();
			ML_JellyFish.init();
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			Harmony val = new Harmony("MonsterLabZ");
			val.PatchAll(executingAssembly);
		}
	}
	public static class NormalGhostWarrior
	{
		public static void init()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			Creature creature = new Creature("dybassets", "NormalGhostWarrior")
			{
				Biome = (Biome)0
			};
			creature.ConfigurationEnabled = false;
			creature.Drops["Ruby"].Amount = new CreatureManager.Range(1f, 1f);
			creature.Drops["Ruby"].DropChance = 100f;
			creature.Drops["Ruby"].DropOnePerPlayer = false;
			creature.Drops["Ruby"].MultiplyDropByLevel = false;
			GameObject val = ItemManager.PrefabManager.RegisterPrefab("dybassets", "GhostWarrior");
			Item item = new Item("dybassets", "ghost_poisonball");
			item.Configurable = Configurability.Disabled;
			GameObject val2 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "sfx_ghost_poison_explode");
			GameObject val3 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "sfx_ghost_poison_start");
			GameObject val4 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "vfx_ghostpoison_hit");
			GameObject val5 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "vfx_ghost_poison_explosion");
			GameObject val6 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "ghost_poisonball_projectile");
		}
	}
	public static class DwarfGoblin
	{
		public static void init()
		{
			//IL_0018: 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_02a4: Unknown result type (might be due to invalid IL or missing references)
			Creature creature = new Creature("dybassets", "DwarfGoblin")
			{
				Biome = (Biome)16,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				CheckSpawnInterval = 300,
				SpawnChance = 25f,
				GroupSize = new CreatureManager.Range(4f, 5f),
				Maximum = 8,
				SpecificSpawnTime = SpawnTime.Always
			};
			creature.Drops["Coins"].Amount = new CreatureManager.Range(3f, 5f);
			creature.Drops["Coins"].DropChance = 100f;
			creature.Drops["Coins"].DropOnePerPlayer = false;
			creature.Drops["Coins"].MultiplyDropByLevel = true;
			Creature creature2 = new Creature("dybassets", "DwarfGoblinLoot")
			{
				Biome = (Biome)16,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				CheckSpawnInterval = 300,
				SpawnChance = 5f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				Maximum = 2,
				SpecificSpawnTime = SpawnTime.Day
			};
			creature2.Drops["Coins"].Amount = new CreatureManager.Range(5f, 8f);
			creature2.Drops["Coins"].DropChance = 100f;
			creature2.Drops["Coins"].DropOnePerPlayer = false;
			creature2.Drops["Coins"].MultiplyDropByLevel = true;
			creature2.Drops["Amber"].Amount = new CreatureManager.Range(2f, 4f);
			creature2.Drops["Amber"].DropChance = 100f;
			creature2.Drops["Amber"].DropOnePerPlayer = false;
			creature2.Drops["Amber"].MultiplyDropByLevel = true;
			creature2.Drops["Ruby"].Amount = new CreatureManager.Range(1f, 3f);
			creature2.Drops["Ruby"].DropChance = 100f;
			creature2.Drops["Ruby"].DropOnePerPlayer = false;
			creature2.Drops["Ruby"].MultiplyDropByLevel = true;
			Creature creature3 = new Creature("dybassets", "DwarfGoblinShaman")
			{
				Biome = (Biome)16,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				CheckSpawnInterval = 450,
				SpawnChance = 10f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				Maximum = 2,
				SpecificSpawnTime = SpawnTime.Always
			};
			creature3.Drops["Coins"].Amount = new CreatureManager.Range(4f, 6f);
			creature3.Drops["Coins"].DropChance = 100f;
			creature3.Drops["Coins"].DropOnePerPlayer = false;
			creature3.Drops["Coins"].MultiplyDropByLevel = true;
			GameObject val = ItemManager.PrefabManager.RegisterPrefab("dybassets", "DwarfGoblin_ragdoll");
			GameObject val2 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "DwarfGoblinLoot_ragdoll");
			GameObject val3 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "DwarfGoblinShaman_ragdoll");
			Item item = new Item("dybassets", "DwarfGoblinBow");
			item.Configurable = Configurability.Disabled;
			Item item2 = new Item("dybassets", "DwarfGoblinPickAxe");
			item2.Configurable = Configurability.Disabled;
			Item item3 = new Item("dybassets", "DwarfGoblinClub");
			item3.Configurable = Configurability.Disabled;
			Item item4 = new Item("dybassets", "DwarfGoblinSword");
			item4.Configurable = Configurability.Disabled;
			Item item5 = new Item("dybassets", "DwarfGoblinTorch");
			item5.Configurable = Configurability.Disabled;
			Item item6 = new Item("dybassets", "DwarfGoblinShieldBlackMetal");
			item6.Configurable = Configurability.Disabled;
			Item item7 = new Item("dybassets", "DwarfGoblinShieldWood");
			item7.Configurable = Configurability.Disabled;
			Item item8 = new Item("dybassets", "DwarfGoblinArmBandFeathers");
			item8.Configurable = Configurability.Disabled;
			Item item9 = new Item("dybassets", "DwarfGoblinArmBandIron");
			item9.Configurable = Configurability.Disabled;
			Item item10 = new Item("dybassets", "DwarfGoblinArmorBronze");
			item10.Configurable = Configurability.Disabled;
			Item item11 = new Item("dybassets", "DwarfGoblinArmorFeathers");
			item11.Configurable = Configurability.Disabled;
			Item item12 = new Item("dybassets", "DwarfGoblinArmorIron");
			item12.Configurable = Configurability.Disabled;
			Item item13 = new Item("dybassets", "DwarfGoblinArmorLeather");
			item13.Configurable = Configurability.Disabled;
			Item item14 = new Item("dybassets", "DwarfGoblinHelmetBronze");
			item14.Configurable = Configurability.Disabled;
			Item item15 = new Item("dybassets", "DwarfGoblinHelmetLeather");
			item15.Configurable = Configurability.Disabled;
			Item item16 = new Item("dybassets", "DwarfGoblinHelmetSkull");
			item16.Configurable = Configurability.Disabled;
			Item item17 = new Item("dybassets", "DwarfGoblinShamanStaffBones");
			item17.Configurable = Configurability.Disabled;
			Item item18 = new Item("dybassets", "DwarfGoblinShamanStaffFeathers");
			item18.Configurable = Configurability.Disabled;
			Item item19 = new Item("dybassets", "DwarfGoblinShoulderPadIron");
			item19.Configurable = Configurability.Disabled;
			Item item20 = new Item("dybassets", "DwarfGoblinShoulderPadLeather");
			item20.Configurable = Configurability.Disabled;
			Item item21 = new Item("dybassets", "DwarfGoblinSpear");
			item21.Configurable = Configurability.Disabled;
			Item item22 = new Item("dybassets", "DwarfGoblinSpearLox");
			item22.Configurable = Configurability.Disabled;
			Item item23 = new Item("dybassets", "DwarfGoblinSpearChitin");
			item23.Configurable = Configurability.Disabled;
			Item item24 = new Item("dybassets", "DwarfGoblinShamanBoat_attack_fireball");
			item24.Configurable = Configurability.Disabled;
			Item item25 = new Item("dybassets", "DwarfGoblinShaman_attack_fireball");
			item25.Configurable = Configurability.Disabled;
			Item item26 = new Item("dybassets", "DwarfGoblinShaman_attack_poke");
			item26.Configurable = Configurability.Disabled;
			Item item27 = new Item("dybassets", "DwarfGoblinLoot_Run");
			item27.Configurable = Configurability.Disabled;
			GameObject val4 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "sfx_goblin_loot_alert");
			GameObject val5 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "sfx_goblin_loot_die");
			GameObject val6 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "sfx_goblin_loot_hit");
			GameObject val7 = ItemManager.PrefabManager.RegisterPrefab("dybassets", "sfx_goblin_loot_idle");
			GameObject val8 = ItemManager.PrefabManager.RegisterPrefab("dybasse