Decompiled source of Hati v1.0.14

plugins/Hati.dll

Decompiled 2 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Hati.Anim;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Hati
{
	public class BloodMoon : MonoBehaviour
	{
		private const float Distance = 520f;

		private GameObject _root;

		private SpriteRenderer _halo;

		private SpriteRenderer _disc;

		private SpriteRenderer _corona;

		internal static Sprite _discSprite;

		internal static Sprite _haloSprite;

		internal static Sprite _coronaSprite;

		private static FieldInfo _dirLightField;

		private float _fade;

		private Color _discCol = new Color(1f, 0.6f, 0.55f);

		private Color _haloCol = new Color(0.9f, 0.3f, 0.25f, 0f);

		private float _haloScale = 4.5f;

		internal static int OmenLevel()
		{
			if (Cfg.Mode.Value == SpawnMode.Watcher)
			{
				if (!HatiRuntime.KnownWatcherHere)
				{
					return 0;
				}
				int knownVeille = HatiRuntime.KnownVeille;
				if (knownVeille > 2)
				{
					if (knownVeille > 4)
					{
						return 3;
					}
					return 2;
				}
				return 1;
			}
			float knownChance = HatiRuntime.KnownChance;
			if (!(knownChance <= 0f))
			{
				if (!(knownChance < 45f))
				{
					if (!(knownChance < 75f))
					{
						return 3;
					}
					return 2;
				}
				return 1;
			}
			return 0;
		}

		private void Update()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0368: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			bool bloodActive = HatiSky.BloodActive;
			bool eclipseActive = HatiSky.EclipseActive;
			int num = OmenLevel();
			Camera main = Camera.main;
			Vector3 dir;
			bool flag = FxDebug.Disc && Cfg.MoonDisc.Value && (bloodActive || eclipseActive || num > 0) && Clock.IsNight && Object.op_Implicit((Object)(object)main) && MoonDir(out dir) && dir.y > -0.05f;
			_fade = Mathf.MoveTowards(_fade, flag ? 1f : 0f, Time.deltaTime / 2.5f);
			if (_fade <= 0f)
			{
				if (Object.op_Implicit((Object)(object)_root) && _root.activeSelf)
				{
					_root.SetActive(false);
				}
			}
			else
			{
				if (!Object.op_Implicit((Object)(object)main) || !MoonDir(out dir))
				{
					return;
				}
				Ensure();
				if (!_root.activeSelf)
				{
					_root.SetActive(true);
				}
				Vector3 position = ((Component)main).transform.position;
				float num2 = Mathf.Min(520f, main.farClipPlane * 0.9f);
				Vector3 val = position + dir * num2;
				_root.transform.position = val;
				_root.transform.rotation = Quaternion.LookRotation(val - position);
				float num3 = 2f * num2 * Mathf.Tan(Mathf.Max(0.5f, Cfg.MoonSize.Value) * 0.5f * ((float)Math.PI / 180f));
				_root.transform.localScale = Vector3.one * num3;
				float num4 = 0.92f + 0.08f * Mathf.Sin(Time.time * 0.9f);
				if (eclipseActive)
				{
					_disc.color = new Color(0.02f, 0f, 0f, _fade);
					_corona.color = new Color(1f, 0.25f, 0.08f, 0.95f * _fade * num4);
					_halo.color = new Color(0.55f, 0.04f, 0.02f, 0.35f * _fade);
					((Component)_halo).transform.localScale = Vector3.one * 4.5f;
					return;
				}
				Color val2 = default(Color);
				Color val3 = default(Color);
				float num5;
				if (bloodActive)
				{
					((Color)(ref val2))..ctor(1f, 0.1f, 0.06f);
					((Color)(ref val3))..ctor(0.95f, 0.06f, 0.03f, 0.7f);
					num5 = 6f;
				}
				else if (num >= 3)
				{
					((Color)(ref val2))..ctor(1f, 0.2f, 0.12f);
					((Color)(ref val3))..ctor(0.9f, 0.1f, 0.05f, 0.55f);
					num5 = 5.5f;
				}
				else if (num == 2)
				{
					((Color)(ref val2))..ctor(1f, 0.36f, 0.28f);
					((Color)(ref val3))..ctor(0.9f, 0.2f, 0.12f, 0.42f);
					num5 = 5f;
				}
				else
				{
					((Color)(ref val2))..ctor(1f, 0.58f, 0.52f);
					((Color)(ref val3))..ctor(0.9f, 0.35f, 0.28f, 0.3f);
					num5 = 4.5f;
				}
				float num6 = Time.deltaTime / 3f;
				_discCol = Color.Lerp(_discCol, val2, num6 * 3f);
				_haloCol = Color.Lerp(_haloCol, val3, num6 * 3f);
				_haloScale = Mathf.Lerp(_haloScale, num5, num6 * 3f);
				_disc.color = new Color(_discCol.r * (bloodActive ? num4 : 1f), _discCol.g, _discCol.b, _fade);
				_corona.color = new Color(1f, 0.3f, 0.15f, 0f);
				_halo.color = new Color(_haloCol.r, _haloCol.g, _haloCol.b, _haloCol.a * _fade * (bloodActive ? num4 : 1f));
				((Component)_halo).transform.localScale = Vector3.one * _haloScale;
			}
		}

		internal static bool MoonDir(out Vector3 dir)
		{
			//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_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			dir = Vector3.up;
			if (!Object.op_Implicit((Object)(object)EnvMan.instance))
			{
				return false;
			}
			if ((object)_dirLightField == null)
			{
				_dirLightField = AccessTools.Field(typeof(EnvMan), "m_dirLight");
			}
			object? obj = _dirLightField?.GetValue(EnvMan.instance);
			Light val = (Light)((obj is Light) ? obj : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return false;
			}
			dir = -((Component)val).transform.forward;
			return true;
		}

		private void Ensure()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)_root))
			{
				if (!Object.op_Implicit((Object)(object)_discSprite))
				{
					BuildSprites();
				}
				_root = new GameObject("Hati_BloodMoon");
				_root.transform.SetParent(((Component)this).transform, false);
				_halo = Layer("Halo", _haloSprite, 0, 4.5f);
				_disc = Layer("Disc", _discSprite, 1, 1f);
				_corona = Layer("Corona", _coronaSprite, 2, 1.6f);
			}
		}

		private SpriteRenderer Layer(string name, Sprite s, int order, float scale)
		{
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			val.transform.SetParent(_root.transform, false);
			val.transform.localScale = Vector3.one * scale;
			SpriteRenderer obj = val.AddComponent<SpriteRenderer>();
			obj.sprite = s;
			((Renderer)obj).sortingOrder = order;
			((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0;
			return obj;
		}

		internal static void BuildSprites()
		{
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = Tex(128);
			Texture2D val2 = Tex(128);
			Texture2D val3 = Tex(128);
			for (int i = 0; i < 128; i++)
			{
				for (int j = 0; j < 128; j++)
				{
					float num = ((float)j + 0.5f) / 128f * 2f - 1f;
					float num2 = ((float)i + 0.5f) / 128f * 2f - 1f;
					float num3 = Mathf.Sqrt(num * num + num2 * num2);
					float num4 = Mathf.Clamp01((1f - num3) * 128f * 0.5f);
					float num5 = Mathf.PerlinNoise((float)j * 0.045f + 11f, (float)i * 0.045f + 3f);
					float num6 = Mathf.PerlinNoise((float)j * 0.16f + 5f, (float)i * 0.16f + 9f);
					float num7 = 0.62f + 0.3f * Mathf.SmoothStep(0.35f, 0.7f, num5) + 0.08f * num6;
					num7 *= 1f - 0.25f * num3 * num3;
					val.SetPixel(j, i, new Color(num7, num7, num7, num4));
					float num8 = Mathf.Clamp01(1f - num3);
					val2.SetPixel(j, i, new Color(1f, 1f, 1f, num8 * num8 * num8));
					float num9 = Mathf.Exp(0f - Mathf.Pow((num3 - 0.625f) / 0.06f, 2f)) + 0.35f * Mathf.Exp(0f - Mathf.Pow((num3 - 0.68f) / 0.15f, 2f));
					float num10 = 0.75f + 0.25f * Mathf.PerlinNoise(Mathf.Atan2(num2, num) * 3f + 7f, num3 * 6f);
					val3.SetPixel(j, i, new Color(1f, 1f, 1f, Mathf.Clamp01(num9 * num10) * ((num3 < 0.6f) ? 0f : 1f)));
				}
			}
			val.Apply();
			val2.Apply();
			val3.Apply();
			Vector2 val4 = default(Vector2);
			((Vector2)(ref val4))..ctor(0.5f, 0.5f);
			_discSprite = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), val4, 128f);
			_haloSprite = Sprite.Create(val2, new Rect(0f, 0f, 128f, 128f), val4, 128f);
			_coronaSprite = Sprite.Create(val3, new Rect(0f, 0f, 128f, 128f), val4, 128f);
		}

		private static Texture2D Tex(int n)
		{
			//IL_0004: 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_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			return new Texture2D(n, n, (TextureFormat)4, false)
			{
				wrapMode = (TextureWrapMode)1,
				filterMode = (FilterMode)1
			};
		}
	}
	public enum BaseMode
	{
		Perimeter,
		Siege,
		NoSpawn
	}
	public enum SpawnMode
	{
		Watcher,
		Random
	}
	public enum TreeMode
	{
		Ghost,
		Smash,
		Off
	}
	public enum GroupScaling
	{
		Game,
		Custom
	}
	public enum PackStyle
	{
		Harass,
		Swarm
	}
	internal static class Cfg
	{
		public static ConfigEntry<bool> Enabled;

		public static ConfigEntry<float> ChanceStep;

		public static ConfigEntry<float> ChanceCap;

		public static ConfigEntry<float> MinOnlineCoverage;

		public static ConfigEntry<float> WindowStart;

		public static ConfigEntry<float> WindowEnd;

		public static ConfigEntry<float> GiveUpAt;

		public static ConfigEntry<int> AttackMinTier;

		public static ConfigEntry<int> OmenMinVeille;

		public static ConfigEntry<float> OmenChance;

		public static ConfigEntry<BaseMode> BaseBehaviour;

		public static ConfigEntry<string> BossKeys;

		public static ConfigEntry<float> SpawnMin;

		public static ConfigEntry<float> SpawnMax;

		public static ConfigEntry<float> SpawnFallback;

		public static ConfigEntry<float> BaseClearance;

		public static ConfigEntry<float> BuildClearance;

		public static ConfigEntry<float> MaxSlope;

		public static ConfigEntry<float> StalkSeconds;

		public static ConfigEntry<float> StalkVanishDistance;

		public static ConfigEntry<string> TierHealth;

		public static ConfigEntry<string> TierBite;

		public static ConfigEntry<string> MaxHitByTier;

		public static ConfigEntry<string> TierPackCount;

		public static ConfigEntry<string> TierPackHealth;

		public static ConfigEntry<float> FrostShare;

		public static ConfigEntry<float> PackBiteShare;

		public static ConfigEntry<float> BreathTickShare;

		public static ConfigEntry<float> FieldTickShare;

		public static ConfigEntry<float> SoulHealDecay;

		public static ConfigEntry<int> SoulHealMax;

		public static ConfigEntry<int> PackCap;

		public static ConfigEntry<float> GroupRange;

		public static ConfigEntry<float> GroupHealthPercent;

		public static ConfigEntry<float> GroupDamagePercent;

		public static ConfigEntry<int> GroupMaxPlayers;

		public static ConfigEntry<int> GroupPackWolves;

		public static ConfigEntry<GroupScaling> GroupMode;

		public static ConfigEntry<float> SoulHealPercent;

		public static ConfigEntry<float> GrudgeHealthPercent;

		public static ConfigEntry<float> GrudgeDamagePercent;

		public static ConfigEntry<int> GrudgeMax;

		public static ConfigEntry<float> Scale;

		public static ConfigEntry<TreeMode> Trees;

		public static ConfigEntry<SpawnMode> Mode;

		public static ConfigEntry<float> AggroBase;

		public static ConfigEntry<float> AggroPerNight;

		public static ConfigEntry<float> AggroMax;

		public static ConfigEntry<float> PostFar;

		public static ConfigEntry<float> PostPerNight;

		public static ConfigEntry<float> PostNear;

		public static ConfigEntry<float> WatchRelocate;

		public static ConfigEntry<float> WatchStart;

		public static ConfigEntry<float> AttackBase;

		public static ConfigEntry<float> AttackPerNight;

		public static ConfigEntry<float> AttackMax;

		public static ConfigEntry<float> AttackPerFlee;

		public static ConfigEntry<float> AwayMin;

		public static ConfigEntry<float> AwayMax;

		public static ConfigEntry<float> MinHuntSeconds;

		public static ConfigEntry<float> OvertimeSeconds;

		public static ConfigEntry<int> ConfigRevision;

		public static ConfigEntry<bool> BiomeRaisesTier;

		public static ConfigEntry<float> CameraShake;

		public static ConfigEntry<bool> Moveset;

		public static ConfigEntry<int> MeleeBites;

		public static ConfigEntry<PackStyle> PackMode;

		public static ConfigEntry<int> PackStrikers;

		public static ConfigEntry<float> PackRing;

		public static ConfigEntry<float> PackCooldown;

		public static ConfigEntry<float> PackLeash;

		public static ConfigEntry<float> PackRunSpeed;

		public static ConfigEntry<float> TreeSafeRadius;

		public static ConfigEntry<float> SpeedMultiplier;

		public static ConfigEntry<float> EclipseAt;

		public static ConfigEntry<float> HowlInterval;

		public static ConfigEntry<float> FireRadius;

		public static ConfigEntry<float> ShockRadius;

		public static ConfigEntry<float> HowlVolume;

		public static ConfigEntry<bool> HowlScreenVeil;

		public static ConfigEntry<bool> DumpModel;

		public static ConfigEntry<float> ShockShare;

		public static ConfigEntry<float> FearSeconds;

		public static ConfigEntry<float> FearStaminaRegen;

		public static ConfigEntry<float> TorchLockout;

		public static ConfigEntry<float> WildFireSeconds;

		public static ConfigEntry<string> LightItems;

		public static ConfigEntry<float> InsomniaWeight;

		public static ConfigEntry<float> DeathGraceSeconds;

		public static ConfigEntry<bool> BlockDuringRaids;

		public static ConfigEntry<float> BossFightRange;

		public static ConfigEntry<bool> PackHuntsLivestock;

		public static ConfigEntry<float> LivestockRange;

		public static ConfigEntry<string> MusicName;

		public static ConfigEntry<bool> MoonDisc;

		public static ConfigEntry<bool> FootIK;

		public static ConfigEntry<bool> FieldMist;

		public static ConfigEntry<bool> ProceduralAnim;

		public static ConfigEntry<bool> CleanIdles;

		public static ConfigEntry<bool> NewLeaps;

		public static ConfigEntry<bool> BossSkin;

		public static ConfigEntry<bool> BossRunes;

		public static ConfigEntry<float> FootIKMax;

		public static ConfigEntry<float> MoonSize;

		public static ConfigEntry<float> GhostOpacity;

		public static ConfigEntry<float> GlowThroughLeaves;

		public static ConfigEntry<string> GleipnirRecipe;

		public static ConfigEntry<string> GleipnirStation;

		public static ConfigEntry<float> GleipnirSeconds;

		public static ConfigEntry<float> GleipnirHealth;

		public static ConfigEntry<float> GleipnirDamageBonus;

		public static ConfigEntry<float> GleipnirRange;

		public static ConfigEntry<string> SunstoneRecipe;

		public static ConfigEntry<string> SunstoneStation;

		public static ConfigEntry<float> SunstoneStun;

		public static ConfigEntry<float> SunstoneReveal;

		public static ConfigEntry<float> SunstoneRange;

		public static ConfigEntry<string> EyeRecipe;

		public static ConfigEntry<string> EyeStation;

		public static ConfigEntry<int> EyeAmount;

		public static ConfigEntry<float> EyeSeconds;

		public static ConfigEntry<string> CapeRecipe;

		public static ConfigEntry<string> CapeStation;

		public static ConfigEntry<string> SkollCapeRecipe;

		public static ConfigEntry<float> CapeSneak;

		public static ConfigEntry<bool> StepEnabled;

		public static ConfigEntry<KeyCode> StepKey;

		public static ConfigEntry<KeyCode> StepKeyAlt;

		public static ConfigEntry<float> StepDistance;

		public static ConfigEntry<float> StepCooldownDay;

		public static ConfigEntry<float> StepCooldownNight;

		public static ConfigEntry<float> StepStamina;

		public static ConfigEntry<float> StepInvulnAfter;

		public static ConfigEntry<float> SetSpeedDay;

		public static ConfigEntry<float> SetSpeedNight;

		public static ConfigEntry<float> SetStaminaRegenNight;

		public static ConfigEntry<string> ArmorPelts;

		public static ConfigEntry<bool> ChainEnabled;

		public static ConfigEntry<float> SkollChanceBase;

		public static ConfigEntry<float> SkollChanceStep;

		public static ConfigEntry<float> SkollArriveAt;

		public static ConfigEntry<float> SkollScale;

		public static ConfigEntry<string> SkollHealthByTier;

		public static ConfigEntry<string> SkollDamageByTier;

		public static ConfigEntry<string> ManagarmrHealthByTier;

		public static ConfigEntry<string> ManagarmrDamageByTier;

		public static ConfigEntry<string> SkollMaxHitByTier;

		public static ConfigEntry<string> ManagarmrMaxHitByTier;

		public static ConfigEntry<float> FireFieldSeconds;

		public static ConfigEntry<int> ManagarmrDelayDays;

		public static ConfigEntry<float> ManagarmrSoulHeal;

		public static ConfigEntry<float> ManagarmrEclipseAt;

		public static ConfigEntry<float> ManagarmrScale;

		public static ConfigEntry<float> ManagarmrArriveAt;

		public static ConfigEntry<string> ManagarmrStances;

		public static ConfigEntry<bool> AllowClientCommands;

		public static ConfigEntry<bool> VerboseLog;

		private static string _stanceSrc;

		private static float[] _stances = new float[0];

		private static ConfigurationManagerAttributes A => new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		};

		public static void Bind(ConfigFile c)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Expected O, but got Unknown
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Expected O, but got Unknown
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Expected O, but got Unknown
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Expected O, but got Unknown
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Expected O, but got Unknown
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Expected O, but got Unknown
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Expected O, but got Unknown
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Expected O, but got Unknown
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Expected O, but got Unknown
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Expected O, but got Unknown
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Expected O, but got Unknown
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Expected O, but got Unknown
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Expected O, but got Unknown
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0456: Expected O, but got Unknown
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Expected O, but got Unknown
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bc: Expected O, but got Unknown
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: Expected O, but got Unknown
			//IL_0518: Unknown result type (might be due to invalid IL or missing references)
			//IL_0522: Expected O, but got Unknown
			//IL_0559: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Expected O, but got Unknown
			//IL_058c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Expected O, but got Unknown
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d7: Expected O, but got Unknown
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0618: Expected O, but got Unknown
			//IL_064f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0659: Expected O, but got Unknown
			//IL_067e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0688: Expected O, but got Unknown
			//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b7: Expected O, but got Unknown
			//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f8: Expected O, but got Unknown
			//IL_0725: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Expected O, but got Unknown
			//IL_0766: Unknown result type (might be due to invalid IL or missing references)
			//IL_0770: Expected O, but got Unknown
			//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b1: Expected O, but got Unknown
			//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e6: Expected O, but got Unknown
			//IL_080b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0815: Expected O, but got Unknown
			//IL_083e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0848: Expected O, but got Unknown
			//IL_0871: Unknown result type (might be due to invalid IL or missing references)
			//IL_087b: Expected O, but got Unknown
			//IL_08a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: Expected O, but got Unknown
			//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e1: Expected O, but got Unknown
			//IL_090a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0914: Expected O, but got Unknown
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0947: Expected O, but got Unknown
			//IL_097e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0988: Expected O, but got Unknown
			//IL_09b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bb: Expected O, but got Unknown
			//IL_09f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fc: Expected O, but got Unknown
			//IL_0a25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2f: Expected O, but got Unknown
			//IL_0a58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a62: Expected O, but got Unknown
			//IL_0a8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a95: Expected O, but got Unknown
			//IL_0abe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac8: Expected O, but got Unknown
			//IL_0aff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b09: Expected O, but got Unknown
			//IL_0b32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Expected O, but got Unknown
			//IL_0b73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7d: Expected O, but got Unknown
			//IL_0ba2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bac: Expected O, but got Unknown
			//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdb: Expected O, but got Unknown
			//IL_0c07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c11: Expected O, but got Unknown
			//IL_0c3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c49: Expected O, but got Unknown
			//IL_0c6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c78: Expected O, but got Unknown
			//IL_0ca3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cad: Expected O, but got Unknown
			//IL_0cd6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce0: Expected O, but got Unknown
			//IL_0d09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d13: Expected O, but got Unknown
			//IL_0d3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d46: Expected O, but got Unknown
			//IL_0d6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d79: Expected O, but got Unknown
			//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dac: Expected O, but got Unknown
			//IL_0de3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ded: Expected O, but got Unknown
			//IL_0e19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e23: Expected O, but got Unknown
			//IL_0e4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e56: Expected O, but got Unknown
			//IL_0e7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e89: Expected O, but got Unknown
			//IL_0eae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb8: Expected O, but got Unknown
			//IL_0ee1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eeb: Expected O, but got Unknown
			//IL_0f10: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1a: Expected O, but got Unknown
			//IL_0f43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f4d: Expected O, but got Unknown
			//IL_0f76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f80: Expected O, but got Unknown
			//IL_0fb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fc1: Expected O, but got Unknown
			//IL_0fea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff4: Expected O, but got Unknown
			//IL_101d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1027: Expected O, but got Unknown
			//IL_1050: Unknown result type (might be due to invalid IL or missing references)
			//IL_105a: Expected O, but got Unknown
			//IL_10be: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c8: Expected O, but got Unknown
			//IL_10f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_10fb: Expected O, but got Unknown
			//IL_1124: Unknown result type (might be due to invalid IL or missing references)
			//IL_112e: Expected O, but got Unknown
			//IL_1157: Unknown result type (might be due to invalid IL or missing references)
			//IL_1161: Expected O, but got Unknown
			//IL_118a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1194: Expected O, but got Unknown
			//IL_11bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_11c7: Expected O, but got Unknown
			//IL_11f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_11fa: Expected O, but got Unknown
			//IL_1223: Unknown result type (might be due to invalid IL or missing references)
			//IL_122d: Expected O, but got Unknown
			//IL_1256: Unknown result type (might be due to invalid IL or missing references)
			//IL_1260: Expected O, but got Unknown
			//IL_1285: Unknown result type (might be due to invalid IL or missing references)
			//IL_128f: Expected O, but got Unknown
			//IL_12b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_12c2: Expected O, but got Unknown
			//IL_12e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_12f1: Expected O, but got Unknown
			//IL_131a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1324: Expected O, but got Unknown
			//IL_142e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1438: Expected O, but got Unknown
			//IL_14a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_14aa: Expected O, but got Unknown
			//IL_14d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_14e2: Expected O, but got Unknown
			//IL_150b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1515: Expected O, but got Unknown
			//IL_153e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1548: Expected O, but got Unknown
			//IL_1571: Unknown result type (might be due to invalid IL or missing references)
			//IL_157b: Expected O, but got Unknown
			//IL_15a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_15ae: Expected O, but got Unknown
			//IL_15d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_15e1: Expected O, but got Unknown
			//IL_160a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1614: Expected O, but got Unknown
			//IL_163d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1647: Expected O, but got Unknown
			//IL_1670: Unknown result type (might be due to invalid IL or missing references)
			//IL_167a: Expected O, but got Unknown
			//IL_16a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_16ad: Expected O, but got Unknown
			//IL_16d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_16e0: Expected O, but got Unknown
			//IL_1709: Unknown result type (might be due to invalid IL or missing references)
			//IL_1713: Expected O, but got Unknown
			//IL_173c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1746: Expected O, but got Unknown
			//IL_176f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1779: Expected O, but got Unknown
			//IL_179e: Unknown result type (might be due to invalid IL or missing references)
			//IL_17a8: Expected O, but got Unknown
			//IL_17d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_17db: Expected O, but got Unknown
			//IL_1804: Unknown result type (might be due to invalid IL or missing references)
			//IL_180e: Expected O, but got Unknown
			//IL_1837: Unknown result type (might be due to invalid IL or missing references)
			//IL_1841: Expected O, but got Unknown
			//IL_186a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1874: Expected O, but got Unknown
			//IL_189d: Unknown result type (might be due to invalid IL or missing references)
			//IL_18a7: Expected O, but got Unknown
			//IL_18d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_18da: Expected O, but got Unknown
			//IL_1911: Unknown result type (might be due to invalid IL or missing references)
			//IL_191b: Expected O, but got Unknown
			//IL_1952: Unknown result type (might be due to invalid IL or missing references)
			//IL_195c: Expected O, but got Unknown
			//IL_1993: Unknown result type (might be due to invalid IL or missing references)
			//IL_199d: Expected O, but got Unknown
			//IL_19c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_19cc: Expected O, but got Unknown
			//IL_1a41: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a4b: Expected O, but got Unknown
			//IL_1a82: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a8c: Expected O, but got Unknown
			//IL_1ac3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1acd: Expected O, but got Unknown
			//IL_1b04: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b0e: Expected O, but got Unknown
			//IL_1b45: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b4f: Expected O, but got Unknown
			//IL_1b74: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b7e: Expected O, but got Unknown
			//IL_1bb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bbf: Expected O, but got Unknown
			//IL_1bf6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c00: Expected O, but got Unknown
			//IL_1c37: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c41: Expected O, but got Unknown
			//IL_1c6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c74: Expected O, but got Unknown
			//IL_1c9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ca7: Expected O, but got Unknown
			//IL_1cd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cda: Expected O, but got Unknown
			//IL_1d03: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d0d: Expected O, but got Unknown
			//IL_1d44: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d4e: Expected O, but got Unknown
			//IL_1d7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d84: Expected O, but got Unknown
			//IL_1dbb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dc5: Expected O, but got Unknown
			//IL_1dee: Unknown result type (might be due to invalid IL or missing references)
			//IL_1df8: Expected O, but got Unknown
			//IL_1e21: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e2b: Expected O, but got Unknown
			//IL_1e54: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e5e: Expected O, but got Unknown
			//IL_1e87: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e91: Expected O, but got Unknown
			//IL_1eba: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ec4: Expected O, but got Unknown
			//IL_1eed: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ef7: Expected O, but got Unknown
			//IL_1f20: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f2a: Expected O, but got Unknown
			//IL_1f4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f59: Expected O, but got Unknown
			Enabled = c.Bind<bool>("1 - Général", "Enabled", true, new ConfigDescription("Active Hati.", (AcceptableValueBase)null, new object[1] { A }));
			ChanceStep = c.Bind<float>("2 - Veille", "ChanceStepPercent", 15f, new ConfigDescription("Chance ajoutée par nuit veillée d'affilée (en %). Nuit 2 = 15 %, nuit 3 = 30 %...", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			ChanceCap = c.Bind<float>("2 - Veille", "ChanceCapPercent", 85f, new ConfigDescription("Plafond de la chance par nuit (en %).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			MinOnlineCoverage = c.Bind<float>("2 - Veille", "MinOnlineCoverage", 0.5f, new ConfigDescription("Part minimale de la nuit avec au moins un joueur connecté pour qu'elle compte.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			WindowStart = c.Bind<float>("2 - Veille", "SpawnWindowStart", 0.15f, new ConfigDescription("Début de la fenêtre d'arrivée, en fraction de la nuit.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			WindowEnd = c.Bind<float>("2 - Veille", "SpawnWindowEnd", 0.55f, new ConfigDescription("Fin de la fenêtre d'arrivée, en fraction de la nuit.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			GiveUpAt = c.Bind<float>("2 - Veille", "GiveUpAt", 0.7f, new ConfigDescription("Si aucune cible valide avant cette fraction de nuit, l'attaque est annulée (le risque reste acquis).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			AttackMinTier = c.Bind<int>("2 - Veille", "AttackMinTier", 1, new ConfigDescription("Palier minimal pour qu'il attaque. En dessous, il ne fait qu'observer.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 8), new object[1] { A }));
			OmenMinVeille = c.Bind<int>("2 - Veille", "OmenMinVeille", 2, new ConfigDescription("Nuits veillées d'affilée avant les fausses apparitions à la lisière.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 20), new object[1] { A }));
			OmenChance = c.Bind<float>("2 - Veille", "OmenChancePercent", 25f, new ConfigDescription("Chance par nuit d'une fausse apparition (en %).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			BaseBehaviour = c.Bind<BaseMode>("2 - Veille", "BaseBehaviour", BaseMode.Perimeter, new ConfigDescription("Comportement quand la cible est dans une base.", (AcceptableValueBase)null, new object[1] { A }));
			BossKeys = c.Bind<string>("2 - Veille", "BossKeys", "", new ConfigDescription("Clés globales des boss, séparées par des virgules, dans l'ordre. Vide = détection automatique.", (AcceptableValueBase)null, new object[1] { A }));
			SpawnMin = c.Bind<float>("3 - Apparition", "MinDistance", 55f, new ConfigDescription("Distance minimale à la cible (m).", (AcceptableValueBase)null, new object[1] { A }));
			SpawnMax = c.Bind<float>("3 - Apparition", "MaxDistance", 85f, new ConfigDescription("Distance maximale à la cible (m).", (AcceptableValueBase)null, new object[1] { A }));
			SpawnFallback = c.Bind<float>("3 - Apparition", "FallbackDistance", 150f, new ConfigDescription("Distance maximale après 30 essais ratés (m).", (AcceptableValueBase)null, new object[1] { A }));
			BaseClearance = c.Bind<float>("3 - Apparition", "BaseClearance", 30f, new ConfigDescription("Distance minimale à une zone de base (m).", (AcceptableValueBase)null, new object[1] { A }));
			BuildClearance = c.Bind<float>("3 - Apparition", "BuildClearance", 20f, new ConfigDescription("Distance minimale à une construction (m).", (AcceptableValueBase)null, new object[1] { A }));
			MaxSlope = c.Bind<float>("3 - Apparition", "MaxSlopeDegrees", 35f, new ConfigDescription("Pente maximale du point d'apparition.", (AcceptableValueBase)null, new object[1] { A }));
			StalkSeconds = c.Bind<float>("3 - Apparition", "StalkSeconds", 25f, new ConfigDescription("Durée de la Traque avant l'attaque (s).", (AcceptableValueBase)null, new object[1] { A }));
			StalkVanishDistance = c.Bind<float>("3 - Apparition", "StalkTriggerDistance", 40f, new ConfigDescription("Approcher plus près pendant la Traque déclenche l'attaque, ou dissipe une fausse apparition (m).", (AcceptableValueBase)null, new object[1] { A }));
			TierHealth = c.Bind<string>("4 - Combat", "HealthByTier", "400,2700,4600,6400,8500,12000,18000,25000,27500", new ConfigDescription("PV de Hati pour les paliers T0 à T8. Par défaut (1.0.4), avec l'équipement du biome en cours au niveau 3-4 : environ 2 min 45 à 3 min en solo jusqu'à T5, 3 min 30 en T6, 4 min en T7-T8 (à deux : ×0,65). Plus dur que le boss suivant jusqu'à la Reine, au niveau de Fader, juste sous Kall, pour laisser Sköll et Mánagarmr au-dessus et faisables (outil : tools/balance.py).", (AcceptableValueBase)null, new object[1] { A }));
			TierBite = c.Bind<string>("4 - Combat", "BiteByTier", "25,70,95,145,150,170,210,245,250", new ConfigDescription("Dégâts de la morsure pour T0 à T8 ; les coups spéciaux en sont des fractions. Par défaut (1.0.4), une morsure qui passe enlève ~27-28 % de la vie d'un joueur équipé du biome en cours (niveau 4) jusqu'à T5, ~32-35 % ensuite ; quelques points de plus au niveau 3.", (AcceptableValueBase)null, new object[1] { A }));
			TierPackCount = c.Bind<string>("4 - Combat", "PackCountByTier", "1,2,2,3,3,3,4,5,5", new ConfigDescription("Loups de la meute d'ombre pour T0 à T8.", (AcceptableValueBase)null, new object[1] { A }));
			TierPackHealth = c.Bind<string>("4 - Combat", "PackHealthByTier", "60,100,150,220,290,400,520,640,660", new ConfigDescription("PV d'un loup de la meute pour T0 à T8.", (AcceptableValueBase)null, new object[1] { A }));
			FrostShare = c.Bind<float>("4 - Combat", "FrostShare", 0.25f, new ConfigDescription("Part de chaque coup convertie en givre (en feu pour Sköll et pour Mánagarmr en posture de feu).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			MaxHitByTier = c.Bind<string>("4 - Combat", "MaxHitPercentByTier", "35,35,35,40,40,40,40,40,40", new ConfigDescription("Plafond d'un coup de Hati et de sa meute, en % de la vie max du joueur touché, pour T0 à T8 (après résistances et armure, feu et givre compris). Protège le joueur qui arrive dans un palier avec l'équipement du précédent : sans plafond, une morsure lui prend ~42 % de sa vie en T1 et ~38 % en T2, contre ~27 % équipé du biome en cours (inchangé). À partir de T3, l'écart n'est plus que de 4 à 8 points : 40 % ne sert que de filet (joueur mal nourri). 0 = pas de plafond.", (AcceptableValueBase)null, new object[1] { A }));
			PackBiteShare = c.Bind<float>("4 - Combat", "PackBiteShare", 0.5f, new ConfigDescription("Dégâts d'un loup de la meute, en part de la morsure de Hati.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), new object[1] { A }));
			BreathTickShare = c.Bind<float>("4 - Combat", "BreathTickShare", 0.08f, new ConfigDescription("Souffle : part de la morsure par bouffée (7 sur un souffle complet). Passe l'armure, pas les résistances ; moitié si le bouclier est levé.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			FieldTickShare = c.Bind<float>("4 - Combat", "FieldTickShare", 0.04f, new ConfigDescription("Sol brûlant, cercle de feu, fissures de lave : part de la morsure toutes les 0,5 s. Passe l'armure, pas la résistance au feu.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			PackCap = c.Bind<int>("4 - Combat", "PackCap", 8, new ConfigDescription("Taille maximale de la meute.", (AcceptableValueBase)null, new object[1] { A }));
			GroupMode = c.Bind<GroupScaling>("4b - Multijoueur", "Mode", GroupScaling.Game, new ConfigDescription("Game = exactement comme les boss du jeu (renfort multijoueur de Valheim, réglages ci-dessous ignorés sauf les loups). Custom = renfort plus fort, avec les pourcentages ci-dessous.", (AcceptableValueBase)null, new object[1] { A }));
			GroupRange = c.Bind<float>("4b - Multijoueur", "PlayerRange", 100f, new ConfigDescription("Mode Custom : les joueurs à moins de cette distance (m) comptent.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(20f, 300f), new object[1] { A }));
			GroupMaxPlayers = c.Bind<int>("4b - Multijoueur", "MaxPlayers", 10, new ConfigDescription("Mode Custom : au-delà de ce nombre de joueurs, plus de renfort.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), new object[1] { A }));
			GroupHealthPercent = c.Bind<float>("4b - Multijoueur", "HealthPerPlayerPercent", 70f, new ConfigDescription("Mode Custom : résistance de Hati et Mánagarmr par joueur en plus (%) ; 70 = il encaisse comme s'il avait +70 % de PV par joueur (le jeu : 30).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 300f), new object[1] { A }));
			GroupDamagePercent = c.Bind<float>("4b - Multijoueur", "DamagePerPlayerPercent", 10f, new ConfigDescription("Mode Custom : dégâts de Hati, Mánagarmr et de la meute par joueur en plus (%) (le jeu : 4).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			GroupPackWolves = c.Bind<int>("4b - Multijoueur", "PackWolvesPerPlayer", 0, new ConfigDescription("Loups d'ombre en plus par joueur en plus à 100 m, au début de la chasse (plafonné par PackCap). 0 = comme le jeu : la meute est renforcée comme tout monstre, pas multipliée.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), new object[1] { A }));
			Mode = c.Bind<SpawnMode>("3 - Apparition", "Mode", SpawnMode.Watcher, new ConfigDescription("Watcher = il est là chaque nuit, immobile au loin, et chasse quiconque entre dans son rayon d'agression (qui grandit avec les nuits veillées). Random = ancien mode, apparition au hasard.", (AcceptableValueBase)null, new object[1] { A }));
			AggroBase = c.Bind<float>("3b - Veilleur", "AggroRadiusBase", 12f, new ConfigDescription("Rayon d'agression sans nuit veillée (m) : il faut presque aller le toucher.", (AcceptableValueBase)null, new object[1] { A }));
			AggroPerNight = c.Bind<float>("3b - Veilleur", "AggroRadiusPerNight", 6.5f, new ConfigDescription("Rayon gagné par nuit veillée d'affilée (m).", (AcceptableValueBase)null, new object[1] { A }));
			AggroMax = c.Bind<float>("3b - Veilleur", "AggroRadiusMax", 40f, new ConfigDescription("Rayon maximal (m).", (AcceptableValueBase)null, new object[1] { A }));
			PostFar = c.Bind<float>("3b - Veilleur", "PostDistanceFar", 95f, new ConfigDescription("Distance de son poste sans nuit veillée (m). Au-delà de ~95 m, le terrain n'est pas toujours chargé : il se rapproche alors de lui-même.", (AcceptableValueBase)null, new object[1] { A }));
			PostPerNight = c.Bind<float>("3b - Veilleur", "PostDistancePerNight", 12f, new ConfigDescription("Mètres dont il se rapproche par nuit veillée d'affilée.", (AcceptableValueBase)null, new object[1] { A }));
			PostNear = c.Bind<float>("3b - Veilleur", "PostDistanceNear", 45f, new ConfigDescription("Distance minimale de son poste (m). Il reste toujours au moins 5 m hors de son rayon.", (AcceptableValueBase)null, new object[1] { A }));
			AttackBase = c.Bind<float>("3b - Veilleur", "AttackChanceBase", 25f, new ConfigDescription("Chance (%) qu'il attaque quand on le provoque (entrer dans son rayon, le frapper), sans nuit veillée. Sinon il se dérobe.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			AttackPerNight = c.Bind<float>("3b - Veilleur", "AttackChancePerNight", 17f, new ConfigDescription("Chance d'attaque gagnée par nuit veillée d'affilée (%).", (AcceptableValueBase)null, new object[1] { A }));
			AttackMax = c.Bind<float>("3b - Veilleur", "AttackChanceMax", 95f, new ConfigDescription("Chance d'attaque maximale (%) avant les dérobades.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			AttackPerFlee = c.Bind<float>("3b - Veilleur", "AttackChancePerRetreat", 20f, new ConfigDescription("Chance d'attaque gagnée à chaque dérobade de la même nuit (%) : il s'enhardit.", (AcceptableValueBase)null, new object[1] { A }));
			AwayMin = c.Bind<float>("3b - Veilleur", "RetreatMinSeconds", 60f, new ConfigDescription("Après une dérobade, il disparaît au moins N secondes avant de revenir plus loin.", (AcceptableValueBase)null, new object[1] { A }));
			AwayMax = c.Bind<float>("3b - Veilleur", "RetreatMaxSeconds", 120f, new ConfigDescription("… et au plus N secondes.", (AcceptableValueBase)null, new object[1] { A }));
			MinHuntSeconds = c.Bind<float>("3b - Veilleur", "MinHuntSeconds", 300f, new ConfigDescription("Une chasse dure au moins N secondes : déclenchée juste avant l'aube, il ne s'enfuit pas aussitôt (5 min : le combat le plus long en solo, Hati T8 en début de palier, prend ~4 min 40).", (AcceptableValueBase)null, new object[1] { A }));
			OvertimeSeconds = c.Bind<float>("3b - Veilleur", "OvertimeSeconds", 180f, new ConfigDescription("Prolongation : un loup qui se bat encore quand son heure de départ arrive (l'aube pour Hati et Mánagarmr, le coucher du soleil pour Sköll) reste jusqu'à N secondes de plus. Le combat doit être engagé ; un loup qui n'a pas encore attaqué part à l'heure. 0 = départ à l'heure.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 900f), new object[1] { A }));
			WatchRelocate = c.Bind<float>("3b - Veilleur", "RelocateSeconds", 75f, new ConfigDescription("Il change de poste environ toutes les N secondes (±25 %), ou dès qu'on s'éloigne trop.", (AcceptableValueBase)null, new object[1] { A }));
			WatchStart = c.Bind<float>("3b - Veilleur", "ArrivalAt", 0.1f, new ConfigDescription("Moment de la nuit où il arrive (0 = tombée à 18 h, 1 = aube à 6 h). 0,1 ≈ 19 h 10, ~55 s réelles après la tombée : le temps que l'obscurité fasse ressortir ses yeux (nuit de 9 min, il reste ~8 min avant l'aube). Ne change rien à la Veille, jugée à l'aube.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.8f), new object[1] { A }));
			BiomeRaisesTier = c.Bind<bool>("3 - Apparition", "BiomeRaisesTier", false, new ConfigDescription("Si vrai, visiter un biome plus avancé monte le palier d'un cran au-dessus des boss vaincus. Faux : le palier ne dépend que des boss vaincus.", (AcceptableValueBase)null, new object[1] { A }));
			Moveset = c.Bind<bool>("4 - Combat", "Moveset", true, new ConfigDescription("Attaques spéciales de Hati (bond, souffle de givre, balayage, piétinement, repli, pas de l'ombre). Désactivé : il ne fait que mordre.", (AcceptableValueBase)null, new object[1] { A }));
			MeleeBites = c.Bind<int>("4 - Combat", "MeleeBitesBeforeDisengage", 2, new ConfigDescription("Morsures au corps à corps avant qu'il rompe le contact pour une attaque à distance.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { A }));
			CameraShake = c.Bind<float>("1 - Général", "CameraShake", 1f, new ConfigDescription("Intensité des tremblements d'écran (0 = aucun, 1 = normal). Réglage local.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>()));
			PackMode = c.Bind<PackStyle>("4 - Combat", "PackStyle", PackStyle.Harass, new ConfigDescription("Harass = la meute encercle sa proie et mord à tour de rôle ; Swarm = IA vanilla, tous mordent en continu.", (AcceptableValueBase)null, new object[1] { A }));
			PackStrikers = c.Bind<int>("4 - Combat", "PackStrikersPerPlayer", 1, new ConfigDescription("Mode Harass : loups qui attaquent en même temps le même joueur (les autres tournent autour).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 8), new object[1] { A }));
			PackRing = c.Bind<float>("4 - Combat", "PackRingRadius", 12f, new ConfigDescription("Mode Harass : rayon du cercle autour de la proie (m).", (AcceptableValueBase)null, new object[1] { A }));
			PackCooldown = c.Bind<float>("4 - Combat", "PackStrikeCooldown", 8f, new ConfigDescription("Mode Harass : repos d'un loup entre deux assauts (s, ±30 %).", (AcceptableValueBase)null, new object[1] { A }));
			PackLeash = c.Bind<float>("4 - Combat", "PackLeash", 40f, new ConfigDescription("La meute ne s'éloigne pas de Hati au-delà de cette distance : fuir loin de lui, c'est la semer (m).", (AcceptableValueBase)null, new object[1] { A }));
			PackRunSpeed = c.Bind<float>("4 - Combat", "PackRunSpeed", 6.5f, new ConfigDescription("Vitesse de course maximale des ombres (m/s ; un joueur qui sprinte fait environ 7). 0 = vitesse du loup.", (AcceptableValueBase)null, new object[1] { A }));
			SoulHealPercent = c.Bind<float>("4 - Combat", "SoulHealPercent", 10f, new ConfigDescription("PV rendus à Hati par le premier joueur mort près de lui pendant un combat (% des PV max). Les suivants rendent moins (SoulHealDecay).", (AcceptableValueBase)null, new object[1] { A }));
			SoulHealDecay = c.Bind<float>("4 - Combat", "SoulHealDecay", 0.5f, new ConfigDescription("Chaque âme suivante rend cette part de la précédente (0,5 : 10 %, 5 %, 2,5 %).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			SoulHealMax = c.Bind<int>("4 - Combat", "SoulHealMax", 3, new ConfigDescription("Âmes au plus par combat ; au-delà, une mort ne le soigne plus.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 20), new object[1] { A }));
			GrudgeHealthPercent = c.Bind<float>("4 - Combat", "GrudgeHealthPercent", 10f, new ConfigDescription("Rancune : PV en plus par aube survécue (%). 0 = il revient tel quel.", (AcceptableValueBase)null, new object[1] { A }));
			GrudgeDamagePercent = c.Bind<float>("4 - Combat", "GrudgeDamagePercent", 5f, new ConfigDescription("Rancune : dégâts en plus par aube survécue (%). L'armure du jeu amplifie les hausses de dégâts (+5 % de dégâts ≈ +10 % encaissés). 0 = il revient tel quel.", (AcceptableValueBase)null, new object[1] { A }));
			GrudgeMax = c.Bind<int>("4 - Combat", "GrudgeMax", 3, new ConfigDescription("Cumul maximal de la rancune (remise à 0 à sa mort ou après une nuit dormie). 0 = pas de rancune.", (AcceptableValueBase)null, new object[1] { A }));
			Scale = c.Bind<float>("4 - Combat", "Scale", 4.5f, new ConfigDescription("Échelle de Hati par rapport au loup (redémarrage requis).", (AcceptableValueBase)null, new object[1] { A }));
			Trees = c.Bind<TreeMode>("4 - Combat", "Trees", TreeMode.Smash, new ConfigDescription("Arbres sur son passage : Smash = il abat les arbres debout pendant la chasse (il les traverse pendant la Traque, près des constructions, et toujours pour les troncs couchés et les souches), Ghost = il traverse tout comme une ombre, Off = les arbres le bloquent.", (AcceptableValueBase)null, new object[1] { A }));
			TreeSafeRadius = c.Bind<float>("4 - Combat", "TreeSafeRadius", 30f, new ConfigDescription("Mode Smash : aucun arbre abattu à moins de cette distance d'une construction ou d'une zone de base (m).", (AcceptableValueBase)null, new object[1] { A }));
			SpeedMultiplier = c.Bind<float>("4 - Combat", "SpeedMultiplier", 1.5f, new ConfigDescription("Multiplicateur de vitesse par rapport au loup (redémarrage requis).", (AcceptableValueBase)null, new object[1] { A }));
			EclipseAt = c.Bind<float>("4 - Combat", "EclipseAtHealth", 0.5f, new ConfigDescription("Fraction de PV sous laquelle il avale la lune.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			HowlInterval = c.Bind<float>("5 - Hurlement", "IntervalSeconds", 45f, new ConfigDescription("Temps entre deux hurlements (s).", (AcceptableValueBase)null, new object[1] { A }));
			FireRadius = c.Bind<float>("5 - Hurlement", "FireRadius", 60f, new ConfigDescription("Rayon d'extinction des feux et des torches (m).", (AcceptableValueBase)null, new object[1] { A }));
			ShockRadius = c.Bind<float>("5 - Hurlement", "ShockRadius", 12f, new ConfigDescription("Rayon de l'onde de choc (m).", (AcceptableValueBase)null, new object[1] { A }));
			DumpModel = c.Bind<bool>("99 - Outils", "DumpModel", false, "Écrit une fois par version le squelette, le maillage et les animations du loup dans BepInEx/config/Hati/dump (pour préparer de nouvelles animations). Réglage local.");
			HowlScreenVeil = c.Bind<bool>("5 - Hurlement", "ScreenVeil", true, "Voile rouge sombre au bord de l'écran quand il hurle près de vous. Réglage local.");
			HowlVolume = c.Bind<float>("5 - Hurlement", "HowlVolume", 1f, new ConfigDescription("Volume du cri (1 = le plus fort possible, deux voix empilées, octave grave, échos). Réglage local.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			ShockShare = c.Bind<float>("5 - Hurlement", "ShockShare", 0.3f, new ConfigDescription("Dégâts de l'onde, en part de la morsure.", (AcceptableValueBase)null, new object[1] { A }));
			FearSeconds = c.Bind<float>("5 - Hurlement", "FearSeconds", 8f, new ConfigDescription("Durée de l'Effroi (s) (redémarrage requis).", (AcceptableValueBase)null, new object[1] { A }));
			FearStaminaRegen = c.Bind<float>("5 - Hurlement", "FearStaminaRegen", 0.7f, new ConfigDescription("Multiplicateur de régénération d'endurance sous Effroi (redémarrage requis).", (AcceptableValueBase)null, new object[1] { A }));
			TorchLockout = c.Bind<float>("5 - Hurlement", "TorchLockoutSeconds", 5f, new ConfigDescription("Délai avant de pouvoir rééquiper une torche (s).", (AcceptableValueBase)null, new object[1] { A }));
			WildFireSeconds = c.Bind<float>("5 - Hurlement", "NonPlayerFireSeconds", 90f, new ConfigDescription("Durée d'extinction des feux qui ne sont pas des constructions de joueur (s).", (AcceptableValueBase)null, new object[1] { A }));
			LightItems = c.Bind<string>("5 - Hurlement", "LightItems", "Torch", new ConfigDescription("Objets tenus en main éteints par le hurlement (noms de prefab, séparés par des virgules).", (AcceptableValueBase)null, new object[1] { A }));
			InsomniaWeight = c.Bind<float>("6 - Ciblage", "InsomniaWeight", 1f, new ConfigDescription("Poids du retard au coucher : chance d'être ciblé = 1 + poids × retard. Retard : +1 au dernier couché d'une nuit dormie (−1 aux autres), +1 à qui reste debout pendant que d'autres attendent au lit.", (AcceptableValueBase)null, new object[1] { A }));
			DeathGraceSeconds = c.Bind<float>("6 - Ciblage", "DeathGraceSeconds", 300f, new ConfigDescription("Un joueur mort depuis moins longtemps n'est pas ciblé (s).", (AcceptableValueBase)null, new object[1] { A }));
			BlockDuringRaids = c.Bind<bool>("6 - Ciblage", "BlockDuringRaids", true, new ConfigDescription("Pas d'apparition pendant un raid vanilla en cours.", (AcceptableValueBase)null, new object[1] { A }));
			BossFightRange = c.Bind<float>("6 - Ciblage", "BossFightRange", 150f, new ConfigDescription("Pas d'apparition si un boss vanilla est vivant à cette distance de la cible (m).", (AcceptableValueBase)null, new object[1] { A }));
			PackHuntsLivestock = c.Bind<bool>("7 - Meute et ambiance", "PackHuntsLivestock", true, new ConfigDescription("Si personne n'est dehors, la meute s'en prend aux animaux apprivoisés.", (AcceptableValueBase)null, new object[1] { A }));
			LivestockRange = c.Bind<float>("7 - Meute et ambiance", "LivestockRange", 45f, new ConfigDescription("Distance de détection du bétail par la meute (m).", (AcceptableValueBase)null, new object[1] { A }));
			MusicName = c.Bind<string>("7 - Meute et ambiance", "MusicName", "", "Musique de la chasse (nom d'une musique du jeu). Vide = choix automatique ; les noms disponibles sont dans le journal.");
			FieldMist = c.Bind<bool>("7 - Meute et ambiance", "HuntMist", true, "Brume légère au ras du sol autour de toi pendant la chasse et l'éclipse. Réglage local.");
			CleanIdles = c.Bind<bool>("7 - Meute et ambiance", "NoDogIdles", true, "Hati et sa meute gardent les animations du loup d'origine, sans ses attentes de chien domestique (se gratter, s'étirer, manger) : à la place, il reste debout à respirer et à regarder autour de lui. Pris en compte au lancement du jeu. Réglage local.");
			BossSkin = c.Bind<bool>("7 - Meute et ambiance", "BossSkin", true, "Peau de boss : pelage repeint (Hati : runes gravées ; Sköll : fissures de braise ; Mánagarmr : les deux), grands crocs, griffes, collier de fer clouté avec une chaîne brisée ; cornes, plaque frontale, épaulières et pointes de queue pour Sköll et Mánagarmr. Pris en compte au lancement du jeu. Réglage local.");
			BossRunes = c.Bind<bool>("7 - Meute et ambiance", "BossRunes", true, "Runes et croissant de lune gravés sur Hati (bleu pâle), fissures de braise sur Sköll (orange), les deux sur Mánagarmr : elles s'allument pendant la chasse et flamboient pendant le hurlement. Pris en compte au lancement du jeu. Réglage local.");
			NewLeaps = c.Bind<bool>("7 - Meute et ambiance", "NewLeaps", true, "Bond, saut en arrière et souffle de givre refaits. Bond et repli : préparation ramassée, détente des pattes arrière, corps qui suit la trajectoire, réception l'avant puis l'arrière avec compression et petit rebond. Souffle : il inspire, se met en garde gueule grande ouverte, puis souffle sans bouger les pattes en balayant de la tête les joueurs devant lui ; le givre sort de sa gueule et les dégâts suivent l'axe de la tête. false = anciennes poses. Réglage local.");
			ProceduralAnim = c.Bind<bool>("7 - Meute et ambiance", "ProceduralAnimations", false, "Expérimental, déconseillé : remplace toutes les animations du loup par des animations calculées en direct. false = animations d'origine (recommandé). Réglage local.");
			FootIK = c.Bind<bool>("7 - Meute et ambiance", "FootPlacement", true, "Les pattes de Hati se posent sur le relief (pentes, rochers, marches) au lieu de flotter ou de s'enfoncer ; son corps s'incline avec la pente. Réglage local.");
			FootIKMax = c.Bind<float>("7 - Meute et ambiance", "FootPlacementMax", 0.4f, new ConfigDescription("Correction maximale d'une patte, en part de sa longueur (au-delà, elle ne cherche plus le sol). Réglage local.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 0.6f), Array.Empty<object>()));
			MoonDisc = c.Bind<bool>("7 - Meute et ambiance", "BloodMoonDisc", true, "Pendant la chasse, la lune devient rouge sang, puis noire cerclée de feu pendant l'éclipse. Réglage local.");
			MoonSize = c.Bind<float>("7 - Meute et ambiance", "BloodMoonSize", 5.2f, "Diamètre apparent du disque rouge en degrés : à ajuster s'il ne recouvre pas exactement la lune du jeu. Réglage local.");
			GhostOpacity = c.Bind<float>("7 - Meute et ambiance", "WatcherShadowOpacity", 0.18f, new ConfigDescription("Opacité de l'ombre du loup quand il guette au loin (0 = seulement les yeux, 1 = silhouette pleine). Elle pâlit encore avec la distance. Réglage local.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			GlowThroughLeaves = c.Bind<float>("7 - Meute et ambiance", "EyeGlowThroughLeaves", 0.35f, new ConfigDescription("Part de la lueur des yeux qui perce le feuillage (jamais le relief, les troncs ni les constructions). 0 = aucune. Réglage local.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			GleipnirRecipe = c.Bind<string>("8 - Objets", "GleipnirRecipe", "Feathers:10,LinenThread:5,Obsidian:5,LeatherScraps:10,Ooze:5,Honey:5", new ConfigDescription("Recette de Gleipnir (objet:quantité). Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			GleipnirStation = c.Bind<string>("8 - Objets", "GleipnirStation", "forge", new ConfigDescription("Atelier de Gleipnir.", (AcceptableValueBase)null, new object[1] { A }));
			GleipnirSeconds = c.Bind<float>("8 - Objets", "GleipnirSeconds", 8f, new ConfigDescription("Durée de l'entrave (s).", (AcceptableValueBase)null, new object[1] { A }));
			GleipnirHealth = c.Bind<float>("8 - Objets", "GleipnirHealthThreshold", 0.25f, new ConfigDescription("Gleipnir ne prend que sous cette fraction de PV.", (AcceptableValueBase)null, new object[1] { A }));
			GleipnirDamageBonus = c.Bind<float>("8 - Objets", "GleipnirDamageBonus", 0.25f, new ConfigDescription("Dégâts supplémentaires subis par Hati entravé.", (AcceptableValueBase)null, new object[1] { A }));
			GleipnirRange = c.Bind<float>("8 - Objets", "GleipnirRange", 12f, new ConfigDescription("Portée de Gleipnir (m).", (AcceptableValueBase)null, new object[1] { A }));
			SunstoneRecipe = c.Bind<string>("8 - Objets", "SunstoneRecipe", "Crystal:3,SurtlingCore:2,Resin:5", new ConfigDescription("Recette du Sólarsteinn. Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			SunstoneStation = c.Bind<string>("8 - Objets", "SunstoneStation", "piece_workbench", new ConfigDescription("Atelier du Sólarsteinn.", (AcceptableValueBase)null, new object[1] { A }));
			SunstoneStun = c.Bind<float>("8 - Objets", "SunstoneStunSeconds", 2f, new ConfigDescription("Étourdissement (s).", (AcceptableValueBase)null, new object[1] { A }));
			SunstoneReveal = c.Bind<float>("8 - Objets", "SunstoneRevealSeconds", 20f, new ConfigDescription("Durée de la révélation (s).", (AcceptableValueBase)null, new object[1] { A }));
			SunstoneRange = c.Bind<float>("8 - Objets", "SunstoneRange", 30f, new ConfigDescription("Portée du Sólarsteinn (m).", (AcceptableValueBase)null, new object[1] { A }));
			EyeRecipe = c.Bind<string>("8 - Objets", "EyeRecipe", "TrophyHati:1,Honey:5,Crystal:1", new ConfigDescription("Recette de l'Œil de Hati. Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			EyeStation = c.Bind<string>("8 - Objets", "EyeStation", "piece_cauldron", new ConfigDescription("Atelier de l'Œil de Hati.", (AcceptableValueBase)null, new object[1] { A }));
			EyeAmount = c.Bind<int>("8 - Objets", "EyeAmount", 3, new ConfigDescription("Doses par fabrication.", (AcceptableValueBase)null, new object[1] { A }));
			EyeSeconds = c.Bind<float>("8 - Objets", "EyeSeconds", 300f, new ConfigDescription("Durée de l'Œil de Hati (s). Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			CapeRecipe = c.Bind<string>("8 - Objets", "CapeRecipe", "HatiPelt:4:2,WolfPelt:4:2,Silver:6:2", new ConfigDescription("Recette de la Cape de Hati (objet:quantité:par niveau). Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			CapeStation = c.Bind<string>("8 - Objets", "CapeStation", "piece_workbench", new ConfigDescription("Atelier de la cape.", (AcceptableValueBase)null, new object[1] { A }));
			CapeSneak = c.Bind<float>("8 - Objets", "CapeSneakBonus", 15f, new ConfigDescription("Bonus de Discrétion de la cape. Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			SkollCapeRecipe = c.Bind<string>("8 - Objets", "SkollCapeRecipe", "SkollPelt:4:2,HatiPelt:2:1,SurtlingCore:2:1", new ConfigDescription("Recette de la Cape de Sköll, résistante au feu (objet:quantité:par niveau), au même atelier que la Cape de Hati. Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			ArmorPelts = c.Bind<string>("8a - Armure de Hati", "PeltsHelmChestLegs", "4,6,5", new ConfigDescription("Fourrures de Hati pour fabriquer heaume, cuirasse, jambières avec la recette « fourrure » (l'autre recette prend la pièce du palier précédent). Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			SetSpeedDay = c.Bind<float>("8a - Armure de Hati", "SetSpeedDayPercent", 7f, new ConfigDescription("Ensemble complet : vitesse en plus le jour (%). Les pièces n'ont aucun malus de vitesse.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			SetSpeedNight = c.Bind<float>("8a - Armure de Hati", "SetSpeedNightPercent", 15f, new ConfigDescription("Ensemble complet : vitesse en plus la nuit (%).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			SetStaminaRegenNight = c.Bind<float>("8a - Armure de Hati", "SetStaminaRegenNightPercent", 25f, new ConfigDescription("Ensemble complet : endurance récupérée en plus la nuit (%).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), new object[1] { A }));
			StepEnabled = c.Bind<bool>("8b - Pas de l’ombre", "Enabled", true, new ConfigDescription("Pouvoir de l'ensemble complet de l'armure de Hati : un bond à travers l'ombre.", (AcceptableValueBase)null, new object[1] { A }));
			StepKey = c.Bind<KeyCode>("8b - Pas de l’ombre", "Key", (KeyCode)308, "Touche du Pas de l'ombre. Exemples : LeftAlt, B, Mouse3 (bouton latéral de la souris), JoystickButton9 (manette). Réglage local.");
			StepKeyAlt = c.Bind<KeyCode>("8b - Pas de l’ombre", "AltKey", (KeyCode)326, "Seconde touche (None = aucune). Réglage local.");
			StepDistance = c.Bind<float>("8b - Pas de l’ombre", "Distance", 8f, new ConfigDescription("Longueur maximale du pas (m). Il s'arrête avant un mur, un tronc ou un rocher.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 15f), new object[1] { A }));
			StepCooldownDay = c.Bind<float>("8b - Pas de l’ombre", "CooldownDay", 20f, new ConfigDescription("Recharge le jour (s).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 120f), new object[1] { A }));
			StepCooldownNight = c.Bind<float>("8b - Pas de l’ombre", "CooldownNight", 12f, new ConfigDescription("Recharge la nuit (s).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 120f), new object[1] { A }));
			StepStamina = c.Bind<float>("8b - Pas de l’ombre", "Stamina", 20f, new ConfigDescription("Endurance consommée (une roulade : 15).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			StepInvulnAfter = c.Bind<float>("8b - Pas de l’ombre", "InvulnerableAfter", 0.25f, new ConfigDescription("Invulnérabilité aux coups esquivables après la réapparition (s), en plus des 0,16 s passées dans l'ombre.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { A }));
			ChainEnabled = c.Bind<bool>("9 - Sköll", "Enabled", true, new ConfigDescription("La chaîne des trois loups : après une victoire sur Hati, Sköll peut venir le lendemain ; après Sköll, Mánagarmr vient à coup sûr. false = Hati seul.", (AcceptableValueBase)null, new object[1] { A }));
			SkollChanceBase = c.Bind<float>("9 - Sköll", "ChanceFirst", 15f, new ConfigDescription("Chance que Sköll vienne le lendemain de la première victoire sur Hati (%).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			SkollChanceStep = c.Bind<float>("9 - Sköll", "ChancePerKill", 15f, new ConfigDescription("Points de chance en plus par victoire sur Hati sans venue de Sköll (15, 30, 45… jusqu'à 100 %).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { A }));
			SkollArriveAt = c.Bind<float>("9 - Sköll", "ArriveAt", 0.5f, new ConfigDescription("Heure de son arrivée, en fraction du jour (0,5 = midi). Il repart au coucher du soleil (0,75).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 0.7f), new object[1] { A }));
			SkollHealthByTier = c.Bind<string>("9 - Sköll", "HealthMultiplierByTier", "1.25,1.4,1.25,1.25,1.25,1.25,1.5,1.4,1.35", new ConfigDescription("PV par rapport à Hati au même palier, pour T0 à T8 (1.0.4 : environ 3 min 45 en solo jusqu'à T5, 5 min 15 à 5 min 45 ensuite).", (AcceptableValueBase)null, new object[1] { A }));
			SkollDamageByTier = c.Bind<string>("9 - Sköll", "DamageMultiplierByTier", "1.1,1.1,1.1,0.95,1.1,1.1,1.05,1.1,1.05", new ConfigDescription("Dégâts par rapport à Hati au même palier, pour T0 à T8 (une morsure enlève ~33 % de la vie jusqu'à T5, ~35-42 % ensuite ; T3 plus bas : son feu n'est pas freiné par l'armure de loup, le givre de Hati si).", (AcceptableValueBase)null, new object[1] { A }));
			SkollMaxHitByTier = c.Bind<string>("9 - Sköll", "MaxHitPercentByTier", "40,40,40,45,45,45,45,45,45", new ConfigDescription("Plafond d'un coup de Sköll et de sa meute, en % de la vie max du joueur touché, pour T0 à T8 (sans plafond : ~48 % en T1 et ~45 % en T2 avec l'équipement du palier précédent, ~33 % équipé). 0 = pas de plafond.", (AcceptableValueBase)null, new object[1] { A }));
			SkollScale = c.Bind<float>("9 - Sköll", "ScaleMultiplier", 1.1f, new ConfigDescription("Taille par rapport à Hati. Redémarrage requis.", (AcceptableValueBase)null, new object[1] { A }));
			FireFieldSeconds = c.Bind<float>("9 - Sköll", "BurningGroundSeconds", 5f, new ConfigDescription("Durée du sol brûlant (souffle de flammes), du cercle de feu (bond) et des fissures de lave (piétinement), en secondes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15f), new object[1] { A }));
			ManagarmrDelayDays = c.Bind<int>("9 - Mánagarmr", "DaysAfterSkoll", 3, new ConfigDescription("Jours entre la victoire sur Sköll et la venue de Mánagarmr (il arrive au crépuscule du dernier). Présages : des loups hurlent en plein jour l'avant-veille, le soleil et la lune pâles ensemble la veille.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { A }));
			ManagarmrArriveAt = c.Bind<float>("9 - Mánagarmr", "ArriveAt", 0.7f, new ConfigDescription("Heure de son arrivée, en fraction du jour (0,7 = crépuscule ; la nuit tombe à 0,75).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.55f, 0.74f), new object[1] { A }));
			ManagarmrStances = c.Bind<string>("9 - Mánagarmr", "StanceSwitchAt", "0.75,0.5,0.25", new ConfigDescription("Fractions de PV où il change de posture (glace ↔ feu). En glace, ses runes s'allument et il craint le feu ; en feu, ses braises s'allument et il craint le givre.", (AcceptableValueBase)null, new object[1] { A }));
			ManagarmrHealthByTier = c.Bind<string>("9 - Mánagarmr", "HealthMultiplierByTier", "1.8,2,1.8,1.9,1.9,1.9,2,1.95,1.9", new ConfigDescription("PV par rapport à Hati au même palier, pour T0 à T8 (1.0.4 : la finale, longue : 5 min 30 en solo jusqu'à T5, 7 à 8 min ensuite ; 3 min 30 à 5 min à deux).", (AcceptableValueBase)null, new object[1] { A }));
			ManagarmrDamageByTier = c.Bind<string>("9 - Mánagarmr", "DamageMultiplierByTier", "1.1,1.15,1.1,1.05,1.1,1.15,1.1,1.1,1.05", new ConfigDescription("Dégâts par rapport à Hati au même palier, pour T0 à T8 (une morsure enlève ~35-40 % de la vie : long, mais pas brutal).", (AcceptableValueBase)null, new object[1] { A }));
			ManagarmrSoulHeal = c.Bind<float>("9 - Mánagarmr", "SoulHealPercent", 15f, new ConfigDescription("PV rendus par le premier joueur mort (%), dégressif comme pour Hati.", (AcceptableValueBase)null, new object[1] { A }));
			ManagarmrEclipseAt = c.Bind<float>("9 - Mánagarmr", "EclipseAtHealth", 0.75f, new ConfigDescription("Il avale la lune plus tôt.", (AcceptableValueBase)null, new object[1] { A }));
			ManagarmrMaxHitByTier = c.Bind<string>("9 - Mánagarmr", "MaxHitPercentByTier", "40,40,40,45,45,45,45,45,45", new ConfigDescription("Plafond d'un coup de Mánagarmr et de sa meute, en % de la vie max du joueur touché, pour T0 à T8 (sans plafond : ~51 % en T1 et ~45 % en T2 avec l'équipement du palier précédent, ~35 % équipé). 0 = pas de plafond.", (AcceptableValueBase)null, new object[1] { A }));
			ManagarmrScale = c.Bind<float>("9 - Mánagarmr", "ScaleMultiplier", 1.25f, new ConfigDescription("Taille par rapport à Hati.", (AcceptableValueBase)null, new object[1] { A }));
			AllowClientCommands = c.Bind<bool>("10 - Debug", "AllowClientCommands", false, new ConfigDescription("Autorise les commandes hati_* venant d'un client non admin.", (AcceptableValueBase)null, new object[1] { A }));
			VerboseLog = c.Bind<bool>("10 - Debug", "VerboseLog", true, "Journal détaillé dans LogOutput.log.");
			ConfigRevision = c.Bind<int>("10 - Debug", "ConfigRevision", 0, "Ne pas modifier : sert à appliquer les nouveaux réglages par défaut après une mise à jour.");
			if (ConfigRevision.Value < 3)
			{
				ConfigEntryBase[] array = (ConfigEntryBase[])(object)new ConfigEntryBase[5]
				{
					(ConfigEntryBase)AggroBase,
					(ConfigEntryBase)AggroPerNight,
					(ConfigEntryBase)AggroMax,
					(ConfigEntryBase)AttackBase,
					(ConfigEntryBase)AttackPerNight
				};
				foreach (ConfigEntryBase obj in array)
				{
					obj.BoxedValue = obj.DefaultValue;
				}
				ConfigRevision.Value = 3;
			}
			if (ConfigRevision.Value < 4)
			{
				((ConfigEntryBase)CapeRecipe).BoxedValue = ((ConfigEntryBase)CapeRecipe).DefaultValue;
				ConfigRevision.Value = 4;
			}
			if (ConfigRevision.Value < 5)
			{
				((ConfigEntryBase)SetSpeedNight).BoxedValue = ((ConfigEntryBase)SetSpeedNight).DefaultValue;
				ConfigRevision.Value = 5;
			}
			if (ConfigRevision.Value < 6)
			{
				((ConfigEntryBase)CapeRecipe).BoxedValue = ((ConfigEntryBase)CapeRecipe).DefaultValue;
				ConfigRevision.Value = 6;
			}
			if (ConfigRevision.Value < 7)
			{
				((ConfigEntryBase)SetSpeedDay).BoxedValue = ((ConfigEntryBase)SetSpeedDay).DefaultValue;
				((ConfigEntryBase)SetSpeedNight).BoxedValue = ((ConfigEntryBase)SetSpeedNight).DefaultValue;
				ConfigRevision.Value = 7;
			}
			if (ConfigRevision.Value < 8)
			{
				((ConfigEntryBase)GroupPackWolves).BoxedValue = ((ConfigEntryBase)GroupPackWolves).DefaultValue;
				ConfigRevision.Value = 8;
			}
			if (ConfigRevision.Value < 9)
			{
				ConfigEntryBase[] array = (ConfigEntryBase[])(object)new ConfigEntryBase[3]
				{
					(ConfigEntryBase)GrudgeHealthPercent,
					(ConfigEntryBase)GrudgeDamagePercent,
					(ConfigEntryBase)GrudgeMax
				};
				foreach (ConfigEntryBase obj2 in array)
				{
					obj2.BoxedValue = obj2.DefaultValue;
				}
				ConfigRevision.Value = 9;
			}
			if (ConfigRevision.Value < 10)
			{
				ConfigEntryBase[] array = (ConfigEntryBase[])(object)new ConfigEntryBase[3]
				{
					(ConfigEntryBase)GrudgeHealthPercent,
					(ConfigEntryBase)GrudgeDamagePercent,
					(ConfigEntryBase)GrudgeMax
				};
				foreach (ConfigEntryBase obj3 in array)
				{
					obj3.BoxedValue = obj3.DefaultValue;
				}
				ConfigRevision.Value = 10;
			}
			if (ConfigRevision.Value < 11)
			{
				ProceduralAnim.Value = false;
				CleanIdles.Value = true;
				NewLeaps.Value = true;
				DumpModel.Value = false;
				ConfigRevision.Value = 11;
			}
			if (ConfigRevision.Value < 12)
			{
				((ConfigEntryBase)ManagarmrEclipseAt).BoxedValue = ((ConfigEntryBase)ManagarmrEclipseAt).DefaultValue;
				ConfigRevision.Value = 12;
			}
			if (ConfigRevision.Value < 13)
			{
				if ((TierHealth.Value ?? "").Replace(" ", "") == "400,900,1800,3000,4500,6500,9000,12000,15000")
				{
					((ConfigEntryBase)TierHealth).BoxedValue = ((ConfigEntryBase)TierHealth).DefaultValue;
				}
				ConfigRevision.Value = 13;
			}
			if (ConfigRevision.Value < 14)
			{
				string text = (TierHealth.Value ?? "").Replace(" ", "");
				if (text == "400,900,1800,3000,4500,6500,9000,12000,15000" || text == "400,2500,5000,7500,10000,12500,25000,47000,58750")
				{
					((ConfigEntryBase)TierHealth).BoxedValue = ((ConfigEntryBase)TierHealth).DefaultValue;
				}
				if ((TierBite.Value ?? "").Replace(" ", "") == "25,35,50,65,80,95,110,125,140")
				{
					((ConfigEntryBase)TierBite).BoxedValue = ((ConfigEntryBase)TierBite).DefaultValue;
				}
				ConfigRevision.Value = 14;
			}
			if (ConfigRevision.Value < 15)
			{
				Reset((ConfigEntryBase)(object)TierHealth, new string[3] { "400,900,1800,3000,4500,6500,9000,12000,15000", "400,2500,5000,7500,10000,12500,25000,47000,58750", "400,3750,7500,11250,15000,18750,37500,47000,58750" });
				Reset((ConfigEntryBase)(object)TierBite, new string[2] { "25,35,50,65,80,95,110,125,140", "25,60,95,120,150,165,190,220,250" });
				Reset((ConfigEntryBase)(object)TierPackHealth, new string[1] { "60,120,200,320,450,600,800,1000,1200" });
				Reset((ConfigEntryBase)(object)GrudgeHealthPercent, new string[1] { "15" });
				Reset((ConfigEntryBase)(object)GrudgeDamagePercent, new string[1] { "10" });
				Reset((ConfigEntryBase)(object)ManagarmrSoulHeal, new string[1] { "25" });
				ConfigRevision.Value = 15;
			}
			if (ConfigRevision.Value < 16)
			{
				Reset16((ConfigEntryBase)(object)TierHealth, new string[4] { "400,900,1800,3000,4500,6500,9000,12000,15000", "400,2500,5000,7500,10000,12500,25000,47000,58750", "400,3750,7500,11250,15000,18750,37500,47000,58750", "400,2500,4200,6400,8500,11000,15500,19000,21500" });
				Reset16((ConfigEntryBase)(object)TierBite, new string[3] { "25,35,50,65,80,95,110,125,140", "25,60,95,120,150,165,190,220,250", "25,68,95,132,147,155,185,217,225" });
				Reset16((ConfigEntryBase)(object)TierPackCount, new string[1] { "1,2,2,3,3,3,4,4,4" });
				ConfigRevision.Value = 16;
			}
			if (ConfigRevision.Value < 17)
			{
				if (Math.Abs(WatchStart.Value - 0.4f) < 0.001f)
				{
					((ConfigEntryBase)WatchStart).BoxedValue = ((ConfigEntryBase)WatchStart).DefaultValue;
				}
				if (Math.Abs(MinHuntSeconds.Value - 120f) < 0.001f)
				{
					((ConfigEntryBase)MinHuntSeconds).BoxedValue = ((ConfigEntryBase)MinHuntSeconds).DefaultValue;
				}
				ConfigRevision.Value = 17;
			}
			static void Reset(ConfigEntryBase e, string[] olds)
			{
				string text2 = (e.BoxedValue?.ToString() ?? "").Replace(" ", "").Replace(',', '.');
				foreach (string text3 in olds)
				{
					if (text2 == text3.Replace(" ", "").Replace(',', '.'))
					{
						e.BoxedValue = e.DefaultValue;
						break;
					}
				}
			}
			static void Reset16(ConfigEntryBase e, string[] olds)
			{
				string text2 = (e.BoxedValue?.ToString() ?? "").Replace(" ", "");
				foreach (string text3 in olds)
				{
					if (text2 == text3.Replace(" ", ""))
					{
						e.BoxedValue = e.DefaultValue;
						break;
					}
				}
			}
		}

		public static float[] StanceThresholds()
		{
			string text = ManagarmrStances?.Value ?? "";
			if (text == _stanceSrc)
			{
				return _stances;
			}
			_stanceSrc = text;
			_stances = (from x in text.Split(',')
				select (!float.TryParse(x.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) ? (-1f) : result into v
				where v > 0f && v < 1f
				orderby v descending
				select v).ToArray();
			return _stances;
		}

		public static float TierValue(ConfigEntry<string> entry, int tier, float fallback)
		{
			string[] array = (from s in (entry.Value ?? "").Split(',')
				select s.Trim() into s
				where s.Length > 0
				select s).ToArray();
			if (array.Length == 0)
			{
				return fallback;
			}
			int num = Math.Max(0, Math.Min(tier, array.Length - 1));
			if (!float.TryParse(array[num], NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
			{
				return fallback;
			}
			return result;
		}

		public static List<(string item, int amount, int perLevel)> ParseRecipe(string s)
		{
			List<(string, int, int)> list = new List<(string, int, int)>();
			string[] array = (s ?? "").Split(',');
			for (int i = 0; i < array.Length; i++)
			{
				string[] array2 = array[i].Split(':');
				if (array2.Length >= 2 && array2[0].Trim().Length != 0)
				{
					int.TryParse(array2[1].Trim(), out var result);
					int result2 = 0;
					if (array2.Length > 2)
					{
						int.TryParse(array2[2].Trim(), out result2);
					}
					list.Add((array2[0].Trim(), Math.Max(1, result), Math.Max(0, result2)));
				}
			}
			return list;
		}

		public static bool IsLightItem(string prefabName)
		{
			if (string.IsNullOrEmpty(prefabName))
			{
				return false;
			}
			return (LightItems.Value ?? "").Split(',').Any((string s) => s.Trim().Equals(prefabName, StringComparison.OrdinalIgnoreCase));
		}
	}
	[HarmonyPatch(typeof(Character), "Damage")]
	internal static class CombatPatches
	{
		internal static bool SkipScaling;

		private static bool Prefix(Character __instance, HitData hit)
		{
			if (hit == null)
			{
				return true;
			}
			HatiController component = ((Component)__instance).GetComponent<HatiController>();
			if (Object.op_Implicit((Object)(object)component) && component.Fake)
			{
				component.Command(9);
				return false;
			}
			if (Object.op_Implicit((Object)(object)component) && component.Watching)
			{
				component.Command(10);
				return false;
			}
			if (Object.op_Implicit((Object)(object)component) && component.Spectral)
			{
				return false;
			}
			if (Object.op_Implicit((Object)(object)component) && component.Bound)
			{
				((DamageTypes)(ref hit.m_damage)).Modify(1f + Cfg.GleipnirDamageBonus.Value);
			}
			if (SkipScaling)
			{
				return true;
			}
			Character attacker = hit.GetAttacker();
			if (!Object.op_Implicit((Object)(object)attacker))
			{
				return true;
			}
			HatiController component2 = ((Component)attacker).GetComponent<HatiController>();
			float damageMult;
			bool fire;
			if (Object.op_Implicit((Object)(object)component2))
			{
				damageMult = component2.DamageMult;
				fire = component2.Fire;
			}
			else
			{
				ShadowWolf component3 = ((Component)attacker).GetComponent<ShadowWolf>();
				if (!Object.op_Implicit((Object)(object)component3))
				{
					return true;
				}
				damageMult = component3.DamageMult;
				fire = component3.Fire;
			}
			float value = Cfg.FrostShare.Value;
			float totalDamage = ((DamageTypes)(ref hit.m_damage)).GetTotalDamage();
			((DamageTypes)(ref hit.m_damage)).Modify(damageMult * (1f - value));
			if (fire)
			{
				hit.m_damage.m_fire += totalDamage * damageMult * value;
			}
			else
			{
				hit.m_damage.m_frost += totalDamage * damageMult * value;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(Player), "DoDamageCameraShake")]
	internal static class DamageShakePatch
	{
		internal const float HatiFactor = 0.1f;

		private static bool Prefix(Player __instance, HitData hit)
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			Character val = ((hit != null) ? hit.GetAttacker() : null);
			if (!Object.op_Implicit((Object)(object)val) || (!Object.op_Implicit((Object)(object)((Component)val).GetComponent<HatiController>()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponent<ShadowWolf>())))
			{
				return true;
			}
			float totalStaggerDamage = ((DamageTypes)(ref hit.m_damage)).GetTotalStaggerDamage();
			if (totalStaggerDamage > 0f && Object.op_Implicit((Object)(object)GameCamera.instance))
			{
				float num = Mathf.Clamp01(totalStaggerDamage / Mathf.Max(1f, ((Character)__instance).GetMaxHealth()));
				GameCamera.instance.AddShake(((Component)__instance).transform.position, 50f, __instance.m_baseCameraShake * num * 0.1f * Cfg.CameraShake.Value, false);
			}
			return false;
		}
	}
	internal static class HatiFamily
	{
		[ThreadStatic]
		internal static bool VictimIsHati;

		[ThreadStatic]
		internal static bool VictimIsBoss;

		[ThreadStatic]
		internal static bool AttackerIsHati;

		[ThreadStatic]
		internal static Character DamageVictim;

		internal static bool Is(Character c)
		{
			if (Object.op_Implicit((Object)(object)c))
			{
				if (!Object.op_Implicit((Object)(object)((Component)c).GetComponent<HatiController>()))
				{
					return Object.op_Implicit((Object)(object)((Component)c).GetComponent<ShadowWolf>());
				}
				return true;
			}
			return false;
		}

		internal static int PlayersNear(Vector3 pos)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			float value = Cfg.GroupRange.Value;
			foreach (Player allPlayer in Player.GetAllPlayers())
			{
				if (Object.op_Implicit((Object)(object)allPlayer) && !((Character)allPlayer).IsDead() && Geo.FlatDistance(((Component)allPlayer).transform.position, pos) <= value)
				{
					num++;
				}
			}
			return Mathf.Clamp(num, 1, Math.Max(1, Cfg.GroupMaxPlayers.Value));
		}

		internal static float HealthScale(Vector3 pos)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			return 1f + Cfg.GroupHealthPercent.Value / 100f * (float)(PlayersNear(pos) - 1);
		}

		internal static float DamageScale(Vector3 pos)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			return 1f + Cfg.GroupDamagePercent.Value / 100f * (float)(PlayersNear(pos) - 1);
		}
	}
	[HarmonyPatch]
	internal static class ApplyDamageScopePatch
	{
		private static MethodBase TargetMethod()
		{
			return Reflect.Find(typeof(Character), "ApplyDamage", typeof(HitData));
		}

		private static bool Prepare()
		{
			return TargetMethod() != null;
		}

		private static void Prefix(Character __instance)
		{
			HatiFamily.VictimIsHati = HatiFamily.Is(__instance);
			HatiFamily.VictimIsBoss = Object.op_Implicit((Object)(object)__instance) && Object.op_Implicit((Object)(object)((Component)__instance).GetComponent<HatiController>());
		}

		private static void Finalizer()
		{
			HatiFamily.VictimIsHati = false;
			HatiFamily.VictimIsBoss = false;
		}
	}
	[HarmonyPatch]
	internal static class RpcDamageScopePatch
	{
		private static MethodBase TargetMethod()
		{
			return Reflect.Find(typeof(Character), "RPC_Damage", typeof(long));
		}

		private static bool Prepare()
		{
			return TargetMethod() != null;
		}

		private static void Prefix(Character __instance, object[] __args)
		{
			HitData val = (HitData)((__args != null && __args.Length > 1) ? /*isinst with value type is only supported in some contexts*/: null);
			HatiFamily.AttackerIsHati = val != null && HatiFamily.Is(val.GetAttacker());
			HatiFamily.DamageVictim = (HatiFamily.AttackerIsHati ? __instance : null);
		}

		private static void Finalizer()
		{
			HatiFamily.AttackerIsHati = false;
			HatiFamily.DamageVictim = null;
		}
	}
	[HarmonyPatch(typeof(HitData), "ApplyArmor", new Type[] { typeof(float) })]
	internal static class HitCapPatch
	{
		private static float _logAt;

		private static void Postfix(HitData __instance)
		{
			if (!HatiFamily.AttackerIsHati || __instance == null)
			{
				return;
			}
			Character damageVictim = HatiFamily.DamageVictim;
			Player val = (Player)(object)((damageVictim is Player) ? damageVictim : null);
			if (!Object.op_Implicit((Object)(object)val) || (Object)(object)val != (Object)(object)Player.m_localPlayer)
			{
				return;
			}
			int tier;
			string who;
			float num = Percent(__instance.GetAttacker(), out tier, out who);
			if (num <= 0f)
			{
				return;
			}
			float num2 = ((Character)val).GetMaxHealth() * num / 100f;
			float totalDamage = ((DamageTypes)(ref __instance.m_damage)).GetTotalDamage();
			if (!(num2 <= 0f) && !(totalDamage <= num2))
			{
				((DamageTypes)(ref __instance.m_damage)).Modify(num2 / totalDamage);
				if (Time.time >= _logAt)
				{
					_logAt = Time.time + 5f;
					Log.Info($"Coup plafonné ({who} T{tier}) : {totalDamage:0.#} → {num2:0.#} ({num:0} % de {((Character)val).GetMaxHealth():0} PV)");
				}
			}
		}

		internal static float Percent(Character attacker, out int tier, out string who)
		{
			tier = HatiRuntime.KnownTier;
			who = "Hati";
			if (!Object.op_Implicit((Object)(object)attacker))
			{
				return 0f;
			}
			HatiController hatiController = ((Component)attacker).GetComponent<HatiController>();
			if (!Object.op_Implicit((Object)(object)hatiController))
			{
				ShadowWolf component = ((Component)attacker).GetComponent<ShadowWolf>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return 0f;
				}
				hatiController = component.Master;
				who = "meute";
				if (!Object.op_Implicit((Object)(object)hatiController))
				{
					return Cfg.TierValue(Cfg.MaxHitByTier, tier, 35f);
				}
			}
			tier = hatiController.Tier;
			if (hatiController.Skoll)
			{
				who = ((who == "meute") ? "meute de Sköll" : "Sköll");
				return Cfg.TierValue(Cfg.SkollMaxHitByTier, tier, 40f);
			}
			if (hatiController.Mana)
			{
				who = ((who == "meute") ? "meute de Mánagarmr" : "Mánagarmr");
				return Cfg.TierValue(Cfg.ManagarmrMaxHitByTier, tier, 40f);
			}
			return Cfg.TierValue(Cfg.MaxHitByTier, tier, 35f);
		}
	}
	[HarmonyPatch(typeof(Game), "GetDifficultyDamageScaleEnemy")]
	internal static class EnemyScalePatch
	{
		private static bool Prefix(Vector3 pos, ref float __result)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (!HatiFamily.VictimIsHati || Cfg.GroupMode.Value == GroupScaling.Game)
			{
				return true;
			}
			__result = (HatiFamily.VictimIsBoss ? (1f / HatiFamily.HealthScale(pos)) : 1f);
			return false;
		}
	}
	[HarmonyPatch(typeof(Game), "GetDifficultyDamageScalePlayer")]
	internal static class PlayerScalePatch
	{
		private static bool Prefix(Vector3 pos, ref float __result)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			if (!HatiFamily.AttackerIsHati || Cfg.GroupMode.Value == GroupScaling.Game)
			{
				return true;
			}
			__result = HatiFamily.DamageScale(pos);
			return false;
		}
	}
	[HarmonyPatch(typeof(EnemyHud), "TestShow")]
	internal static class WatcherHudPatch
	{
		private static void Postfix(Character c, ref bool __result)
		{
			if (__result && Object.op_Implicit((Object)(object)c))
			{
				HatiController component = ((Component)c).GetComponent<HatiController>();
				if (Object.op_Implicit((Object)(object)component) && component.Spectral)
				{
					__result = false;
				}
			}
		}
	}
	[HarmonyPatch(typeof(CharacterAnimEvent), "CustomLateUpdate")]
	internal static class PoseAfterHeadLookPatch
	{
		private static void Postfix(CharacterAnimEvent __instance)
		{
			HatiLook.AfterAnimEvent(__instance);
		}
	}
	[HarmonyPatch(typeof(Player), "ConsumeResources")]
	internal static class ArmorIngredientPatch
	{
		private static void Prefix(Player __instance, ref Requirement[] requirements, int qualityLevel, int multiplier)
		{
			if (requirements == null || (Object)(object)__instance != (Object)(object)Player.m_localPlayer)
			{
				return;
			}
			List<Requirement> list = null;
			for (int i = 0; i < requirements.Length; i++)
			{
				Requirement val = requirements[i];
				if (val == null || !Object.op_Implicit((Object)(object)val.m_resItem) || !HatiItems.IsHatiArmor(((Object)((Component)val.m_resItem).gameObject).name))
				{
					list?.Add(val);
					continue;
				}
				if (list == null)
				{
					list = new List<Requirement>();
					for (int j = 0; j < i; j++)
					{
						list.Add(requirements[j]);
					}
				}
				int num = val.GetAmount(qualityLevel) * Math.Max(1, multiplier);
				if (num > 0)
				{
					HatiItems.ConsumeArmorIngredient(__instance, val.m_resItem, num);
				}
			}
			if (list != null)
			{
				requirements = list.ToArray();
			}
		}
	}
	internal static class StructureGuard
	{
		internal static bool Blocks(WearNTear wnt, HitData hit)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)wnt) || hit == null)
			{
				return false;
			}
			Character attacker = hit.GetAttacker();
			if (Object.op_Implicit((Object)(object)attacker) && HatiFamily.Is(attacker))
			{
				return true;
			}
			if ((int)hit.m_hitType == 13 || (int)hit.m_hitType == 11)
			{
				Vector3 position = ((Component)wnt).transform.position;
				foreach (HatiController item in HatiController.All)
				{
					if (Object.op_Implicit((Object)(object)item) && item.Active && Vector3.Distance(((Component)item).transform.position, position) < 80f)
					{
						return true;
					}
				}
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(WearNTear), "Damage")]
	internal static class StructureGuardDamagePatch
	{
		private static bool Prefix(WearNTear __instance, HitData hit)
		{
			return !StructureGuard.Blocks(__instance, hit);
		}
	}
	[HarmonyPatch(typeof(WearNTear), "RPC_Damage")]
	internal static class StructureGuardRpcPatch
	{
		private static bool Prefix(WearNTear __instance, HitData hit)
		{
			return !StructureGuard.Blocks(__instance, hit);
		}
	}
	internal static class Commands
	{
		private class ServerCmd : ConsoleCommand
		{
			private readonly string _name;

			private readonly string _help;

			private readonly string _cmd;

			private readonly bool _cheat;

			public override string Name => _name;

			public override string Help => _help;

			public override bool IsCheat => _cheat;

			public ServerCmd(string name, string help, string cmd, bool cheat)
			{
				_name = name;
				_help = help;
				_cmd = cmd;
				_cheat = cheat;
			}

			public override void Run(string[] args)
			{
				int result = -1;
				if (args.Length != 0 && !int.TryParse(args[0], out result))
				{
					Console.instance.Print("Usage : " + _name + " [nombre]");
				}
				else if (ZRoutedRpc.instance == null)
				{
					Console.instance.Print("À utiliser en jeu.");
				}
				else
				{
					HatiRuntime.SendAdmin(_cmd, result);
				}
			}
		}

		private class NearCmd : ConsoleCommand
		{
			private readonly string _name;

			private readonly string _help;

			private readonly int _cmd;

			public override string Name => _name;

			public override string Help => _help;

			public override bool IsCheat => true;

			public NearCmd(string name, string help, int cmd)
			{
				_name = name;
				_help = help;
				_cmd = cmd;
			}

			public override void Run(string[] args)
			{
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Unknown result type (might be due to invalid IL or missing references)
				Player localPlayer = Player.m_localPlayer;
				if (!Object.op_Implicit((Object)(object)localPlayer))
				{
					Console.instance.Print("À utiliser en jeu.");
					return;
				}
				List<HatiController> list = new List<HatiController>(HatiController.All);
				if (list.Count == 0)
				{
					Console.instance.Print("Aucun Hati chargé autour de toi.");
					return;
				}
				if (_cmd == 9)
				{
					foreach (HatiController item in list)
					{
						if (Object.op_Implicit((Object)(object)item))
						{
							item.Command(9);
						}
					}
					Console.instance.Print($"{list.Count} Hati renvoyé(s) dans l'ombre (la meute suit).");
					return;
				}
				HatiController hatiController = null;
				float num = float.MaxValue;
				foreach (HatiController item2 in list)
				{