Decompiled source of She Wolf v0.5.2

SheWolf.dll

Decompiled 2 weeks 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.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PinkVelvetBodysuit;
using SheWolf;
using TMPro;
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Audio;
using UnityEngine.EventSystems;
using UnityEngine.Playables;
using UnityEngine.Rendering;
using UnityEngine.UI;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SheWolf
{
	[BepInPlugin("com.Azura.shewolf", "She Wolf", "0.5.2")]
	public class SheWolfPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "com.Azura.shewolf";

		public const string PluginName = "She Wolf";

		public const string PluginVersion = "0.5.2";

		private static GameObject conteneurPrefabs;

		private static readonly HashSet<string> Echecs = new HashSet<string>();

		private void Awake()
		{
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			if (Directory.GetFiles(Paths.PluginPath, "PinkVelvetBodysuit.dll", SearchOption.AllDirectories).Length != 0)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"She Wolf v0.5.2 reste inactif : PinkVelvetBodysuit est installé et contient déjà la louve.");
				return;
			}
			Louve.Configurer(((BaseUnityPlugin)this).Config);
			Portee.Configurer(((BaseUnityPlugin)this).Config);
			Marques.Configurer(((BaseUnityPlugin)this).Config);
			Silhouette.Configurer(((BaseUnityPlugin)this).Config);
			CompetenceLoup.Configurer(((BaseUnityPlugin)this).Config);
			ArbreLouve.Configurer(((BaseUnityPlugin)this).Config);
			CapacitesLouve.Configurer(((BaseUnityPlugin)this).Config);
			((Component)this).gameObject.AddComponent<ArbreLouve>();
			LouveHud.Configurer(((BaseUnityPlugin)this).Config);
			Hurlement.Configurer(((BaseUnityPlugin)this).Config);
			new Harmony("com.Azura.shewolf").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"She Wolf v0.5.2 chargé : phéromones de louve, essence et transformation en louve.");
		}

		public static Transform Conteneur()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			if ((Object)(object)conteneurPrefabs == (Object)null)
			{
				conteneurPrefabs = new GameObject("She Wolf_Prefabs");
				conteneurPrefabs.SetActive(false);
				Object.DontDestroyOnLoad((Object)(object)conteneurPrefabs);
			}
			return conteneurPrefabs.transform;
		}

		public static void EnregistrerDansObjectDB(ObjectDB db)
		{
			if ((Object)(object)db == (Object)null || db.m_items.Count == 0 || (Object)(object)db.GetItemPrefab("Hammer") == (Object)null)
			{
				return;
			}
			if ((Object)(object)Louve.Gouttes == (Object)null)
			{
				Louve.Gouttes = Creer("gouttes de phéromones", () => Louve.CreerGouttes(db, Conteneur()));
			}
			if ((Object)(object)Louve.Gouttes != (Object)null && (Object)(object)Louve.Essence == (Object)null)
			{
				Louve.Essence = Creer("essence de phéromones", () => Louve.CreerEssence(db, Conteneur()));
			}
			Ajouter(db, Louve.Gouttes, null, null);
			Ajouter(db, Louve.Essence, "Recipe_LouvePheromoneEssence", () => Louve.CreerRecette(db));
			if ((Object)(object)Louve.Effet != (Object)null && !db.m_StatusEffects.Contains((StatusEffect)(object)Louve.Effet))
			{
				db.m_StatusEffects.Add((StatusEffect)(object)Louve.Effet);
			}
			if ((Object)(object)Portee.Effet == (Object)null)
			{
				Portee.Effet = Portee.CreerEffet();
			}
			if (!db.m_StatusEffects.Contains((StatusEffect)(object)Portee.Effet))
			{
				db.m_StatusEffects.Add((StatusEffect)(object)Portee.Effet);
			}
			AccessTools.Method(typeof(ObjectDB), "UpdateRegisters", (Type[])null, (Type[])null).Invoke(db, null);
			EnregistrerDansZNetScene(ZNetScene.instance);
		}

		public static void EnregistrerDansZNetScene(ZNetScene scene)
		{
			if ((Object)(object)scene == (Object)null)
			{
				return;
			}
			Dictionary<int, GameObject> dictionary = AccessTools.FieldRefAccess<ZNetScene, Dictionary<int, GameObject>>("m_namedPrefabs").Invoke(scene);
			GameObject[] array = (GameObject[])(object)new GameObject[2]
			{
				Louve.Gouttes,
				Louve.Essence
			};
			foreach (GameObject val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					if (!scene.m_prefabs.Contains(val))
					{
						scene.m_prefabs.Add(val);
					}
					dictionary[StringExtensionMethods.GetStableHashCode(((Object)val).name)] = val;
				}
			}
			Louve.EnregistrerDansZNetScene(scene);
		}

		private static GameObject Creer(string quoi, Func<GameObject> fabrique)
		{
			if (Echecs.Contains(quoi))
			{
				return null;
			}
			try
			{
				GameObject val = fabrique();
				if ((Object)(object)val == (Object)null)
				{
					Echecs.Add(quoi);
				}
				else
				{
					Outils3D.CalqueRamassage(val);
				}
				return val;
			}
			catch (Exception arg)
			{
				Echecs.Add(quoi);
				Debug.LogError((object)string.Format("[{0}] Création de l'objet « {1} » impossible : {2}", "She Wolf", quoi, arg));
				return null;
			}
		}

		private static void Ajouter(ObjectDB db, GameObject prefab, string nomRecette, Func<Recipe> recette)
		{
			if (!((Object)(object)prefab == (Object)null))
			{
				if (!db.m_items.Contains(prefab))
				{
					db.m_items.Add(prefab);
				}
				if (nomRecette != null && !db.m_recipes.Exists((Recipe r) => (Object)(object)r != (Object)null && ((Object)r).name == nomRecette))
				{
					db.m_recipes.Add(recette());
				}
			}
		}
	}
	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	public static class SheWolf_ObjectDB_Awake_Patch
	{
		public static void Postfix(ObjectDB __instance)
		{
			SheWolfPlugin.EnregistrerDansObjectDB(__instance);
		}
	}
	[HarmonyPatch(typeof(ObjectDB), "CopyOtherDB")]
	public static class SheWolf_ObjectDB_CopyOtherDB_Patch
	{
		public static void Postfix(ObjectDB __instance)
		{
			SheWolfPlugin.EnregistrerDansObjectDB(__instance);
		}
	}
	[HarmonyPatch(typeof(ZNetScene), "Awake")]
	public static class SheWolf_ZNetScene_Awake_Patch
	{
		public static void Postfix(ZNetScene __instance)
		{
			SheWolfPlugin.EnregistrerDansZNetScene(__instance);
		}
	}
}
namespace PinkVelvetBodysuit
{
	public static class Hote
	{
		private static AudioMixerGroup groupeEffets;

		public static string Nom => "She Wolf";

		public static Color CouleurAnneau => new Color(0.91f, 0.77f, 0.35f);

		public static AudioMixerGroup GroupeEffets
		{
			get
			{
				if ((Object)(object)groupeEffets != (Object)null || (Object)(object)ObjectDB.instance == (Object)null)
				{
					return groupeEffets;
				}
				string[] array = new string[3] { "Club", "AxeStone", "SwordBronze" };
				foreach (string text in array)
				{
					GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(text);
					ItemDrop val = ((itemPrefab != null) ? itemPrefab.GetComponent<ItemDrop>() : null);
					if ((Object)(object)val != (Object)null && (Object)(object)(groupeEffets = Outils3D.GroupeAudio(val.m_itemData.m_shared)) != (Object)null)
					{
						break;
					}
				}
				return groupeEffets;
			}
		}

		public static Transform Conteneur()
		{
			return SheWolfPlugin.Conteneur();
		}
	}
	public static class Louve
	{
		public const string NomGouttes = "LouvePheromoneGouttes";

		public const string NomEssence = "LouvePheromoneEssence";

		public const string NomRecetteEssence = "Recipe_LouvePheromoneEssence";

		public const string NomEffet = "SE_LaivyLouve";

		public const string CleRestant = "laivy_louve_restant";

		public const string CleLouve = "laivy_louve";

		public const string CleLaisse = "laivy_louve_laisse";

		public const string RpcLaisse = "LaivyLouve_Laisse";

		public static readonly int HashLouve = StringExtensionMethods.GetStableHashCode("laivy_louve");

		public static readonly KeyValuePair<int, int> HashLaisse = ZDO.GetHashZDOID("laivy_louve_laisse");

		public static ConfigEntry<float> DureeMinutes;

		public static ConfigEntry<float> Chance;

		public static ConfigEntry<int> GouttesMin;

		public static ConfigEntry<int> GouttesMax;

		public static ConfigEntry<int> GouttesParEssence;

		public static ConfigEntry<float> BonusVitesse;

		public static ConfigEntry<float> DegatsPerforants;

		public static ConfigEntry<float> DegatsTranchants;

		public static ConfigEntry<float> BoostDegats;

		public static ConfigEntry<float> LongueurLaisse;

		public static ConfigEntry<float> RayonInstinct;

		public static ConfigEntry<string> CouleurCollierHex;

		public static ConfigEntry<string> CouleurLaisseHex;

		public static ConfigEntry<float> VitesseAttaques;

		public static ConfigEntry<float> DistanceBond;

		public static GameObject Gouttes;

		public static GameObject Essence;

		public static SE_Louve Effet;

		private static ItemDrop crocs;

		private static Attack[] combo;

		private static Dictionary<string, GameObject> versionsCuites;

		private static Material[] materiauxCollier;

		private static Material materiauCorde;

		private static float dernierMessage;

		public static ConfigEntry<int> VersionReglages;

		public const float BoostDegatsDefaut = 1.2f;

		public const float BoostDegatsAncien = 1.5f;

		public static void Configurer(ConfigFile config)
		{
			DureeMinutes = config.Bind<float>("Louve", "DureeMinutes", 45f, "Length of the she-wolf transformation (minutes of play): neither logging out nor dying ends it.\nDurée de la transformation en louve (minutes de jeu) : ni la déconnexion ni la mort n'y mettent fin.");
			Chance = config.Bind<float>("Louve", "ChanceGouttes", 0.5f, "Chance that a killed wolf drops pheromones (0.5 = 50 %).\nChance qu'un loup tué laisse des gouttes de phéromones (0.5 = 50 %).");
			GouttesMin = config.Bind<int>("Louve", "GouttesMin", 1, "Minimum number of drops.\nNombre minimal de gouttes laissées.");
			GouttesMax = config.Bind<int>("Louve", "GouttesMax", 5, "Maximum number of drops.\nNombre maximal de gouttes laissées.");
			GouttesParEssence = config.Bind<int>("Louve", "GouttesParEssence", 30, "Drops needed for one essence (mead cauldron).\nGouttes nécessaires pour une essence (chaudron à hydromel).");
			BonusVitesse = config.Bind<float>("Louve", "BonusVitesse", 0.4f, "Extra movement speed as a she-wolf (0.4 = +40 %).\nVitesse de déplacement en plus sous forme de louve (0.4 = +40 %).");
			DegatsPerforants = config.Bind<float>("Louve", "DegatsPerforants", 35f, "Pierce damage of the fangs (bite).\nDégâts perforants des crocs (morsure).");
			DegatsTranchants = config.Bind<float>("Louve", "DegatsTranchants", 25f, "Slash damage of the fangs and paws.\nDégâts tranchants des crocs et des pattes.");
			BoostDegats = config.Bind<float>("Louve", "BoostDegats", 1.2f, "Multiplier for all damage dealt as a she-wolf (1.2 = +20 %).\nMultiplicateur de tous les dégâts infligés sous forme de louve (1.2 = +20 %).");
			LongueurLaisse = config.Bind<float>("Louve", "LongueurLaisse", 4f, "Leash length, in metres.\nLongueur de la laisse en mètres.");
			RayonInstinct = config.Bind<float>("Louve", "RayonInstinct", 45f, "Radius (metres) in which the she-wolf's instinct makes living creatures glow.\nRayon (mètres) dans lequel l'instinct de la louve fait briller les êtres vivants.");
			CouleurCollierHex = config.Bind<string>("Louve", "CouleurCollierHex", "#E05297", "Colour of the leather collar.\nCouleur du collier en cuir.");
			CouleurLaisseHex = config.Bind<string>("Louve", "CouleurLaisseHex", "#2B1B17", "Colour of the leather leash.\nCouleur de la laisse en cuir.");
			VitesseAttaques = config.Bind<float>("Louve", "VitesseAttaques", 1.25f, "Speed of the she-wolf's attacks (1 = as fast as the game's wolves).\nVitesse des attaques de la louve (1 = comme les loups du jeu).");
			DistanceBond = config.Bind<float>("Louve", "DistanceBond", 4.5f, "Length of the pounce (secondary attack), in metres.\nLongueur du bond (attaque secondaire), en mètres.");
			VersionReglages = config.Bind<int>("Louve", "VersionReglages", 0, "Settings version, managed by the mod: do not change it.\nVersion des réglages, gérée par le mod : ne pas la modifier.");
			if (VersionReglages.Value < 1)
			{
				if (GouttesParEssence.Value == 50)
				{
					GouttesParEssence.Value = 30;
				}
				VersionReglages.Value = 1;
			}
		}

		public static GameObject CreerGouttes(ObjectDB db, Transform conteneur)
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = ((IEnumerable<string>)new string[3] { "Resin", "Honey", "Guck" }).Select((Func<string, GameObject>)db.GetItemPrefab).FirstOrDefault((Func<GameObject, bool>)((GameObject p) => (Object)(object)p != (Object)null));
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			GameObject val2 = Object.Instantiate<GameObject>(val, conteneur, false);
			((Object)val2).name = "LouvePheromoneGouttes";
			val2.transform.localScale = Vector3.one;
			Outils3D.ViderModeles(val2);
			Maillage maillage = new Maillage();
			Goutte(maillage, new Vector3(0f, 0f, 0f), 0.217f);
			Goutte(maillage, new Vector3(0.036f, 0f, 0.012f) * 3.5f, 0.1575f);
			Goutte(maillage, new Vector3(-0.012f, 0f, 0.034f) * 3.5f, 0.12599999f);
			Mesh val3 = maillage.Creer("Louve_Gouttes");
			Color couleur = default(Color);
			((Color)(ref couleur))..ctor(0.86f, 0.52f, 0.36f);
			GameObject obj = Outils3D.Objet("Gouttes_Modele", val3, (Material[])(object)new Material[1] { Outils3D.Materiau(db, "Louve_Gouttes", couleur, 0.92f, 0f) }, val2.transform);
			BoxCollider obj2 = obj.AddComponent<BoxCollider>();
			Bounds bounds = val3.bounds;
			obj2.center = ((Bounds)(ref bounds)).center;
			bounds = val3.bounds;
			obj2.size = ((Bounds)(ref bounds)).size + Vector3.one * 0.01f;
			ItemDrop component = val2.GetComponent<ItemDrop>();
			component.m_itemData.m_dropPrefab = val2;
			SharedData shared = component.m_itemData.m_shared;
			shared.m_name = Textes.Jeton("gouttes_nom");
			shared.m_description = Textes.Jeton("gouttes_desc");
			shared.m_itemType = (ItemType)1;
			shared.m_maxStackSize = 100;
			shared.m_weight = 0.1f;
			shared.m_teleportable = true;
			shared.m_value = 0;
			Sprite val4 = Outils3D.RendreIcone(obj, new Vector3(0.4f, 0.55f, -1f), "LouvePheromoneGouttes");
			if ((Object)(object)val4 != (Object)null)
			{
				shared.m_icons = (Sprite[])(object)new Sprite[1] { val4 };
			}
			return val2;
		}

		private static void Goutte(Maillage m, Vector3 pied, float hauteur)
		{
			//IL_0059: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			List<float> list2 = new List<float>();
			for (int i = 0; i < 20; i++)
			{
				float num = MathF.PI * (float)i / 19f;
				float num2 = (Mathf.Cos(num) + 1f) * 0.5f * hauteur;
				float num3 = Mathf.Sin(num) * Mathf.Sin(num * 0.5f) * hauteur * 0.36f;
				list.Add(pied + new Vector3(0f, num2, 0f));
				list2.Add(Mathf.Max(0.0004f, num3));
			}
			Maillage.Reperes(list, Vector3.forward, out var droites, out var hauts);
			m.Tube(0, list, droites, hauts, list2, list2, 18, 2f, fermerDebut: false, fermerFin: false);
		}

		public static GameObject CreerEssence(ObjectDB db, Transform conteneur)
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = ((IEnumerable<string>)new string[3] { "MeadHealthMinor", "MeadStaminaMinor", "MeadTasty" }).Select((Func<string, GameObject>)db.GetItemPrefab).FirstOrDefault((Func<GameObject, bool>)((GameObject p) => (Object)(object)p != (Object)null)) ?? ((IEnumerable<GameObject>)db.m_items).FirstOrDefault((Func<GameObject, bool>)delegate(GameObject i)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Invalid comparison between Unknown and I4
				if ((Object)(object)i != (Object)null)
				{
					ItemDrop component2 = i.GetComponent<ItemDrop>();
					if (component2 != null && (int)component2.m_itemData.m_shared.m_itemType == 2)
					{
						return (Object)(object)i.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect != (Object)null;
					}
				}
				return false;
			});
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			GameObject val2 = Object.Instantiate<GameObject>(val, conteneur, false);
			((Object)val2).name = "LouvePheromoneEssence";
			val2.transform.localScale = Vector3.one;
			Outils3D.ViderModeles(val2);
			Material[] materiaux;
			Mesh val3 = ModeleFiole(db, out materiaux);
			GameObject obj = Outils3D.Objet("Essence_Modele", val3, materiaux, val2.transform);
			BoxCollider obj2 = obj.AddComponent<BoxCollider>();
			Bounds bounds = val3.bounds;
			obj2.center = ((Bounds)(ref bounds)).center;
			bounds = val3.bounds;
			obj2.size = ((Bounds)(ref bounds)).size + Vector3.one * 0.01f;
			ItemDrop component = val2.GetComponent<ItemDrop>();
			component.m_itemData.m_dropPrefab = val2;
			SharedData shared = component.m_itemData.m_shared;
			Sprite val4 = Outils3D.RendreIcone(obj, new Vector3(0.35f, 0.25f, -1f), "LouvePheromoneEssence");
			Effet = CreerEffet(val4 ?? shared.m_icons.FirstOrDefault());
			shared.m_name = Textes.Jeton("essence_nom");
			shared.m_description = Textes.Jeton("essence_desc");
			shared.m_itemType = (ItemType)2;
			shared.m_consumeStatusEffect = (StatusEffect)(object)Effet;
			shared.m_food = 0f;
			shared.m_foodStamina = 0f;
			shared.m_foodEitr = 0f;
			shared.m_maxStackSize = 10;
			shared.m_weight = 0.5f;
			shared.m_teleportable = true;
			if ((Object)(object)val4 != (Object)null)
			{
				shared.m_icons = (Sprite[])(object)new Sprite[1] { val4 };
			}
			return val2;
		}

		private static Mesh ModeleFiole(ObjectDB db, out Material[] materiaux)
		{
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			Maillage maillage = new Maillage();
			(float, float)[] profil = new(float, float)[14]
			{
				(0f, 0.0005f),
				(0.002f, 0.012f),
				(0.006f, 0.02f),
				(0.013f, 0.026f),
				(0.024f, 0.029f),
				(0.04f, 0.029f),
				(0.052f, 0.027f),
				(0.061f, 0.021f),
				(0.068f, 0.013f),
				(0.073f, 0.0095f),
				(0.09f, 0.009f),
				(0.093f, 0.0115f),
				(0.098f, 0.0115f),
				(0.1f, 0.009f)
			};
			Tourner(maillage, 0, profil, 24);
			Tourner(maillage, 1, new(float, float)[5]
			{
				(0.09f, 0.008f),
				(0.1f, 0.0082f),
				(0.11f, 0.0092f),
				(0.114f, 0.0086f),
				(0.1155f, 0.0005f)
			}, 16);
			List<Vector3> list = new List<Vector3>();
			for (int i = 0; i <= 24; i++)
			{
				float num = MathF.PI * 2f * (float)i / 24f;
				list.Add(new Vector3(Mathf.Cos(num) * 0.0102f, 0.082f, Mathf.Sin(num) * 0.0102f));
			}
			Maillage.Reperes(list, Vector3.up, out var droites, out var hauts);
			float[] array = Enumerable.Repeat(0.0016f, list.Count).ToArray();
			maillage.Tube(2, list, droites, hauts, array, array, 8, 2f, fermerDebut: false, fermerFin: false);
			List<Vector3> list2 = new List<Vector3>
			{
				new Vector3(0f, 0.082f, -0.0105f),
				new Vector3(0f, 0.075f, -0.018f),
				new Vector3(0f, 0.068f, -0.027f),
				new Vector3(0f, 0.061f, -0.0355f)
			};
			Maillage.Reperes(list2, Vector3.right, out var droites2, out var hauts2);
			float[] array2 = Enumerable.Repeat(0.0012f, list2.Count).ToArray();
			maillage.Tube(2, list2, droites2, hauts2, array2, array2, 6, 2f, fermerDebut: true, fermerFin: true);
			List<Vector3> list3 = new List<Vector3>();
			List<float> list4 = new List<float>();
			for (int j = 0; j <= 10; j++)
			{
				float num2 = (float)j / 10f;
				list3.Add(new Vector3(0f, 0.061f - 0.027f * num2, -0.037f - 0.007f * num2 * num2));
				list4.Add(Mathf.Lerp(0.0048f, 0.0004f, Mathf.Pow(num2, 0.9f)));
			}
			Maillage.Reperes(list3, Vector3.right, out var droites3, out var hauts3);
			maillage.Tube(3, list3, droites3, hauts3, list4, list4, 10, 2f, fermerDebut: true, fermerFin: false);
			materiaux = (Material[])(object)new Material[4]
			{
				Outils3D.Materiau(db, "Essence_Verre", new Color(0.62f, 0.1f, 0.24f), 0.95f, 0.1f),
				Outils3D.Materiau(db, "Essence_Liege", new Color(0.62f, 0.45f, 0.28f), 0.15f, 0f),
				Outils3D.Materiau(db, "Essence_Cordelette", new Color(0.24f, 0.16f, 0.1f), 0.2f, 0f),
				Outils3D.Materiau(db, "Essence_Croc", new Color(0.93f, 0.9f, 0.8f), 0.55f, 0f)
			};
			return maillage.Creer("Louve_Essence");
		}

		private static void Tourner(Maillage m, int partie, IList<(float y, float r)> profil, int cotes)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> centres = ((IEnumerable<(float, float)>)profil).Select((Func<(float, float), Vector3>)(((float y, float r) p) => new Vector3(0f, p.y, 0f))).ToList();
			List<float> list = profil.Select(((float y, float r) p) => p.r).ToList();
			Maillage.Reperes(centres, Vector3.forward, out var droites, out var hauts);
			m.Tube(partie, centres, droites, hauts, list, list, cotes, 2f, fermerDebut: false, fermerFin: false);
		}

		private static SE_Louve CreerEffet(Sprite icone)
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			SE_Louve sE_Louve = ScriptableObject.CreateInstance<SE_Louve>();
			((Object)sE_Louve).name = "SE_LaivyLouve";
			((StatusEffect)sE_Louve).m_name = Textes.Jeton("effet_nom");
			((StatusEffect)sE_Louve).m_category = "laivy_louve";
			((StatusEffect)sE_Louve).m_icon = icone;
			((StatusEffect)sE_Louve).m_tooltip = Textes.Jeton("effet_info");
			((StatusEffect)sE_Louve).m_ttl = Mathf.Max(1f, DureeMinutes.Value) * 60f;
			((SE_Stats)sE_Louve).m_speedModifier = BonusVitesse.Value;
			((SE_Stats)sE_Louve).m_modifyAttackSkill = (SkillType)999;
			((SE_Stats)sE_Louve).m_damageModifier = Mathf.Max(1f, BoostDegats.Value);
			((SE_Stats)sE_Louve).m_runStaminaDrainModifier = -0.5f;
			((SE_Stats)sE_Louve).m_jumpStaminaUseModifier = -0.3f;
			((SE_Stats)sE_Louve).m_jumpModifier = new Vector3(0f, 0.25f, 0.25f);
			((SE_Stats)sE_Louve).m_noiseModifier = -0.3f;
			((SE_Stats)sE_Louve).m_mods = CapacitesLouve.Fourrure(niflheim: true);
			((StatusEffect)sE_Louve).m_startMessageType = (MessageType)2;
			((StatusEffect)sE_Louve).m_startMessage = Textes.Jeton("effet_debut");
			((StatusEffect)sE_Louve).m_stopMessageType = (MessageType)2;
			((StatusEffect)sE_Louve).m_stopMessage = Textes.Jeton("effet_fin");
			return sE_Louve;
		}

		public static Recipe CreerRecette(ObjectDB db)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			Requirement val = new Requirement
			{
				m_resItem = Gouttes.GetComponent<ItemDrop>(),
				m_amount = Mathf.Max(1, GouttesParEssence.Value),
				m_recover = true
			};
			return Outils3D.Recette("Recipe_LouvePheromoneEssence", Essence, ChaudronHydromel(db), 1, val);
		}

		public static CraftingStation ChaudronHydromel(ObjectDB db)
		{
			IEnumerable<CraftingStation> enumerable = from r in db.m_recipes
				select (!((Object)(object)r != (Object)null)) ? null : r.m_craftingStation into s
				where (Object)(object)s != (Object)null
				select s;
			if ((Object)(object)ZNetScene.instance != (Object)null)
			{
				enumerable = enumerable.Concat(from p in ZNetScene.instance.m_prefabs
					where (Object)(object)p != (Object)null
					select p.GetComponent<CraftingStation>() into s
					where (Object)(object)s != (Object)null
					select s);
			}
			return enumerable.FirstOrDefault((Func<CraftingStation, bool>)((CraftingStation s) => s.m_name == "$piece_meadcauldron")) ?? enumerable.FirstOrDefault((Func<CraftingStation, bool>)((CraftingStation s) => s.m_name == "$piece_cauldron"));
		}

		public static void EnregistrerDansZNetScene(ZNetScene scene)
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			if ((Object)(object)scene == (Object)null || (Object)(object)Gouttes == (Object)null)
			{
				return;
			}
			GameObject prefab = scene.GetPrefab("Wolf");
			CharacterDrop val = (((Object)(object)prefab != (Object)null) ? prefab.GetComponent<CharacterDrop>() : null);
			if ((Object)(object)val != (Object)null && !val.m_drops.Any((Drop d) => (Object)(object)d.m_prefab == (Object)(object)Gouttes))
			{
				int num = Mathf.Max(1, GouttesMin.Value);
				val.m_drops.Add(new Drop
				{
					m_prefab = Gouttes,
					m_amountMin = num,
					m_amountMax = Mathf.Max(num, GouttesMax.Value) + 1,
					m_chance = Mathf.Clamp01(Chance.Value),
					m_levelMultiplier = false,
					m_onePerPlayer = false
				});
			}
			if ((Object)(object)ObjectDB.instance != (Object)null)
			{
				Recipe val2 = ((IEnumerable<Recipe>)ObjectDB.instance.m_recipes).FirstOrDefault((Func<Recipe, bool>)((Recipe r) => (Object)(object)r != (Object)null && ((Object)r).name == "Recipe_LouvePheromoneEssence"));
				CraftingStation val3 = ChaudronHydromel(ObjectDB.instance);
				if ((Object)(object)val2 != (Object)null && (Object)(object)val3 != (Object)null && (Object)(object)val2.m_craftingStation != (Object)(object)val3)
				{
					val2.m_craftingStation = val3;
					val2.m_repairStation = val3;
				}
			}
		}

		public static LouveJoueur Etat(Character c)
		{
			if (!((Object)(object)c != (Object)null) || !LouveJoueur.Tous.TryGetValue(c, out var value))
			{
				return null;
			}
			return value;
		}

		public static bool EstLouve(Character c)
		{
			LouveJoueur louveJoueur = Etat(c);
			if ((Object)(object)louveJoueur != (Object)null)
			{
				return louveJoueur.Louve;
			}
			return false;
		}

		public static void Dire(Character c, string message)
		{
			if ((Object)(object)c != (Object)(object)Player.m_localPlayer || Time.time - dernierMessage < 0.8f)
			{
				return;
			}
			dernierMessage = Time.time;
			try
			{
				c.Message((MessageType)2, message, 0, (Sprite)null, false);
			}
			catch
			{
			}
		}

		public static ItemDrop Crocs(Player joueur)
		{
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)crocs != (Object)null)
			{
				return crocs;
			}
			GameObject val = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab("Wolf") : null);
			Humanoid val2 = (((Object)(object)val != (Object)null) ? val.GetComponent<Humanoid>() : null);
			ItemDrop unarmedWeapon = ((Humanoid)joueur).m_unarmedWeapon;
			if ((Object)(object)val2 == (Object)null || (Object)(object)unarmedWeapon == (Object)null)
			{
				return null;
			}
			List<ItemDrop> attaques = (from g in ((IEnumerable<GameObject>)(((object)val2.m_defaultItems) ?? ((object)new GameObject[0]))).Concat((IEnumerable<GameObject>)(((object)val2.m_randomWeapon) ?? ((object)new GameObject[0])))
				where (Object)(object)g != (Object)null
				select g.GetComponent<ItemDrop>() into d
				where (Object)(object)d != (Object)null && d.m_itemData.m_shared.m_attack != null && !string.IsNullOrEmpty(d.m_itemData.m_shared.m_attack.m_attackAnimation)
				select d).Distinct().ToList();
			if (attaques.Count == 0)
			{
				return null;
			}
			foreach (ItemDrop item in attaques)
			{
				Attack attack = item.m_itemData.m_shared.m_attack;
				Debug.Log((object)$"[{Hote.Nom}] Attaque de loup : {((Object)item).name} anim={attack.m_attackAnimation} type={attack.m_attackType} portée={attack.m_attackRange} hauteur={attack.m_attackHeight} angle={attack.m_attackAngle} os={attack.m_attackOriginJoint}");
			}
			attaques = attaques.OrderBy<ItemDrop, string>((ItemDrop a) => a.m_itemData.m_shared.m_attack.m_attackAnimation, StringComparer.Ordinal).ToList();
			Attack modele = Anim("attack1");
			Attack modele2 = Anim("attack2");
			Attack modele3 = Anim("attack3");
			GameObject val3 = Object.Instantiate<GameObject>(((Component)unarmedWeapon).gameObject, Hote.Conteneur(), false);
			((Object)val3).name = "LouveCrocs";
			ItemDrop component = val3.GetComponent<ItemDrop>();
			component.m_itemData.m_dropPrefab = val3;
			SharedData shared = component.m_itemData.m_shared;
			shared.m_name = Textes.Jeton("crocs_nom");
			shared.m_skillType = (SkillType)11;
			shared.m_damages = new DamageTypes
			{
				m_pierce = DegatsPerforants.Value,
				m_slash = DegatsTranchants.Value
			};
			shared.m_damagesPerLevel = default(DamageTypes);
			shared.m_attackForce = 45f;
			shared.m_backstabBonus = 3f;
			shared.m_blockPower = 0f;
			shared.m_useDurability = false;
			shared.m_attackStatusEffect = null;
			shared.m_spawnOnHit = null;
			combo = (Attack[])(object)new Attack[3]
			{
				Coup(modele, 8f, 1f, 1f, 1f),
				Coup(modele2, 8f, 1.1f, 1f, 1f),
				Coup(modele3, 12f, 1.4f, 1.8f, 1.5f, 100f)
			};
			shared.m_attack = combo[0];
			shared.m_secondaryAttack = Coup(modele, 24f, 1.5f, 1.5f, 0.6f);
			return crocs = component;
			Attack Anim(string nom)
			{
				return (((IEnumerable<ItemDrop>)attaques).FirstOrDefault((Func<ItemDrop, bool>)((ItemDrop a) => a.m_itemData.m_shared.m_attack.m_attackAnimation == nom)) ?? attaques.First()).m_itemData.m_shared.m_attack;
			}
		}

		private static Attack Coup(Attack modele, float endurance, float degats, float force, float etourdissement, float angle = 0f)
		{
			Attack val = modele.Clone();
			val.m_attackOriginJoint = "";
			val.m_attackStamina = endurance;
			val.m_attackEitr = 0f;
			val.m_attackHealth = 0f;
			val.m_damageMultiplier = degats;
			val.m_forceMultiplier = force;
			val.m_staggerMultiplier = etourdissement;
			if (angle > 0f)
			{
				val.m_attackAngle = angle;
			}
			return val;
		}

		public static void PreparerAttaque(Player joueur, bool secondaire)
		{
			LouveJoueur louveJoueur = Etat((Character)(object)joueur);
			if (!secondaire && combo != null && !((Object)(object)crocs == (Object)null) && !((Object)(object)louveJoueur == (Object)null))
			{
				ItemData currentWeapon = ((Humanoid)joueur).GetCurrentWeapon();
				if (currentWeapon != null && currentWeapon.m_shared == crocs.m_itemData.m_shared)
				{
					currentWeapon.m_shared.m_attack = combo[louveJoueur.PreparerCoup(combo.Length)];
				}
			}
		}

		public static GameObject VersionCuite(ItemData cru)
		{
			if ((Object)(object)cru?.m_dropPrefab == (Object)null || (Object)(object)ZNetScene.instance == (Object)null)
			{
				return null;
			}
			if (versionsCuites == null)
			{
				versionsCuites = new Dictionary<string, GameObject>();
				foreach (GameObject item in ZNetScene.instance.m_prefabs.Where((GameObject p) => (Object)(object)p != (Object)null))
				{
					CookingStation component = item.GetComponent<CookingStation>();
					if (component?.m_conversion == null)
					{
						continue;
					}
					foreach (ItemConversion item2 in component.m_conversion)
					{
						if ((Object)(object)item2?.m_from != (Object)null && (Object)(object)item2.m_to != (Object)null && item2.m_to.m_itemData.m_shared.m_food > 0f && !versionsCuites.ContainsKey(((Object)item2.m_from).name))
						{
							versionsCuites[((Object)item2.m_from).name] = ((Component)item2.m_to).gameObject;
						}
					}
				}
			}
			if (!versionsCuites.TryGetValue(((Object)cru.m_dropPrefab).name, out var value))
			{
				return null;
			}
			return value;
		}

		public static void MangerCru(Player joueur, Inventory inventaire, ItemData cru, GameObject cuit)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			ItemData val = cuit.GetComponent<ItemDrop>().m_itemData.Clone();
			val.m_dropPrefab = cuit;
			val.m_stack = 1;
			if (joueur.CanEat(val, true) && joueur.EatFood(val))
			{
				inventaire.RemoveOneItem(cru);
				((Humanoid)joueur).m_consumeItemEffects.Create(((Component)joueur).transform.position, Quaternion.identity, (Transform)null, 1f, -1, ((Character)joueur).GetZDOID());
				ZSyncAnimation component = ((Component)joueur).GetComponent<ZSyncAnimation>();
				if (component != null)
				{
					component.SetTrigger("eat");
				}
				((Character)joueur).Message((MessageType)1, Textes.T("mange_cru", Localization.instance.Localize(cru.m_shared.m_name)), 0, (Sprite)null, false);
			}
		}

		public static void Debut(Player joueur)
		{
			LouveJoueur louveJoueur = Etat((Character)(object)joueur);
			if (!((Object)(object)louveJoueur == (Object)null) && louveJoueur.Proprietaire)
			{
				if (((Character)joueur).IsAttached())
				{
					((Character)joueur).AttachStop();
				}
				if ((Object)(object)InventoryGui.instance != (Object)null && (Object)(object)joueur == (Object)(object)Player.m_localPlayer && (Object)(object)joueur.GetCurrentCraftingStation() != (Object)null)
				{
					InventoryGui.instance.Hide();
				}
				((Humanoid)joueur).HideHandItems(false, false);
				louveJoueur.DebutLouve(Crocs(joueur));
			}
		}

		public static void Fin(Player joueur, bool garderTemps, bool rendreArmes = true)
		{
			LouveJoueur louveJoueur = Etat((Character)(object)joueur);
			if (!((Object)(object)louveJoueur == (Object)null) && louveJoueur.Proprietaire)
			{
				if (!garderTemps)
				{
					((Component)joueur).GetComponent<LouvePortee>()?.MettreBasSiAttendue();
				}
				louveJoueur.FinLouve();
				if (!garderTemps)
				{
					joueur.m_customData.Remove("laivy_louve_restant");
				}
				if (rendreArmes)
				{
					AccessTools.Method(typeof(Humanoid), "ShowHandItems", (Type[])null, (Type[])null).Invoke(joueur, new object[2] { false, false });
				}
			}
		}

		public static Material[] MateriauxCollier()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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)
			if (materiauxCollier != null || (Object)(object)ObjectDB.instance == (Object)null)
			{
				return materiauxCollier;
			}
			Material[] result = new Material[2]
			{
				Outils3D.Materiau(ObjectDB.instance, "Louve_Collier", Outils3D.Couleur(CouleurCollierHex.Value, new Color(0.88f, 0.32f, 0.59f)), 0.45f, 0f),
				Outils3D.Materiau(ObjectDB.instance, "Louve_Anneau", Hote.CouleurAnneau, 0.75f, 0.7f)
			};
			materiauxCollier = (Material[])(object)result;
			return (Material[])(object)result;
		}

		public static Material MateriauCorde()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)materiauCorde != (Object)null || (Object)(object)ObjectDB.instance == (Object)null)
			{
				return materiauCorde;
			}
			return materiauCorde = Outils3D.Materiau(ObjectDB.instance, "Louve_Laisse", Outils3D.Couleur(CouleurLaisseHex.Value, new Color(0.17f, 0.11f, 0.09f)), 0.35f, 0f);
		}
	}
	public class SE_Louve : SE_Stats
	{
		private float sauvegarde;

		public override void Setup(Character character)
		{
			Player val = (Player)(object)((character is Player) ? character : null);
			float num = ((val != null) ? Restant(val) : 0f);
			if (num > 0f && num < ((StatusEffect)this).m_ttl)
			{
				((StatusEffect)this).m_time = ((StatusEffect)this).m_ttl - num;
				((StatusEffect)this).m_startMessage = Textes.T("encore_louve", Mathf.CeilToInt(num / 60f));
			}
			if (Metamorphose.ArriveeVoulue)
			{
				Player val2 = (Player)(object)((character is Player) ? character : null);
				if (val2 != null)
				{
					((StatusEffect)this).m_startMessage = Textes.T("meta_louve", Metamorphose.Duree(Metamorphose.Disponible(val2, ((StatusEffect)this).m_ttl - ((StatusEffect)this).m_time)));
				}
			}
			((SE_Stats)this).Setup(character);
			Player val3 = (Player)(object)((character is Player) ? character : null);
			if (val3 != null)
			{
				Louve.Debut(val3);
				Sauver();
			}
		}

		public static float Restant(Player joueur)
		{
			if (!joueur.m_customData.TryGetValue("laivy_louve_restant", out var value) || !float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
			{
				return 0f;
			}
			return result;
		}

		private void Sauver()
		{
			Character character = ((StatusEffect)this).m_character;
			Player val = (Player)(object)((character is Player) ? character : null);
			if (val != null)
			{
				val.m_customData["laivy_louve_restant"] = Mathf.Max(1f, ((StatusEffect)this).m_ttl - ((StatusEffect)this).m_time).ToString("0", CultureInfo.InvariantCulture);
			}
		}

		public override void UpdateStatusEffect(float dt)
		{
			if (((StatusEffect)this).m_ttl > 0f)
			{
				Character character = ((StatusEffect)this).m_character;
				Player val = (Player)(object)((character is Player) ? character : null);
				if (val != null)
				{
					float num = Metamorphose.Prolonger(val, ((StatusEffect)this).m_ttl - ((StatusEffect)this).m_time - dt);
					if (num > 0f)
					{
						((StatusEffect)this).m_time = Mathf.Max(0f, ((StatusEffect)this).m_time - num);
						Sauver();
					}
				}
			}
			((SE_Stats)this).UpdateStatusEffect(dt);
			sauvegarde += dt;
			if (sauvegarde >= 1f)
			{
				sauvegarde = 0f;
				Sauver();
			}
		}

		public override void Stop()
		{
			Character character = ((StatusEffect)this).m_character;
			Player val = (Player)(object)((character is Player) ? character : null);
			if (val != null)
			{
				bool flag = ((Character)val).IsDead() && !((StatusEffect)this).IsDone();
				bool flag2 = !flag && Metamorphose.PauseDemandee;
				if (flag || flag2)
				{
					Sauver();
				}
				if (flag)
				{
					((StatusEffect)this).m_stopMessage = "";
				}
				else if (flag2)
				{
					((StatusEffect)this).m_stopMessage = Textes.T("meta_humaine", Metamorphose.Duree(Metamorphose.Disponible(val, ((StatusEffect)this).m_ttl - ((StatusEffect)this).m_time)));
				}
				else if (Metamorphose.PlusDeGouttes)
				{
					((StatusEffect)this).m_stopMessage = Textes.T("meta_fin_gouttes");
				}
				Metamorphose.PlusDeGouttes = false;
				Louve.Fin(val, flag || flag2, !flag);
			}
			((StatusEffect)this).Stop();
		}

		public override void ModifyWalkVelocity(ref Vector3 vel)
		{
			((SE_Stats)this).ModifyWalkVelocity(ref vel);
			LouveJoueur louveJoueur = Louve.Etat(((StatusEffect)this).m_character);
			if (!((Object)(object)louveJoueur == (Object)null))
			{
				louveJoueur.AppliquerElan(ref vel);
				louveJoueur.TirerLaisse(ref vel);
			}
		}
	}
	public class LouveJoueur : MonoBehaviour, Interactable
	{
		public static readonly Dictionary<Character, LouveJoueur> Tous = new Dictionary<Character, LouveJoueur>();

		private static readonly FieldRef<Character, Animator> AnimPerso = AccessTools.FieldRefAccess<Character, Animator>("m_animator");

		private static readonly FieldRef<Character, CharacterAnimEvent> EvtPerso = AccessTools.FieldRefAccess<Character, CharacterAnimEvent>("m_animEvent");

		private static readonly FieldRef<ZSyncAnimation, Animator> AnimSync = AccessTools.FieldRefAccess<ZSyncAnimation, Animator>("m_animator");

		private static readonly FieldRef<Character, Vector3> VitesseMarche = AccessTools.FieldRefAccess<Character, Vector3>("m_currentVel");

		private static readonly Func<Player, float> CoutEsquive = AccessTools.MethodDelegate<Func<Player, float>>(AccessTools.Method(typeof(Player), "GetDodgeStaminaUse", (Type[])null, (Type[])null), (object)null, true);

		private static readonly int Emission = Shader.PropertyToID("_EmissionColor");

		private static readonly int MasqueSol = LayerMask.GetMask(new string[4] { "terrain", "static_solid", "Default", "piece" });

		private Player joueur;

		private ZNetView nview;

		private ZSyncAnimation zanim;

		private ItemDrop mainsNues;

		private Animator animHumain;

		private Animator animLouve;

		private CharacterAnimEvent evtHumain;

		private CharacterAnimEvent evtLouve;

		private MasqueHumain masque;

		private GameObject collier;

		private Transform anneau;

		private GameObject corde;

		private Mesh maillageCorde;

		private Vector3[] cordeCentres;

		private Vector3[] cordeSommets;

		private Vector3[] cordeNormales;

		private readonly float[] solCorde = new float[3];

		private float prochainSol;

		private bool echecVisuel;

		private int coupCombo = -1;

		private int coupPrevu;

		private float dernierCoup = -99f;

		private Vector3 elanDir;

		private float elanDebut = -99f;

		private float elanDuree;

		private float elanVitesse;

		private float elanSaut;

		private bool elanSaute;

		private float esquiveFin = -99f;

		private float invincibleJusqua = -99f;

		private bool invincibleReseau;

		private static readonly FieldRef<Character, Vector3> Direction = AccessTools.FieldRefAccess<Character, Vector3>("m_moveDir");

		private static readonly FieldRef<Character, bool> Course = AccessTools.FieldRefAccess<Character, bool>("m_run");

		private static readonly FieldRef<Character, bool> Marche = AccessTools.FieldRefAccess<Character, bool>("m_walk");

		private float holderAbsentDepuis;

		private float prochaineTeleportation;

		private float prochainRappel;

		private readonly Dictionary<Character, Color> surlignes = new Dictionary<Character, Color>();

		private readonly List<Character> aEteindre = new List<Character>();

		private float prochainInstinct;

		private float prochainePulsation;

		private float prochainRafraichissement;

		private float restaurationA = -1f;

		private static readonly Func<Character, bool> PrendEntree = AccessTools.MethodDelegate<Func<Character, bool>>(AccessTools.Method(typeof(Character), "TakeInput", (Type[])null, (Type[])null), (object)null, true);

		private Transform osCou;

		private Transform osTete;

		private Transform osMachoire;

		private float hurlementDebut = -99f;

		private float hurlementDuree = 3f;

		private readonly ClipLouve clipHurlement = new ClipLouve();

		private AudioSource voix;

		public bool Transforme { get; private set; }

		public GameObject Visuel { get; private set; }

		public bool EnEsquive => Time.time < esquiveFin;

		public bool Invincible => Time.time < invincibleJusqua;

		public bool EnElan => Time.time - elanDebut <= elanDuree;

		public bool Proprietaire
		{
			get
			{
				if ((Object)(object)nview != (Object)null && nview.IsValid())
				{
					return nview.IsOwner();
				}
				return false;
			}
		}

		public bool Louve
		{
			get
			{
				if ((Object)(object)nview != (Object)null && nview.IsValid())
				{
					return nview.GetZDO().GetBool(PinkVelvetBodysuit.Louve.HashLouve, false);
				}
				return false;
			}
		}

		public ZDOID Tenant
		{
			get
			{
				//IL_001b: 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)
				if (!((Object)(object)nview != (Object)null) || !nview.IsValid())
				{
					return ZDOID.None;
				}
				return nview.GetZDO().GetZDOID(PinkVelvetBodysuit.Louve.HashLaisse);
			}
		}

		private static float VitesseAttaque => Mathf.Clamp(PinkVelvetBodysuit.Louve.VitesseAttaques.Value, 0.5f, 2f);

		public bool Hurle => Time.time < hurlementDebut + hurlementDuree;

		private static float Pulsation => 0.75f + 0.25f * Mathf.Sin(Time.time * 2.2f);

		private void Awake()
		{
			joueur = ((Component)this).GetComponent<Player>();
			nview = ((Component)this).GetComponent<ZNetView>();
			zanim = ((Component)this).GetComponent<ZSyncAnimation>();
			Tous[(Character)(object)joueur] = this;
			if ((Object)(object)nview != (Object)null && nview.GetZDO() != null)
			{
				nview.Register<ZDOID>("LaivyLouve_Laisse", (Action<long, ZDOID>)RPC_Laisse);
				nview.Register("LaivyLouve_Hurler", (Action<long>)RPC_Hurler);
				nview.Register<int, Vector3, Vector3>("Louve_Magie", (Action<long, int, Vector3, Vector3>)RPC_Magie);
			}
			restaurationA = Time.time + 2f;
		}

		private void OnDestroy()
		{
			Tous.Remove((Character)(object)joueur);
			EteindreInstinct();
			if ((Object)(object)corde != (Object)null)
			{
				Object.Destroy((Object)(object)corde);
			}
		}

		public void DebutLouve(ItemDrop crocs)
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if (Proprietaire)
			{
				if ((Object)(object)mainsNues == (Object)null)
				{
					mainsNues = ((Humanoid)joueur).m_unarmedWeapon;
				}
				if ((Object)(object)crocs != (Object)null)
				{
					((Humanoid)joueur).m_unarmedWeapon = crocs;
				}
				nview.GetZDO().Set(PinkVelvetBodysuit.Louve.HashLaisse, ZDOID.None);
				nview.GetZDO().Set(PinkVelvetBodysuit.Louve.HashLouve, true);
			}
		}

		public void FinLouve()
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)mainsNues != (Object)null)
			{
				((Humanoid)joueur).m_unarmedWeapon = mainsNues;
			}
			elanDebut = (esquiveFin = (invincibleJusqua = -99f));
			coupCombo = -1;
			if (Proprietaire)
			{
				nview.GetZDO().Set(PinkVelvetBodysuit.Louve.HashLouve, false);
				nview.GetZDO().Set(PinkVelvetBodysuit.Louve.HashLaisse, ZDOID.None);
				RendreInvincibleReseau(oui: false);
			}
		}

		public int PreparerCoup(int nombre)
		{
			coupPrevu = ((Time.time - dernierCoup < 2f) ? ((coupCombo + 1) % nombre) : 0);
			return coupPrevu;
		}

		public void AttaqueLancee(bool secondaire)
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			if (!Transforme || !Proprietaire)
			{
				return;
			}
			if ((Object)(object)animLouve != (Object)null && animLouve.speed > 0.01f)
			{
				animLouve.speed = VitesseAttaque;
			}
			if (!secondaire)
			{
				coupCombo = coupPrevu;
				dernierCoup = Time.time;
				return;
			}
			coupCombo = -1;
			Vector3 val = ((Component)joueur).transform.forward;
			val.y = 0f;
			((Vector3)(ref val)).Normalize();
			float num = Mathf.Clamp(PinkVelvetBodysuit.Louve.DistanceBond.Value, 1f, 10f) * CapacitesLouve.FacteurBond(joueur);
			Character val2 = ProieDevant(val, num + 1.5f);
			if ((Object)(object)val2 != (Object)null)
			{
				Vector3 val3 = ((Component)val2).transform.position - ((Component)joueur).transform.position;
				val3.y = 0f;
				num = Mathf.Clamp(((Vector3)(ref val3)).magnitude - val2.GetRadius() - 0.9f, 0.5f, num);
				val = ((Vector3)(ref val3)).normalized;
				((Component)joueur).transform.rotation = Quaternion.LookRotation(val);
				Rigidbody component = ((Component)joueur).GetComponent<Rigidbody>();
				if ((Object)(object)component != (Object)null)
				{
					component.rotation = ((Component)joueur).transform.rotation;
				}
			}
			Elan(val, 0.4f, num, 2.4f);
			CapacitesLouve.Bond(joueur, 0.4f);
		}

		private Character ProieDevant(Vector3 devant, float portee)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			Character result = null;
			float num = float.MaxValue;
			foreach (Character allCharacter in Character.GetAllCharacters())
			{
				if (!((Object)(object)allCharacter == (Object)null) && !((Object)(object)allCharacter == (Object)(object)joueur) && !allCharacter.IsDead() && BaseAI.IsEnemy((Character)(object)joueur, allCharacter))
				{
					Vector3 val = ((Component)allCharacter).transform.position - ((Component)joueur).transform.position;
					val.y = 0f;
					float magnitude = ((Vector3)(ref val)).magnitude;
					if (!(magnitude > portee) && !(magnitude < 0.1f) && !(Vector3.Angle(devant, val) > 30f) && !(Mathf.Abs(((Component)allCharacter).transform.position.y - ((Component)joueur).transform.position.y) > 2.5f) && magnitude < num)
					{
						num = magnitude;
						result = allCharacter;
					}
				}
			}
			return result;
		}

		public bool Esquiver(Vector3 entree, bool parade)
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			if (!Transforme || !Proprietaire || Time.time < esquiveFin + 0.15f)
			{
				return false;
			}
			if (!((Character)joueur).IsOnGround() || ((Character)joueur).IsDead() || ((Character)joueur).InAttack() || ((Character)joueur).IsStaggering() || ((Character)joueur).IsEncumbered() || ((Character)joueur).IsAttached() || ((Character)joueur).IsSwimming())
			{
				return false;
			}
			Vector3 lookDir = ((Character)joueur).GetLookDir();
			lookDir.y = 0f;
			((Vector3)(ref lookDir)).Normalize();
			Vector3 dir = entree.z * lookDir + entree.x * Vector3.Cross(Vector3.up, lookDir);
			if (((Vector3)(ref dir)).sqrMagnitude < 0.01f)
			{
				dir = (parade ? (-lookDir) : lookDir);
			}
			dir.y = 0f;
			((Vector3)(ref dir)).Normalize();
			float num = CoutEsquive(joueur);
			if (!((Character)joueur).HaveStamina(num))
			{
				Hud instance = Hud.instance;
				if (instance != null)
				{
					instance.StaminaBarEmptyFlash();
				}
				return false;
			}
			((Character)joueur).UseStamina(num);
			((Character)joueur).RaiseSkill((SkillType)108, 0.1f);
			((Character)joueur).AddNoise(5f);
			joueur.m_dodgeEffects.Create(((Component)joueur).transform.position, Quaternion.identity, ((Component)joueur).transform, 1f, -1, ((Character)joueur).GetZDOID());
			ZSyncAnimation obj = zanim;
			if (obj != null)
			{
				obj.SetTrigger("jump");
			}
			Elan(dir, 0.38f, 3.6f, 1.6f);
			esquiveFin = Time.time + 0.38f + 0.05f;
			invincibleJusqua = Time.time + 0.32f;
			RendreInvincibleReseau(oui: true);
			return true;
		}

		public void Ruer(Vector3 dir, float duree, float distance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			Elan(dir, duree, distance, 0.8f);
			esquiveFin = Time.time + duree + 0.05f;
			invincibleJusqua = Time.time + duree;
			RendreInvincibleReseau(oui: true);
		}

		private void Elan(Vector3 dir, float duree, float distance, float saut)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			elanDir = dir;
			elanDebut = Time.time;
			elanDuree = duree;
			elanVitesse = distance / (0.75f * duree);
			elanSaut = saut;
			elanSaute = false;
		}

		public void AppliquerElan(ref Vector3 vitesse)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			float num = Time.time - elanDebut;
			if (num < 0f || num > elanDuree || !Transforme)
			{
				return;
			}
			float num2 = elanVitesse * (1f - 0.5f * num / elanDuree);
			Vector3 val = Vector3.zero;
			if (((Character)joueur).IsOnGround())
			{
				val = VitesseMarche.Invoke((Character)(object)joueur) - vitesse;
				val.y = 0f;
				if (((Vector3)(ref val)).magnitude > 20f)
				{
					val = ((Vector3)(ref val)).normalized * 20f;
				}
			}
			vitesse.x = elanDir.x * num2 - val.x;
			vitesse.z = elanDir.z * num2 - val.z;
			if (!elanSaute)
			{
				elanSaute = true;
				vitesse.y = Mathf.Max(vitesse.y, elanSaut);
			}
		}

		private void RendreInvincibleReseau(bool oui)
		{
			if (invincibleReseau != oui && Proprietaire)
			{
				invincibleReseau = oui;
				nview.GetZDO().Set(ZDOVars.s_dodgeinv, oui);
			}
		}

		private void Update()
		{
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)nview == (Object)null || !nview.IsValid())
			{
				return;
			}
			clipHurlement.Suivre();
			if (restaurationA > 0f && Time.time > restaurationA && Proprietaire && (Object)(object)joueur == (Object)(object)Player.m_localPlayer)
			{
				restaurationA = -1f;
				if (SE_Louve.Restant(joueur) > 0f && !Metamorphose.EnPause(joueur) && (Object)(object)PinkVelvetBodysuit.Louve.Effet != (Object)null && !((Character)joueur).GetSEMan().HaveStatusEffect(((StatusEffect)PinkVelvetBodysuit.Louve.Effet).NameHash()))
				{
					((Character)joueur).GetSEMan().AddStatusEffect((StatusEffect)(object)PinkVelvetBodysuit.Louve.Effet, true, 0, 0f, (short)(-1));
				}
			}
			if (Proprietaire && (Object)(object)joueur == (Object)(object)Player.m_localPlayer && Metamorphose.Touche != null && (int)Metamorphose.Touche.Value != 0 && Input.GetKeyDown(Metamorphose.Touche.Value) && ArbreLouve.EntreeLibre())
			{
				Metamorphose.Basculer(joueur);
			}
			if (Transforme && Proprietaire && (Object)(object)joueur == (Object)(object)Player.m_localPlayer && !((Character)joueur).IsDead())
			{
				CompetenceLoup.Suivre(joueur, nview, Time.deltaTime);
			}
			bool flag = Louve && !((Character)joueur).IsDead();
			if (flag != Transforme)
			{
				if (flag)
				{
					Transformer();
				}
				else
				{
					Retransformer();
				}
			}
			if (Transforme && (Object)(object)animHumain != (Object)null && ((Behaviour)animHumain).enabled)
			{
				((Behaviour)animHumain).enabled = false;
			}
			if (Proprietaire && Transforme)
			{
				SurveillerLaisse();
				if ((Object)(object)animLouve != (Object)null && animLouve.speed > 0.01f && Mathf.Abs(animLouve.speed - VitesseAttaque) > 0.001f && ((Character)joueur).InAttack())
				{
					animLouve.speed = VitesseAttaque;
				}
			}
			if (invincibleReseau && !Invincible)
			{
				RendreInvincibleReseau(oui: false);
			}
			if ((Object)(object)joueur == (Object)(object)Player.m_localPlayer && Transforme && Hurlement.Touche != null && Input.GetKeyDown(Hurlement.Touche.Value) && PrendEntree((Character)(object)joueur))
			{
				Hurler();
			}
			if ((Object)(object)joueur == (Object)(object)Player.m_localPlayer && Transforme)
			{
				if (Time.time >= prochainInstinct)
				{
					prochainInstinct = Time.time + 0.5f;
					Instinct();
				}
				if (Time.time >= prochainePulsation)
				{
					prochainePulsation = Time.time + 0.1f;
					PulserInstinct();
				}
			}
			else if (surlignes.Count > 0)
			{
				EteindreInstinct();
			}
		}

		private void LateUpdate()
		{
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			if (Transforme)
			{
				PoseHurlement();
			}
			if (!Transforme)
			{
				if ((Object)(object)corde != (Object)null && corde.activeSelf)
				{
					corde.SetActive(false);
				}
				return;
			}
			Character val = TrouverTenant();
			bool flag = (Object)(object)val != (Object)null;
			if ((Object)(object)collier != (Object)null && collier.activeSelf != flag)
			{
				collier.SetActive(flag);
			}
			if (!flag)
			{
				if ((Object)(object)corde != (Object)null && corde.activeSelf)
				{
					corde.SetActive(false);
				}
			}
			else
			{
				DessinerCorde(((Object)(object)anneau != (Object)null) ? anneau.position : ((Character)joueur).GetCenterPoint(), PointMain(val));
			}
		}

		public bool Hurler()
		{
			if (!Transforme || !Proprietaire || ((Character)joueur).IsDead() || ((Character)joueur).InAttack() || Time.time < hurlementDebut + hurlementDuree + 0.8f)
			{
				return false;
			}
			nview.InvokeRPC(ZNetView.Everybody, "LaivyLouve_Hurler", Array.Empty<object>());
			CompetenceLoup.Hurlement(joueur);
			return true;
		}

		private void RPC_Magie(long expediteur, int sorte, Vector3 point, Vector3 direction)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			MagieLouve.Jouer(joueur, sorte, point, direction);
		}

		private void RPC_Hurler(long expediteur)
		{
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			if (!Transforme)
			{
				return;
			}
			AudioClip val = Hurlement.Son();
			hurlementDebut = Time.time;
			float num = 1.08f + Random.Range(-0.02f, 0.02f);
			hurlementDuree = (((Object)(object)val != (Object)null) ? Mathf.Clamp(val.length / num, 2.5f, 6f) : 3f);
			clipHurlement.Jouer(animLouve, "C_Hawl", hurlementDuree);
			if (!((Object)(object)val == (Object)null))
			{
				if ((Object)(object)voix == (Object)null)
				{
					GameObject val2 = new GameObject("LouveVoix");
					val2.transform.SetParent(((Component)this).transform, false);
					val2.transform.localPosition = new Vector3(0f, 1.4f, 0.7f);
					voix = val2.AddComponent<AudioSource>();
					voix.playOnAwake = false;
					voix.spatialBlend = 1f;
					voix.rolloffMode = (AudioRolloffMode)1;
					voix.minDistance = 8f;
					voix.maxDistance = 110f;
					voix.dopplerLevel = 0f;
				}
				voix.outputAudioMixerGroup = Hote.GroupeEffets;
				voix.volume = Mathf.Clamp01(Hurlement.Volume.Value);
				voix.pitch = num;
				voix.clip = val;
				voix.Play();
			}
		}

		private void PoseHurlement()
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			float num = Time.time - hurlementDebut;
			if (!(num < 0f) && !(num > hurlementDuree) && !((Object)(object)osTete == (Object)null) && !clipHurlement.EnCours)
			{
				float num2 = Mathf.SmoothStep(0f, 1f, num / 0.35f) * (1f - Mathf.SmoothStep(0f, 1f, (num - (hurlementDuree - 0.5f)) / 0.5f));
				Vector3 right = ((Component)joueur).transform.right;
				if ((Object)(object)osCou != (Object)null && (Object)(object)osCou != (Object)(object)osTete)
				{
					osCou.rotation = Quaternion.AngleAxis(-32f * num2, right) * osCou.rotation;
				}
				osTete.rotation = Quaternion.AngleAxis(-30f * num2, right) * osTete.rotation;
				if ((Object)(object)osMachoire != (Object)null)
				{
					osMachoire.rotation = Quaternion.AngleAxis(24f * num2 * (0.75f + 0.25f * Mathf.Sin(num * 5.5f)), right) * osMachoire.rotation;
				}
			}
		}

		private void Transformer()
		{
			if (echecVisuel)
			{
				return;
			}
			try
			{
				GameObject val = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab("Wolf") : null);
				Transform val2 = (((Object)(object)val != (Object)null) ? val.transform.Find("Visual") : null);
				if ((Object)(object)val2 == (Object)null)
				{
					echecVisuel = true;
					Debug.LogWarning((object)("[" + Hote.Nom + "] Modèle du loup introuvable : la louve garde son apparence."));
					return;
				}
				Visuel = Object.Instantiate<GameObject>(((Component)val2).gameObject, ((Component)this).transform, false);
				((Object)Visuel).name = "LouveVisuel";
				Collider[] componentsInChildren = Visuel.GetComponentsInChildren<Collider>(true);
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					Object.Destroy((Object)(object)componentsInChildren[i]);
				}
				Rigidbody[] componentsInChildren2 = Visuel.GetComponentsInChildren<Rigidbody>(true);
				for (int i = 0; i < componentsInChildren2.Length; i++)
				{
					Object.Destroy((Object)(object)componentsInChildren2[i]);
				}
				animLouve = Visuel.GetComponentInChildren<Animator>(true);
				evtLouve = (((Object)(object)animLouve != (Object)null) ? ((Component)animLouve).GetComponent<CharacterAnimEvent>() : null);
				if ((Object)(object)animLouve == (Object)null)
				{
					Object.Destroy((Object)(object)Visuel);
					echecVisuel = true;
					return;
				}
				animLouve.logWarnings = false;
				animLouve.cullingMode = (AnimatorCullingMode)(!((Object)(object)joueur == (Object)(object)Player.m_localPlayer));
				animHumain = AnimPerso.Invoke((Character)(object)joueur);
				evtHumain = EvtPerso.Invoke((Character)(object)joueur);
				AnimPerso.Invoke((Character)(object)joueur) = animLouve;
				if ((Object)(object)evtLouve != (Object)null)
				{
					EvtPerso.Invoke((Character)(object)joueur) = evtLouve;
				}
				if ((Object)(object)zanim != (Object)null)
				{
					AnimSync.Invoke(zanim) = animLouve;
				}
				AllureLouve.Suivre(zanim);
				if ((Object)(object)animHumain != (Object)null)
				{
					((Behaviour)animHumain).enabled = false;
				}
				if ((Object)(object)evtHumain != (Object)null)
				{
					((Behaviour)evtHumain).enabled = false;
				}
				if ((Object)(object)masque == (Object)null)
				{
					masque = ((Component)this).gameObject.AddComponent<MasqueHumain>();
				}
				masque.Cacher(((Character)joueur).GetVisual());
				ConstruireCollier();
				Visuel.AddComponent<MarquesLouve>().Demarrer(joueur);
				Transform[] componentsInChildren3 = Visuel.GetComponentsInChildren<Transform>(true);
				osCou = ((IEnumerable<Transform>)componentsInChildren3).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name.IndexOf("neck", StringComparison.OrdinalIgnoreCase) >= 0));
				osTete = ((IEnumerable<Transform>)componentsInChildren3).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name.IndexOf("head", StringComparison.OrdinalIgnoreCase) >= 0));
				osMachoire = ((IEnumerable<Transform>)componentsInChildren3).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name.IndexOf("jaw", StringComparison.OrdinalIgnoreCase) >= 0));
				Transforme = true;
			}
			catch (Exception arg)
			{
				echecVisuel = true;
				Debug.LogError((object)$"[{Hote.Nom}] Transformation en louve impossible : {arg}");
				Retransformer();
			}
		}

		private void Retransformer()
		{
			if ((Object)(object)animHumain != (Object)null)
			{
				AnimPerso.Invoke((Character)(object)joueur) = animHumain;
				if ((Object)(object)zanim != (Object)null)
				{
					AnimSync.Invoke(zanim) = animHumain;
				}
				AllureLouve.Oublier(zanim);
				((Behaviour)animHumain).enabled = true;
			}
			if ((Object)(object)evtHumain != (Object)null)
			{
				EvtPerso.Invoke((Character)(object)joueur) = evtHumain;
				((Behaviour)evtHumain).enabled = true;
			}
			if ((Object)(object)masque != (Object)null)
			{
				masque.Montrer();
			}
			clipHurlement.Arreter();
			if ((Object)(object)joueur == (Object)(object)Player.m_localPlayer)
			{
				CompetenceLoup.Oublier();
			}
			if ((Object)(object)Visuel != (Object)null)
			{
				Object.Destroy((Object)(object)Visuel);
			}
			Visuel = null;
			collier = null;
			anneau = null;
			osCou = (osTete = (osMachoire = null));
			hurlementDebut = -99f;
			if ((Object)(object)voix != (Object)null)
			{
				voix.Stop();
			}
			animLouve = null;
			evtLouve = null;
			if ((Object)(object)corde != (Object)null)
			{
				corde.SetActive(false);
			}
			EteindreInstinct();
			Transforme = false;
		}

		private void ConstruireCollier()
		{
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Unknown result type (might be due to invalid IL or missing references)
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: 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_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0573: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_057d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0597: Unknown result type (might be due to invalid IL or missing references)
			//IL_059a: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_062e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0633: Unknown result type (might be due to invalid IL or missing references)
			//IL_0638: Unknown result type (might be due to invalid IL or missing references)
			//IL_063d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0655: Unknown result type (might be due to invalid IL or missing references)
			//IL_065a: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Unknown result type (might be due to invalid IL or missing references)
			//IL_066e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0678: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_0685: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0753: Unknown result type (might be due to invalid IL or missing references)
			//IL_0775: Unknown result type (might be due to invalid IL or missing references)
			//IL_0778: Unknown result type (might be due to invalid IL or missing references)
			//IL_077f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0784: Unknown result type (might be due to invalid IL or missing references)
			Transform val = ((IEnumerable<Transform>)Visuel.GetComponentsInChildren<Transform>(true)).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name.IndexOf("neck", StringComparison.OrdinalIgnoreCase) >= 0));
			Transform val2 = ((IEnumerable<Transform>)Visuel.GetComponentsInChildren<Transform>(true)).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name.IndexOf("head", StringComparison.OrdinalIgnoreCase) >= 0));
			if ((Object)(object)val == (Object)null && (Object)(object)val2 != (Object)null)
			{
				val = val2.parent;
			}
			SkinnedMeshRenderer val3 = (from r in Visuel.GetComponentsInChildren<SkinnedMeshRenderer>(true)
				orderby ((Object)(object)r.sharedMesh != (Object)null) ? r.sharedMesh.vertexCount : 0 descending
				select r).FirstOrDefault();
			Material[] array = PinkVelvetBodysuit.Louve.MateriauxCollier();
			if ((Object)(object)val == (Object)null || (Object)(object)val3 == (Object)null || array == null)
			{
				return;
			}
			Vector3 position = val.position;
			Vector3 val4 = (((Object)(object)val2 != (Object)null && (Object)(object)val2 != (Object)(object)val) ? (val2.position - position) : val.TransformDirection(Vector3.up));
			float num = Mathf.Max(0.05f, ((Vector3)(ref val4)).magnitude);
			Vector3 normalized = ((Vector3)(ref val4)).normalized;
			Vector3 val5 = position + normalized * (num * 0.35f);
			Vector3[] array2 = PointsMonde(val3);
			Vector3 val6 = Vector3.ProjectOnPlane(Vector3.down, normalized);
			Vector3 bas = ((Vector3)(ref val6)).normalized;
			if (((Vector3)(ref bas)).sqrMagnitude < 0.5f)
			{
				val6 = Vector3.ProjectOnPlane(Vector3.forward, normalized);
				bas = ((Vector3)(ref val6)).normalized;
			}
			val6 = Vector3.Cross(normalized, bas);
			Vector3 cote = ((Vector3)(ref val6)).normalized;
			int indexCou = Array.IndexOf(val3.bones, val);
			BoneWeight[] poids = (val3.sharedMesh.isReadable ? val3.sharedMesh.boneWeights : null);
			bool parPoids = indexCou >= 0 && poids != null && poids.Length == array2.Length;
			List<Vector3> list = Radiaux(array2, val5, normalized, (int i) => parPoids && ((BoneWeight)(ref poids[i])).boneIndex0 == indexCou && ((BoneWeight)(ref poids[i])).weight0 >= 0.5f, num * 0.5f);
			if (list.Count < 8)
			{
				list = Radiaux(array2, val5, normalized, (int i) => true, Mathf.Clamp(num * 0.3f, 0.04f, 0.08f));
			}
			float num2 = 0.115f;
			float num3 = 0.1f;
			if (list.Count >= 8)
			{
				float mediane = Centile(list.Select((Vector3 r) => ((Vector3)(ref r)).magnitude).ToList(), 0.5f);
				List<Vector3> source = list.Where((Vector3 r) => ((Vector3)(ref r)).magnitude < mediane * 1.4f).ToList();
				num2 = Centile(source.Select((Vector3 r) => Mathf.Abs(Vector3.Dot(r, bas))).ToList(), 0.95f);
				num3 = Centile(source.Select((Vector3 r) => Mathf.Abs(Vector3.Dot(r, cote))).ToList(), 0.95f);
			}
			num2 = Mathf.Clamp(num2, 0.04f, 0.26f) + 0.018f;
			num3 = Mathf.Clamp(num3, 0.04f, 0.26f) + 0.018f;
			Debug.Log((object)$"[{Hote.Nom}] Collier de louve : os {((Object)val).name}, {list.Count} sommets mesurés, rayons {num2:0.000} x {num3:0.000} m");
			Maillage maillage = new Maillage();
			List<Vector3> list2 = new List<Vector3>();
			for (int num4 = 0; num4 <= 36; num4++)
			{
				float num5 = MathF.PI * 2f * (float)num4 / 36f;
				list2.Add(val5 + bas * (Mathf.Cos(num5) * num2) + cote * (Mathf.Sin(num5) * num3));
			}
			Vector3[] array3 = (Vector3[])(object)new Vector3[list2.Count];
			Vector3[] array4 = (Vector3[])(object)new Vector3[list2.Count];
			for (int num6 = 0; num6 < list2.Count; num6++)
			{
				val6 = list2[Mathf.Min(list2.Count - 1, num6 + 1)] - list2[Mathf.Max(0, num6 - 1)];
				Vector3 normalized2 = ((Vector3)(ref val6)).normalized;
				val6 = list2[num6] - val5;
				Vector3 val7 = (array4[num6] = ((Vector3)(ref val6)).normalized);
				int num7 = num6;
				val6 = Vector3.Cross(val7, normalized2);
				array3[num7] = ((Vector3)(ref val6)).normalized;
			}
			float num8 = Mathf.Clamp(Mathf.Max(num2, num3) * 0.42f, 0.02f, 0.05f);
			maillage.Tube(0, list2, array3, array4, Enumerable.Repeat(num8 * 0.5f, list2.Count).ToArray(), Enumerable.Repeat(0.008f, list2.Count).ToArray(), 12, 4f, fermerDebut: false, fermerFin: false);
			Vector3 val8 = val5 + bas * (num2 + 0.006f);
			List<Vector3> list3 = new List<Vector3>();
			float num9 = Mathf.Clamp(num8 * 0.45f, 0.012f, 0.02f);
			Vector3 val9 = val8 + bas * num9;
			for (int num10 = 0; num10 <= 24; num10++)
			{
				float num11 = MathF.PI * 2f * (float)num10 / 24f;
				list3.Add(val9 + bas * (Mathf.Cos(num11) * num9) + normalized * (Mathf.Sin(num11) * num9));
			}
			Maillage.Reperes(list3, cote, out var droites, out var hauts);
			float[] array5 = Enumerable.Repeat(0.0028f, list3.Count).ToArray();
			maillage.Tube(1, list3, droites, hauts, array5, array5, 10, 2f, fermerDebut: false, fermerFin: false);
			Vector3 val10 = val9 + bas * (num9 + 0.02f);
			maillage.Disque(1, val10 - cote * 0.0015f, bas, normalized, 0.016f, 20);
			maillage.Disque(1, val10 + cote * 0.0015f, normalized, bas, 0.016f, 20);
			Mesh val11 = maillage.Creer("Louve_Collier");
			Vector3[] vertices = val11.vertices;
			Vector3[] normals = val11.normals;
			for (int num12 = 0; num12 < vertices.Length; num12++)
			{
				vertices[num12] = val.InverseTransformPoint(vertices[num12]);
				int num13 = num12;
				val6 = val.InverseTransformDirection(normals[num12]);
				normals[num13] = ((Vector3)(ref val6)).normalized;
			}
			val11.vertices = vertices;
			val11.normals = normals;
			val11.RecalculateBounds();
			val11.RecalculateTangents();
			collier = Outils3D.Objet("Louve_Collier", val11, array, val);
			collier.layer = Visuel.layer;
			anneau = new GameObject("Louve_Anneau").transform;
			anneau.SetParent(val, false);
			anneau.position = val9 + bas * num9;
			collier.SetActive(false);
		}

		private static Vector3[] PointsMonde(SkinnedMeshRenderer peau)
		{
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Expected O, but got Unknown
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: 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_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: 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_014b: 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_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			Mesh sharedMesh = peau.sharedMesh;
			Transform[] bones = peau.bones;
			if (sharedMesh.isReadable && bones != null && bones.Length != 0)
			{
				Vector3[] vertices = sharedMesh.vertices;
				BoneWeight[] boneWeights = sharedMesh.boneWeights;
				Matrix4x4[] bindposes = sharedMesh.bindposes;
				if (boneWeights.Length == vertices.Length && bindposes.Length == bones.Length)
				{
					Matrix4x4[] array = (Matrix4x4[])(object)new Matrix4x4[bones.Length];
					for (int i = 0; i < bones.Length; i++)
					{
						array[i] = (((Object)(object)bones[i] != (Object)null) ? (bones[i].localToWorldMatrix * bindposes[i]) : Matrix4x4.zero);
					}
					Vector3[] array2 = (Vector3[])(object)new Vector3[vertices.Length];
					for (int j = 0; j < vertices.Length; j++)
					{
						BoneWeight val = boneWeights[j];
						array2[j] = ((Matrix4x4)(ref array[((BoneWeight)(ref val)).boneIndex0])).MultiplyPoint3x4(vertices[j]) * ((BoneWeight)(ref val)).weight0 + ((Matrix4x4)(ref array[((BoneWeight)(ref val)).boneIndex1])).MultiplyPoint3x4(vertices[j]) * ((BoneWeight)(ref val)).weight1 + ((Matrix4x4)(ref array[((BoneWeight)(ref val)).boneIndex2])).MultiplyPoint3x4(vertices[j]) * ((BoneWeight)(ref val)).weight2 + ((Matrix4x4)(ref array[((BoneWeight)(ref val)).boneIndex3])).MultiplyPoint3x4(vertices[j]) * ((BoneWeight)(ref val)).weight3;
					}
					return array2;
				}
			}
			Mesh val2 = new Mesh();
			peau.BakeMesh(val2);
			Vector3[] vertices2 = val2.vertices;
			Object.Destroy((Object)(object)val2);
			Matrix4x4 avecEchelle = ((Component)peau).transform.localToWorldMatrix;
			Matrix4x4 sansEchelle = Matrix4x4.TRS(((Component)peau).transform.position, ((Component)peau).transform.rotation, Vector3.one);
			Vector3[] array3 = vertices2.Select((Vector3 p) => ((Matrix4x4)(ref avecEchelle)).MultiplyPoint3x4(p)).ToArray();
			Vector3[] array4 = vertices2.Select((Vector3 p) => ((Matrix4x4)(ref sansEchelle)).MultiplyPoint3x4(p)).ToArray();
			Bounds val3 = Boite(array3);
			Vector3 size = ((Bounds)(ref val3)).size;
			float magnitude = ((Vector3)(ref size)).magnitude;
			val3 = ((Renderer)peau).bounds;
			size = ((Bounds)(ref val3)).size;
			float num = Mathf.Abs(magnitude - ((Vector3)(ref size)).magnitude);
			val3 = Boite(array4);
			size = ((Bounds)(ref val3)).size;
			float magnitude2 = ((Vector3)(ref size)).magnitude;
			val3 = ((Renderer)peau).bounds;
			size = ((Bounds)(ref val3)).size;
			float num2 = Mathf.Abs(magnitude2 - ((Vector3)(ref size)).magnitude);
			if (!(num <= num2))
			{
				return array4;
			}
			return array3;
		}

		private static List<Vector3> Radiaux(Vector3[] sommets, Vector3 centre, Vector3 axe, Func<int, bool> retenu, float demiLongueur)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			for (int i = 0; i < sommets.Length; i++)
			{
				if (!retenu(i))
				{
					continue;
				}
				Vector3 val = sommets[i] - centre;
				float num = Vector3.Dot(val, axe);
				if (!(Mathf.Abs(num) > demiLongueur))
				{
					Vector3 item = val - axe * num;
					if (((Vector3)(ref item)).magnitude < 0.3f)
					{
						list.Add(item);
					}
				}
			}
			return list;
		}

		private static float Centile(List<float> valeurs, float q)
		{
			if (valeurs.Count == 0)
			{
				return 0f;
			}
			valeurs.Sort();
			return valeurs[Mathf.Clamp(Mathf.RoundToInt(q * (float)(valeurs.Count - 1)), 0, valeurs.Count - 1)];
		}

		private static Bounds Boite(Vector3[] points)
		{
			//IL_000f: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			Bounds result = default(Bounds);
			((Bounds)(ref result))..ctor((points.Length != 0) ? points[0] : Vector3.zero, Vector3.zero);
			foreach (Vector3 val in points)
			{
				((Bounds)(ref result)).Encapsulate(val);
			}
			return result;
		}

		public Character TrouverTenant()
		{
			//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_0024: Unknown result type (might be due to invalid IL or missing references)
			ZDOID tenant = Tenant;
			if (((ZDOID)(ref tenant)).IsNone() || (Object)(object)ZNetScene.instance == (Object)null)
			{
				return null;
			}
			GameObject val = ZNetScene.instance.FindInstance(tenant);
			Character val2 = (((Object)(object)val != (Object)null) ? val.GetComponent<Character>() : null);
			if (!((Object)(object)val2 != (Object)null) || val2.IsDead())
			{
				return null;
			}
			return val2;
		}

		private static Vector3 PointMain(Character tenant)
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			Player val = (Player)(object)((tenant is Player) ? tenant : null);
			if (val != null)
			{
				LouveJoueur louveJoueur = PinkVelvetBodysuit.Louve.Etat((Character)(object)val);
				VisEquipment component = ((Component)val).GetComponent<VisEquipment>();
				if (((Object)(object)louveJoueur == (Object)null || !louveJoueur.Transforme) && (Object)(object)component != (Object)null && (Object)(object)component.m_rightHand != (Object)null)
				{
					return component.m_rightHand.position;
				}
			}
			return tenant.GetCenterPoint();
		}

		private void RPC_Laisse(long expediteur, ZDOID tenant)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			if (Proprietaire && Louve)
			{
				ZDOID tenant2 = Tenant;
				GameObject val = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.FindInstance(tenant) : null);
				string text = (((Object)(object)val != (Object)null && (Object)(object)val.GetComponent<Player>() != (Object)null) ? val.GetComponent<Player>().GetPlayerName() : Textes.T("quelquun"));
				if (tenant2 == tenant)
				{
					nview.GetZDO().Set(PinkVelvetBodysuit.Louve.HashLaisse, ZDOID.None);
					((Character)joueur).Message((MessageType)2, Textes.T("laisse_retiree_par", text), 0, (Sprite)null, false);
				}
				else if ((Object)(object)val != (Object)null)
				{
					nview.GetZDO().Set(PinkVelvetBodysuit.Louve.HashLaisse, tenant);
					((Character)joueur).Message((MessageType)2, Textes.T("laisse_passee_par", text), 0, (Sprite)null, false);
					holderAbsentDepuis = 0f;
				}
			}
		}

		public void AttacherPour(Character tenant)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (Proprietaire)
			{
				nview.GetZDO().Set(PinkVelvetBodysuit.Louve.HashLaisse, ((Object)(object)tenant != (Object)null) ? tenant.GetZDOID() : ZDOID.None);
			}
		}

		private void SurveillerLaisse()
		{
			//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_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might