Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Envol v1.0.2
EnvolSixVikings.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
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 BepInEx; using BepInEx.Configuration; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Extensions; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using SixVikings; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("EnvolSixVikings")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.2.0")] [assembly: AssemblyInformationalVersion("1.0.2+2737fd47e42cf413712001cc298b2b1ba477845f")] [assembly: AssemblyProduct("EnvolSixVikings")] [assembly: AssemblyTitle("EnvolSixVikings")] [assembly: AssemblyVersion("1.0.2.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 SixVikings { internal static class Langue { internal static bool Francais { get { try { return Localization.instance.GetSelectedLanguage() == "French"; } catch (Exception) { return false; } } } internal static string T(string francais, string anglais) { if (!Francais) { return anglais; } return francais; } internal static string Reglage(string anglais, string francais) { return anglais + "\nFR : " + francais; } } } namespace EnvolSixVikings { public class SE_Ascension : StatusEffect { public float Hauteur; public float VitesseMax; public float Plafond; public float Facteur = 1f; private float depart; private float dernierY; private float secondes; private float bloquee; public string Fin { get; private set; } public string Obstacle { get; private set; } public float Gagne => dernierY - depart; public override void Setup(Character character) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((StatusEffect)this).Setup(character); depart = ((Component)character).transform.position.y; dernierY = depart; } public override void ModifyWalkVelocity(ref Vector3 vel) { try { Monter(ref vel); } catch (Exception e) { Fin = "erreur dans la montée"; Envol.Erreur("la montée", e); } } private void Monter(ref Vector3 vel) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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 (Fin != null || (Object)(object)base.m_character == (Object)null) { return; } float fixedDeltaTime = Time.fixedDeltaTime; float y = ((Component)base.m_character).transform.position.y; float num = Ascension.VitesseLancee(y, depart, Hauteur, VitesseMax, Facteur, Plafond); float reelle = (y - dernierY) / fixedDeltaTime; dernierY = y; secondes += fixedDeltaTime; bloquee = ((secondes > 0.4f && Ascension.Bloquee(num, reelle)) ? (bloquee + fixedDeltaTime) : 0f); string quoi; bool flag = Ascension.Barree(Envol.DistanceDuToit(base.m_character, num * fixedDeltaTime + 1f, out quoi), num, fixedDeltaTime); Fin = Ascension.Fin(y, depart, Hauteur, Plafond, bloquee, secondes, flag); if (Fin != null) { if ((flag || Fin == "plafond du monde atteint") && vel.y > 0f) { vel.y = 0f; } if (flag) { Obstacle = quoi; } } else { vel = new Vector3(vel.x * 0.9f, num + Envol.Pesanteur(fixedDeltaTime), vel.z * 0.9f); Envol.OublierLaChute(base.m_character); } } public override void ModifyFallDamage(float baseDamage, ref float damage) { damage = 0f; } public override bool IsDone() { if (Fin == null) { return ((StatusEffect)this).IsDone(); } return true; } public override string GetIconText() { return Affichage.Gagne(Gagne); } } public class SE_Planer : StatusEffect { private bool lance; private bool decroche; private float cap; private float avant; private float monteePayee; private Rigidbody corps; private bool enPanne; public bool Decroche => decroche; public override void ModifyWalkVelocity(ref Vector3 vel) { try { Planer(ref vel); } catch (Exception e) { enPanne = true; Envol.Erreur("le vol plané", e); } } public override bool IsDone() { if (!enPanne) { return ((StatusEffect)this).IsDone(); } return true; } public override string GetIconText() { return Affichage.Vitesse(avant); } private void Planer(ref Vector3 vel) { //IL_011c: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) Character character = base.m_character; Player val = (Player)(object)((character is Player) ? character : null); if (!((Object)(object)val == (Object)null) && !((Character)val).IsOnGround()) { ReglagesVol reglages = Envol.Reglages; float fixedDeltaTime = Time.fixedDeltaTime; float num = Envol.CapVoulu(val); if (!lance) { lance = true; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(vel.x, 0f, vel.z); avant = ((Vector3)(ref val2)).magnitude; cap = ((avant > 1f) ? Mathf.Repeat(Mathf.Atan2(val2.x, val2.z) * 57.29578f, 360f) : num); corps = ((Component)val).GetComponent<Rigidbody>(); } bool bonus = Envol.AElan((Character)(object)val); bool planeur = Envol.APlaneur(val); decroche = Vol.Decroche(reglages, decroche, bonus, val.GetStamina()); bool flag = !decroche; cap = Vol.Cap(cap, num, reglages.Virage, fixedDeltaTime); Vol.PasDElan(reglages, Envol.CommandeDuJoueur(), planeur, bonus, flag, avant, vel.y, monteePayee, ((Component)val).transform.position.y, fixedDeltaTime, out avant, out var nouvelleVerticale, out var tenue); monteePayee = Vol.MonteePayeeSuivante(tenue, nouvelleVerticale, monteePayee, Envol.Pesanteur(fixedDeltaTime)); Vector3 val3 = Quaternion.Euler(0f, cap, 0f) * Vector3.forward; if (tenue) { nouvelleVerticale += Envol.Pesanteur(fixedDeltaTime); } vel = val3 * avant + Vector3.up * nouvelleVerticale; float num2 = Vol.Endurance(reglages, bonus, fixedDeltaTime); if (num2 > 0f && flag) { ((Character)val).UseStamina(num2); } Envol.OublierLaChute((Character)(object)val); if ((Object)(object)corps != (Object)null) { corps.MoveRotation(Quaternion.LookRotation(val3)); } } } public override void ModifyFallDamage(float baseDamage, ref float damage) { damage = 0f; } } public class SE_Atterrissage : StatusEffect { private float pose; private float auSol; public override void ModifyFallDamage(float baseDamage, ref float damage) { damage = 0f; } public override void UpdateStatusEffect(float dt) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) ((StatusEffect)this).UpdateStatusEffect(dt); if (!((Object)(object)base.m_character == (Object)null)) { bool flag = base.m_character.IsOnGround(); pose = Vol.TempsPose(pose, dt, flag, base.m_character.IsSwimming(), base.m_character.GetVelocity().y); auSol = Vol.TempsAuSol(auSol, dt, flag); } } public override bool IsDone() { if (!((StatusEffect)this).IsDone()) { return Vol.ProtectionFinie(pose, auSol); } return true; } public override void ResetTime() { ((StatusEffect)this).ResetTime(); pose = 0f; auSol = 0f; } } internal static class Envol { public static readonly ReglagesVol Reglages = ReglagesVol.ParDefaut(); private static readonly HashSet<string> erreursDites = new HashSet<string>(); private static readonly FieldRef<Character, float> AltitudeMax = AccessTools.FieldRefAccess<Character, float>("m_maxAirAltitude"); private static int couchesDuToit; public static void Erreur(string geste, Exception e) { if (erreursDites.Add(geste)) { Plugin.EcrireUneErreur("Erreur dans " + geste + " (écrite une seule fois) : " + e); } } public static float Pesanteur(float dt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return (0f - Physics.gravity.y) * dt; } public static float DistanceDuToit(Character personnage, float portee) { string quoi; return DistanceDuToit(personnage, portee, out quoi); } public static float DistanceDuToit(Character personnage, float portee, out string quoi) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_0128: Unknown result type (might be due to invalid IL or missing references) quoi = null; if (couchesDuToit == 0) { couchesDuToit = LayerMask.GetMask(new string[7] { "Default", "static_solid", "Default_small", "piece", "terrain", "blocker", "vehicle" }); } float num = personnage.GetRadius() * 0.9f; Vector3 centerPoint = personnage.GetCenterPoint(); float y = personnage.GetTopPoint().y; float num2 = Mathf.Max(0f, y - centerPoint.y - num) + portee; RaycastHit val = default(RaycastHit); if (!Physics.SphereCast(centerPoint, num, Vector3.up, ref val, num2, couchesDuToit, (QueryTriggerInteraction)1)) { return float.PositiveInfinity; } Transform root = ((Component)((RaycastHit)(ref val)).collider).transform.root; quoi = ((Object)root).name.Replace("(Clone)", "") + (((Object)(object)root != (Object)(object)((Component)((RaycastHit)(ref val)).collider).transform) ? (" / " + ((Object)((RaycastHit)(ref val)).collider).name) : "") + ", couche " + LayerMask.LayerToName(((Component)((RaycastHit)(ref val)).collider).gameObject.layer); return Mathf.Max(0f, centerPoint.y + num + ((RaycastHit)(ref val)).distance - y); } public static float HauteurSousLesPieds(Character personnage) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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) if (couchesDuToit == 0) { couchesDuToit = LayerMask.GetMask(new string[7] { "Default", "static_solid", "Default_small", "piece", "terrain", "blocker", "vehicle" }); } RaycastHit val = default(RaycastHit); if (!Physics.Raycast(personnage.GetCenterPoint(), Vector3.down, ref val, 3000f, couchesDuToit, (QueryTriggerInteraction)1)) { return float.PositiveInfinity; } return Mathf.Max(0f, ((Component)personnage).transform.position.y - ((RaycastHit)(ref val)).point.y); } public static bool CielLibreAuDessus(Transform tremplin) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_008f: Unknown result type (might be due to invalid IL or missing references) if (couchesDuToit == 0) { couchesDuToit = LayerMask.GetMask(new string[7] { "Default", "static_solid", "Default_small", "piece", "terrain", "blocker", "vehicle" }); } RaycastHit[] array = Physics.SphereCastAll(tremplin.position + Vector3.up * 2.2f, 0.35f, Vector3.up, 10f, couchesDuToit, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if ((Object)(object)((RaycastHit)(ref val)).collider != (Object)null && !((Component)((RaycastHit)(ref val)).collider).transform.IsChildOf(tremplin)) { return false; } } return true; } public static void OublierLaChute(Character personnage) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) AltitudeMax.Invoke(personnage) = ((Component)personnage).transform.position.y; } public static bool APlaneur(Player joueur) { foreach (ItemData equippedItem in ((Humanoid)joueur).GetInventory().GetEquippedItems()) { if ((Object)(object)equippedItem.m_dropPrefab != (Object)null && ((Object)equippedItem.m_dropPrefab).name == "SixVikingsPlaneur") { return true; } } return false; } public static bool AElan(Character personnage) { return personnage.GetSEMan().HaveStatusEffect(Plugin.HashElan); } public static float CapVoulu(Player joueur) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_004f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform.forward : ((Component)joueur).transform.forward); val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = ((Component)joueur).transform.forward; } return Mathf.Repeat(Mathf.Atan2(val.x, val.z) * 57.29578f, 360f); } public static Commande CommandeDuJoueur() { if (!Plugin.ClavierLibre()) { return Commande.Aucune; } float joyLeftStickY = ZInput.GetJoyLeftStickY(); if (ZInput.GetButton("Forward") || joyLeftStickY < -0.5f) { return Commande.Piquer; } if (ZInput.GetButton("Backward") || joyLeftStickY > 0.5f) { return Commande.Freiner; } return Commande.Aucune; } } [BepInPlugin("sixvikings.envol", "SixVikings Envol", "1.0.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string ModeleDePiece = "piece_banner01"; private const string ModeleDAccessoire = "BeltStrength"; private static readonly Color[] Toiles = (Color[])(object)new Color[3] { new Color(0.25f, 0.62f, 0.22f), new Color(0.18f, 0.42f, 0.85f), new Color(0.85f, 0.2f, 0.12f) }; private static readonly Color[] Motifs = (Color[])(object)new Color[3] { new Color(0.85f, 0.8f, 0.6f), new Color(0.8f, 0.82f, 0.9f), new Color(0.95f, 0.7f, 0.15f) }; private static readonly Color[] Cadres = (Color[])(object)new Color[3] { new Color(0.8f, 0.68f, 0.5f), new Color(0.5f, 0.52f, 0.56f), new Color(0.22f, 0.2f, 0.22f) }; private static readonly float[] Rayons = new float[3] { 1.2f, 1.5f, 1.8f }; internal const float BasDesPieds = -0.35f; private static Material bois; private static readonly Material[][] toilesDeVoile = new Material[3][]; private static readonly Mesh[][] formesDeVoile = new Mesh[3][]; public const string ModGuid = "sixvikings.envol"; public const string ModNom = "SixVikings Envol"; public const string ModVersion = "1.0.2"; public const string NomDuPlaneur = "SixVikingsPlaneur"; public const string NomDuTremplin = "SixVikingsTremplin"; private const string NomElan = "SixVikingsElan"; private const string NomPlaner = "SixVikingsPlaner"; private const string NomAscension = "SixVikingsAscension"; private const string NomAtterrissage = "SixVikingsAtterrissage"; public static readonly int HashElan = StringExtensionMethods.GetStableHashCode("SixVikingsElan"); public static readonly int HashPlaner = StringExtensionMethods.GetStableHashCode("SixVikingsPlaner"); public static readonly int HashAscension = StringExtensionMethods.GetStableHashCode("SixVikingsAscension"); public static readonly int HashAtterrissage = StringExtensionMethods.GetStableHashCode("SixVikingsAtterrissage"); public const string CleVoile = "sixvikings_envol_voile"; private static readonly int HashVoile = StringExtensionMethods.GetStableHashCode("sixvikings_envol_voile"); public const string CleDecollage = "sixvikings_envol_decollage"; private static readonly int HashDecollage = StringExtensionMethods.GetStableHashCode("sixvikings_envol_decollage"); internal static Plugin Instance; private ConfigEntry<float> avant; private ConfigEntry<float> chute; private ConfigEntry<float> endurance; private ConfigEntry<float> dureeElan; private ConfigEntry<float> facteurElan; private ConfigEntry<float> avantSimple; private ConfigEntry<float> chuteSimple; private ConfigEntry<float> plafond; private ConfigEntry<float> facteurDeDepart; private ConfigEntry<bool> vitesseQuiSeGagne; private ConfigEntry<float> vitesseMaxPlaneur; private ConfigEntry<float> vitesseMaxElan; private ConfigEntry<float> vitesseMaxSimple; private ConfigEntry<float> chutePique; private ConfigEntry<string> recettePlaneur; private ConfigEntry<bool> sonsActifs; private ConfigEntry<bool> musiqueDeVol; private ConfigEntry<float> volumeRebond; private ConfigEntry<float> volumeVent; private ConfigEntry<float> volumeToile; private readonly ConfigEntry<float>[] hauteurs = new ConfigEntry<float>[3]; private readonly ConfigEntry<float>[] vitesses = new ConfigEntry<float>[3]; private readonly ConfigEntry<string>[] recettes = new ConfigEntry<string>[3]; private SE_Stats elan; private float prochainsReglages; private float prochainesVoiles; private bool montait; private float ouvertA; private bool planaitAvant; private bool elanAvant; private bool fermeeIci; private Tremplin dernierTremplin; private float dernierTremplinA; private SE_Ascension monteeEnCours; private int rangEnCours; private Affichage.DejaDit dejaDit; private int decollages; private readonly Dictionary<Player, int> decollagesVus = new Dictionary<Player, int>(); private readonly HashSet<string> sonsIntrouvables = new HashSet<string>(); private readonly Dictionary<Player, int> voilesEntendues = new Dictionary<Player, int>(); internal static Rebond.Assemblage Assemblage = Rebond.Assemblage.Physique; private AudioSource vent; private float ventVolume; private bool enVolPourLesSons; private float volDepuis; private readonly List<AudioClip> froissements = new List<AudioClip>(); private int dernierFroissement = -1; private float prochainFroissement; private AudioSource toile; private int froissementsJoues; private string musiqueANous; private bool musiqueRefusee; private bool sonsDuVolCoupes; private Player joueurVu; private float apparuA; private bool surveille; private bool ventIntrouvable; private static readonly FieldInfo ChampMusiqueDeLieu = typeof(MusicMan).GetField("m_locationMusic", BindingFlags.Instance | BindingFlags.NonPublic); private static readonly MethodInfo MethodeMusiqueJouee = typeof(MusicMan).GetMethod("GetCurrentMusic", BindingFlags.Instance | BindingFlags.NonPublic, null, Type.EmptyTypes, null); private static Material Etoffe(string nom, Color couleur) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return Formes.Matiere(bois, nom, Color.white, Formes.Toile(couleur)); } private void Enregistrer() { //IL_00aa: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) PrefabManager.OnVanillaPrefabsAvailable -= Enregistrer; try { GameObject prefab = PrefabManager.Instance.GetPrefab("piece_banner01"); Transform val = (((Object)(object)prefab != (Object)null) ? prefab.transform.Find("woodbeam") : null); MeshRenderer val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent<MeshRenderer>() : null); if ((Object)(object)val2 == (Object)null || (Object)(object)((Renderer)val2).sharedMaterial == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Le modèle « piece_banner01 » du jeu n'a plus la forme attendue : SixVikings Envol n'ajoute rien. Il faut une nouvelle version du mod."); return; } bois = ((Renderer)val2).sharedMaterial; toilesDeVoile[1] = (Material[])(object)new Material[2] { Etoffe("sixvikings_voile_simple_a", new Color(0.5f, 0.46f, 0.38f)), Etoffe("sixvikings_voile_simple_b", new Color(0.33f, 0.31f, 0.27f)) }; toilesDeVoile[2] = (Material[])(object)new Material[2] { Etoffe("sixvikings_voile_planeur_a", new Color(0.62f, 0.56f, 0.4f)), Etoffe("sixvikings_voile_planeur_b", new Color(0.5f, 0.1f, 0.08f)) }; Sprite icone = Formes.IconeDeVoile(new Color(0.9f, 0.86f, 0.72f), new Color(0.7f, 0.16f, 0.12f)); EnregistrerLesEffets(icone); EnregistrerLePlaneur(icone); for (int i = 0; i < 3; i++) { EnregistrerUnTremplin(i); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Planeur, trois tremplins et quatre effets enregistrés."); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("L'enregistrement de SixVikings Envol a échoué : " + ex)); } } private void EnregistrerLesEffets(Sprite icone) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown elan = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)elan).name = "SixVikingsElan"; ((StatusEffect)elan).m_name = "$sixvikings_elan"; ((StatusEffect)elan).m_tooltip = "$sixvikings_elan_aide"; ((StatusEffect)elan).m_icon = icone; ((StatusEffect)elan).m_ttl = Envol.Reglages.DureeBonus; elan.m_fallDamageModifier = -1f; ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)elan, false)); SE_Planer sE_Planer = ScriptableObject.CreateInstance<SE_Planer>(); ((Object)sE_Planer).name = "SixVikingsPlaner"; ((StatusEffect)sE_Planer).m_name = "$sixvikings_planer"; ((StatusEffect)sE_Planer).m_tooltip = "$sixvikings_planer_aide"; ((StatusEffect)sE_Planer).m_icon = icone; ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)sE_Planer, false)); SE_Ascension sE_Ascension = ScriptableObject.CreateInstance<SE_Ascension>(); ((Object)sE_Ascension).name = "SixVikingsAscension"; ((StatusEffect)sE_Ascension).m_name = "$sixvikings_ascension"; ((StatusEffect)sE_Ascension).m_tooltip = "$sixvikings_ascension_aide"; ((StatusEffect)sE_Ascension).m_icon = icone; ((StatusEffect)sE_Ascension).m_ttl = 125f; ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)sE_Ascension, false)); SE_Atterrissage sE_Atterrissage = ScriptableObject.CreateInstance<SE_Atterrissage>(); ((Object)sE_Atterrissage).name = "SixVikingsAtterrissage"; ((StatusEffect)sE_Atterrissage).m_name = "$sixvikings_atterrissage"; ((StatusEffect)sE_Atterrissage).m_tooltip = "$sixvikings_atterrissage_aide"; ((StatusEffect)sE_Atterrissage).m_icon = icone; ((StatusEffect)sE_Atterrissage).m_ttl = 60f; ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)sE_Atterrissage, false)); } private void EnregistrerLePlaneur(Sprite icone) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) ItemConfig val = new ItemConfig(); val.Name = "$sixvikings_planeur"; val.Description = "$sixvikings_planeur_description"; val.CraftingStation = CraftingStations.Workbench; val.Requirements = Besoins(recettePlaneur.Value, "Feathers:40,LinenThread:20,FineWood:20,LeatherScraps:20", "du planeur"); val.Icons = (Sprite[])(object)new Sprite[1] { icone }; val.Weight = 4f; CustomItem val2 = new CustomItem("SixVikingsPlaneur", "BeltStrength", val); if ((Object)(object)val2.ItemDrop == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Le modèle « BeltStrength » du jeu est introuvable : le planeur n'est pas ajouté."); return; } SharedData shared = val2.ItemDrop.m_itemData.m_shared; shared.m_equipStatusEffect = null; shared.m_itemType = (ItemType)18; shared.m_maxStackSize = 1; shared.m_maxQuality = 1; ItemManager.Instance.AddItem(val2); } private RequirementConfig[] Besoins(string recette, string parDefaut, string deQuoi) { //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown List<Ingredient> ingredients; List<string> list = Recette.Lire(recette, out ingredients); foreach (Ingredient item in ingredients) { if ((Object)(object)PrefabManager.Instance.GetPrefab(item.Nom) == (Object)null) { list.Add("« " + item.Nom + " » n'est pas un matériau du jeu"); } } if (list.Count > 0) { ((BaseUnityPlugin)this).Logger.LogError((object)("Recette " + deQuoi + " refusée (« " + recette + " ») : " + string.Join(" ; ", list) + ". La recette d'origine est utilisée.")); Recette.Lire(parDefaut, out ingredients); } RequirementConfig[] array = (RequirementConfig[])(object)new RequirementConfig[ingredients.Count]; for (int i = 0; i < array.Length; i++) { array[i] = new RequirementConfig(ingredients[i].Nom, ingredients[i].Quantite, 0, true); } return array; } private void EnregistrerUnTremplin(int rang) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: 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_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Expected O, but got Unknown //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Expected O, but got Unknown Niveau niveau = Tremplins.Niveaux[rang]; string text = "SixVikingsTremplin" + niveau.Nom; GameObject val = PrefabManager.Instance.CreateClonedPrefab(text, "piece_banner01"); int layer = val.layer; Piece component = val.GetComponent<Piece>(); component.m_notOnFloor = false; component.m_inCeilingOnly = false; component.m_notOnWood = false; component.m_groundOnly = false; component.m_groundPiece = false; component.m_waterPiece = false; component.m_onlyInTeleportArea = false; component.m_clipGround = false; component.m_clipEverything = false; component.m_noClipping = false; component.m_notOnTiltingSurface = true; component.m_comfort = 0; component.m_comfortGroup = (ComfortGroup)0; for (int num = val.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)val.transform.GetChild(num)).gameObject); } LODGroup component2 = val.GetComponent<LODGroup>(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } float num2 = Rayons[rang]; Material matiere = Formes.Matiere(bois, "sixvikings_cadre_" + niveau.Nom, Cadres[rang]); Material matiere2 = Etoffe("sixvikings_toile_" + niveau.Nom, Toiles[rang]); Material matiere3 = Etoffe("sixvikings_motif_" + niveau.Nom, Motifs[rang]); GameObject val2 = Formes.Poser(val.transform, "cadre", Formes.Anneau("sixvikings_anneau", num2 * 0.86f, num2, 0.16f, 24), matiere, layer); val2.transform.localPosition = new Vector3(0f, 0.55f, 0f); val2.AddComponent<MeshCollider>().sharedMesh = val2.GetComponent<MeshFilter>().sharedMesh; int num3 = 6 + rang * 2; Vector3 val3 = default(Vector3); Vector3 depart = default(Vector3); for (int i = 0; i < num3; i++) { float num4 = (float)i * (float)Math.PI * 2f / (float)num3; ((Vector3)(ref val3))..ctor(Mathf.Cos(num4) * num2 * 0.93f, 0.57f, Mathf.Sin(num4) * num2 * 0.93f); ((Vector3)(ref depart))..ctor(val3.x * 1.08f, -0.35f, val3.z * 1.08f); Formes.Poser(val.transform, "pied" + i, Formes.Barre("sixvikings_pied", depart, val3, 0.12f), matiere, layer); } GameObject val4 = Formes.Poser(val.transform, "toile", Formes.Anneau("sixvikings_toile", 0f, num2 * 0.88f, 0.08f, 24), matiere2, layer); val4.transform.localPosition = new Vector3(0f, 0.58f, 0f); MeshCollider obj = val4.AddComponent<MeshCollider>(); obj.sharedMesh = val4.GetComponent<MeshFilter>().sharedMesh; obj.convex = true; float num5 = 0.65999997f; Formes.Poser(val.transform, "lisere", Formes.Anneau("sixvikings_lisere", num2 * 0.66f, num2 * 0.74f, 0.006f, 24), matiere3, layer).transform.localPosition = new Vector3(0f, num5, 0f); Formes.Poser(val.transform, "etoile", Formes.Etoile("sixvikings_etoile", num2 * 0.46f, num2 * 0.19f, 4 + rang * 2), matiere3, layer).transform.localPosition = new Vector3(0f, num5 + 0.006f, 0f); if (rang == 2) { GameObject val5 = new GameObject("lueur"); val5.transform.SetParent(val.transform, false); val5.transform.localPosition = new Vector3(0f, 1.1500001f, 0f); Light obj2 = val5.AddComponent<Light>(); obj2.type = (LightType)2; obj2.color = new Color(1f, 0.55f, 0.25f); obj2.range = 9f; obj2.intensity = 1.6f; } BoxCollider obj3 = val.AddComponent<BoxCollider>(); obj3.center = new Vector3(0f, -0.325f, 0f); obj3.size = new Vector3(num2 * 1.4f, 0.05f, num2 * 1.4f); val.AddComponent<Tremplin>().Rang = rang; WearNTear component3 = val.GetComponent<WearNTear>(); if ((Object)(object)component3 != (Object)null) { component3.m_health = 200f + (float)rang * 600f; component3.m_noRoofWear = false; component3.m_noSupportWear = false; component3.m_supports = false; } string text2 = "$sixvikings_tremplin_" + niveau.Nom.ToLowerInvariant(); PieceManager.Instance.AddPiece(new CustomPiece(val, false, new PieceConfig { Name = text2, Description = text2 + "_description", PieceTable = PieceTables.Hammer, Category = PieceCategories.Misc, CraftingStation = niveau.Etabli, Icon = Formes.IconeDeTremplin(Toiles[rang], Cadres[rang]), Requirements = Besoins(recettes[rang].Value, niveau.Recette, "du tremplin " + (rang + 1)) })); } internal static GameObject FabriquerUneVoile(int sorte) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01a8: 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) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bois == (Object)null || sorte < 1 || sorte > 2) { return null; } bool num = sorte == 2; float num2 = (num ? 5.4f : 3.2f); float num3 = (num ? 3.4f : 2.2f); float num4 = (num ? 0.45f : 0.25f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0f, num3 * 0.55f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0f, 0f, (0f - num3) * 0.25f); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor((0f - num2) * 0.5f, num4, (0f - num3) * 0.45f); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(num2 * 0.5f, num4, (0f - num3) * 0.45f); Vector3 val5 = (val2 + val3) * 0.5f; Vector3 val6 = (val2 + val4) * 0.5f; if (formesDeVoile[sorte] == null) { Vector3 val7 = default(Vector3); ((Vector3)(ref val7))..ctor(-0.45f, -0.95f, 0.1f); Vector3 arrivee = default(Vector3); ((Vector3)(ref arrivee))..ctor(0.45f, -0.95f, 0.1f); Vector3 depart = default(Vector3); ((Vector3)(ref depart))..ctor(0f, 0f, 0.1f); formesDeVoile[sorte] = (Mesh[])(object)new Mesh[8] { Formes.Pans("sixvikings_pans_a", val, val6, val2, val, val2, val5), Formes.Pans("sixvikings_pans_b", val, val4, val6, val, val5, val3), Formes.Barre("sixvikings_barre", val, val2, 0.06f), Formes.Barre("sixvikings_barre", val, val3, 0.06f), Formes.Barre("sixvikings_barre", val, val4, 0.06f), Formes.Barre("sixvikings_barre", depart, val7, 0.04f), Formes.Barre("sixvikings_barre", depart, arrivee, 0.04f), Formes.Barre("sixvikings_barre", val7, arrivee, 0.04f) }; } Mesh[] array = formesDeVoile[sorte]; GameObject val8 = new GameObject("sixvikings_voile"); Formes.Poser(val8.transform, "pans du milieu", array[0], toilesDeVoile[sorte][0], 0); Formes.Poser(val8.transform, "pans du bord", array[1], toilesDeVoile[sorte][1], 0); Formes.Poser(val8.transform, "quille", array[2], bois, 0); Formes.Poser(val8.transform, "bord gauche", array[3], bois, 0); Formes.Poser(val8.transform, "bord droit", array[4], bois, 0); Formes.Poser(val8.transform, "trapeze gauche", array[5], bois, 0); Formes.Poser(val8.transform, "trapeze droit", array[6], bois, 0); Formes.Poser(val8.transform, "trapeze bas", array[7], bois, 0); return val8; } private void Awake() { Instance = this; Regler(); Traduire(); PrefabManager.OnVanillaPrefabsAvailable += Enregistrer; if (!GUIManager.IsHeadless()) { ((MonoBehaviour)this).StartCoroutine(ChargerLesFroissements()); } } private void Regler() { ReglagesVol reglagesVol = ReglagesVol.ParDefaut(); avant = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Planeur", "VitesseAvant", reglagesVol.Avant, Langue.Reglage("Glider forward speed, in metres per second.", "Vitesse d'avance du planeur, en mètres par seconde."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); chute = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Planeur", "VitesseDeChute", reglagesVol.Chute, Langue.Reglage("Glider sink speed, in metres per second. The smaller it is, the farther it goes.", "Vitesse de descente du planeur, en mètres par seconde. Plus c'est petit, plus il va loin."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); endurance = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Planeur", "EnduranceParSeconde", reglagesVol.EnduranceParSeconde, Langue.Reglage("Stamina spent per second of flight, outside springboard momentum. Out of stamina, the glider stalls: it stays open but sinks fast.", "Endurance dépensée par seconde de vol, hors élan du tremplin. À bout d'endurance le planeur décroche : il reste ouvert mais descend vite."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); vitesseQuiSeGagne = ConfigFileExtensions.BindConfig<bool>(((BaseUnityPlugin)this).Config, "Planeur", "VitesseQuiSeGagne", reglagesVol.VitesseQuiSeGagne, Langue.Reglage("True: when diving (forward), lost height turns into speed, which is kept and eases back to cruising speed; pulling up (backward) turns it back into height. False: the earlier flight, at fixed speeds.", "Vrai : en piqué (avancer), la hauteur perdue devient de la vitesse, qui se garde et revient doucement à la croisière ; redresser (reculer) la rend en hauteur. Faux : le vol d'avant, aux vitesses fixes."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); vitesseMaxPlaneur = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Planeur", "VitesseMaxEnPique", reglagesVol.VitesseMaxPlaneur, Langue.Reglage("Highest forward speed reachable in a dive, without springboard momentum, in metres per second.", "Vitesse d'avance la plus haute qu'on puisse prendre en piqué, sans l'élan du tremplin, en mètres par seconde."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); chutePique = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Planeur", "VitesseDeChuteEnPique", reglagesVol.ChutePique, Langue.Reglage("Sink speed in a dive, in metres per second (when speed is earned).", "Vitesse de descente en piqué, en mètres par seconde (quand la vitesse se gagne)."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); recettePlaneur = ConfigFileExtensions.BindConfig<string>(((BaseUnityPlugin)this).Config, "Planeur", "Recette", "Feathers:40,LinenThread:20,FineWood:20,LeatherScraps:20", Langue.Reglage("Glider materials, at the workbench: Name:amount separated by commas, four at most. Read when the game starts, from EACH player's own file (the server does not enforce it): keep it the same for everyone.", "Matériaux du planeur, à l'établi : Nom:quantité séparés par des virgules, quatre au plus. Lu au lancement du jeu, dans le fichier de CHAQUE joueur (le serveur ne l'impose pas) : garder la même chez tous."), false, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); dureeElan = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Elan du tremplin", "DureeEnSecondes", reglagesVol.DureeBonus, Langue.Reglage("Duration of the momentum a springboard gives: flight without stamina, no fall damage, faster glider, makeshift sail without a glider.", "Durée de l'élan donné par un tremplin : vol sans endurance, pas de dégâts de chute, planeur plus rapide, vol simple sans planeur."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); facteurElan = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Elan du tremplin", "FacteurDeVitesse", reglagesVol.FacteurBonus, Langue.Reglage("During momentum, the glider's forward speed is multiplied by this number.", "Pendant l'élan, la vitesse d'avance du planeur est multipliée par ce nombre."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); avantSimple = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Elan du tremplin", "VitesseAvantSansPlaneur", reglagesVol.AvantSimple, Langue.Reglage("Forward speed of the makeshift sail, for players without a glider.", "Vitesse d'avance du vol simple, pour qui n'a pas de planeur."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); chuteSimple = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Elan du tremplin", "VitesseDeChuteSansPlaneur", reglagesVol.ChuteSimple, Langue.Reglage("Sink speed of the makeshift sail.", "Vitesse de descente du vol simple."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); vitesseMaxElan = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Elan du tremplin", "VitesseMaxEnPique", reglagesVol.VitesseMaxElan, Langue.Reglage("Highest forward speed reachable in a dive with momentum and a glider, in metres per second. Above 60, nothing holds back a player arriving in an area not loaded yet.", "Vitesse d'avance la plus haute qu'on puisse prendre en piqué avec l'élan et un planeur, en mètres par seconde. Au-delà de 60, rien ne retient un joueur qui arrive dans une zone pas encore chargée."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); vitesseMaxSimple = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Elan du tremplin", "VitesseMaxEnPiqueSansPlaneur", reglagesVol.VitesseMaxSimple, Langue.Reglage("Highest forward speed reachable in a dive with the makeshift sail (momentum without a glider), in metres per second.", "Vitesse d'avance la plus haute qu'on puisse prendre en piqué en vol simple (élan sans planeur), en mètres par seconde."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); plafond = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Monde", "AltitudeMaximale", reglagesVol.Plafond, Langue.Reglage("Altitude not to exceed. Above 3000, the game treats the player as if inside a dungeon: stay well below.", "Altitude à ne pas dépasser. Au-dessus de 3000 le jeu traite le joueur comme s'il était dans un donjon : ne pas s'en approcher."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); facteurDeDepart = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Monde", "FacteurDeDepart", reglagesVol.FacteurDeDepart, Langue.Reglage("A springboard climb starts at this many times its speed (150 m/s at most), then eases back to it over the first 40 % of the climb. 1: the earlier climb, at constant speed.", "La montée d'un tremplin part à cette fois sa vitesse (150 m/s au plus), puis ralentit sans à-coup jusqu'à elle sur les premiers 40 % de la montée. 1 : la montée d'avant, à vitesse constante."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); sonsActifs = ConfigFileExtensions.BindConfig<bool>(((BaseUnityPlugin)this).Config, "Sons", "Actifs", true, Langue.Reglage("The flight sounds: the springboard bounce, the wind that follows speed, the glider cloth, yours and other players', and the flight music. False: none of them (the game's own landing sound under the sail stays).", "Les sons du vol : le rebond du tremplin, le vent qui suit la vitesse, la toile du planeur, les siens et ceux des autres joueurs, et la musique du vol. Faux : aucun d'eux (le bruit d'atterrissage du jeu sous la voile reste)."), false, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); volumeRebond = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Sons", "VolumeDuRebond", 1f, Langue.Reglage("Volume of the springboard bounce, from 0 to 1.", "Volume du rebond des tremplins, de 0 à 1."), false, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); volumeVent = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Sons", "VolumeDuVent", 1f, Langue.Reglage("Volume of the flight wind, heard by yourself only, from 0 to 1.", "Volume du vent du vol, que soi seul entend, de 0 à 1."), false, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); volumeToile = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, "Sons", "VolumeDeLaToile", 1f, Langue.Reglage("Volume of the glider cloth (opening, closing, rustling in flight), from 0 to 1.", "Volume de la toile du planeur (ouverture, fermeture, froissements en vol), de 0 à 1."), false, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); musiqueDeVol = ConfigFileExtensions.BindConfig<bool>(((BaseUnityPlugin)this).Config, "Sons", "MusiqueDeVol", true, Langue.Reglage("After twenty seconds of flight, the game's sailing music, as on a boat; it steps aside for a place's or an event's music, and is handed back to the game on landing, which stops it. False, or Actifs false: the game's music does not change.", "Après vingt secondes de vol, la musique de navigation du jeu, comme en bateau ; elle laisse passer celle d'un lieu ou d'un événement, et est rendue au jeu à l'atterrissage, qui l'arrête. Faux, ou Actifs à faux : la musique du jeu ne change pas."), false, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); for (int i = 0; i < 3; i++) { Niveau niveau = Tremplins.Niveaux[i]; string text = "Tremplin " + (i + 1); hauteurs[i] = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, text, "Hauteur", niveau.Hauteur, Langue.Reglage("Height gained by a jump, in metres.", "Hauteur gagnée par un saut, en mètres."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); vitesses[i] = ConfigFileExtensions.BindConfig<float>(((BaseUnityPlugin)this).Config, text, "VitesseDeMontee", niveau.Vitesse, Langue.Reglage("Climb speed, in metres per second.", "Vitesse de la montée, en mètres par seconde."), true, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); recettes[i] = ConfigFileExtensions.BindConfig<string>(((BaseUnityPlugin)this).Config, text, "Recette", niveau.Recette, Langue.Reglage("Materials of this springboard: Name:amount separated by commas, four at most. Read when the game starts, from EACH player's own file (the server does not enforce it): keep it the same for everyone.", "Matériaux de ce tremplin : Nom:quantité séparés par des virgules, quatre au plus. Lu au lancement du jeu, dans le fichier de CHAQUE joueur (le serveur ne l'impose pas) : garder la même chez tous."), false, (int?)null, (AcceptableValueBase)null, (Action<ConfigEntryBase>)null, (ConfigurationManagerAttributes)null); } AppliquerLesReglages(); } private void AppliquerLesReglages() { ReglagesVol reglages = Envol.Reglages; ReglagesVol reglagesVol = ReglagesVol.ParDefaut(); reglages.Avant = Borne(avant.Value, 1f, 60f, reglagesVol.Avant); reglages.Chute = Borne(chute.Value, 0.5f, 20f, reglagesVol.Chute); reglages.EnduranceParSeconde = Borne(endurance.Value, 0f, 50f, reglagesVol.EnduranceParSeconde); reglages.DureeBonus = Borne(dureeElan.Value, 10f, 3600f, reglagesVol.DureeBonus); reglages.FacteurBonus = Borne(facteurElan.Value, 1f, 4f, reglagesVol.FacteurBonus); reglages.AvantSimple = Borne(avantSimple.Value, 1f, 60f, reglagesVol.AvantSimple); reglages.ChuteSimple = Borne(chuteSimple.Value, 0.5f, 20f, reglagesVol.ChuteSimple); reglages.Plafond = Borne(plafond.Value, 200f, 2800f, reglagesVol.Plafond); reglages.FacteurDeDepart = Borne(facteurDeDepart.Value, 1f, 4f, reglagesVol.FacteurDeDepart); reglages.VitesseQuiSeGagne = vitesseQuiSeGagne.Value; reglages.VitesseMaxPlaneur = Borne(vitesseMaxPlaneur.Value, 1f, 60f, reglagesVol.VitesseMaxPlaneur); reglages.VitesseMaxElan = Borne(vitesseMaxElan.Value, 1f, 60f, reglagesVol.VitesseMaxElan); reglages.VitesseMaxSimple = Borne(vitesseMaxSimple.Value, 1f, 60f, reglagesVol.VitesseMaxSimple); reglages.ChutePique = Borne(chutePique.Value, 0.5f, 40f, reglagesVol.ChutePique); if ((Object)(object)elan != (Object)null) { ((StatusEffect)elan).m_ttl = reglages.DureeBonus; } } internal static void EcrireUneErreur(string texte) { if ((Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogError((object)texte); } } private static float Borne(float valeur, float min, float max, float origine) { if (!float.IsNaN(valeur) && !float.IsInfinity(valeur)) { return Mathf.Clamp(valeur, min, max); } return origine; } private float Hauteur(int rang) { return Borne(hauteurs[rang].Value, 10f, 2800f, Tremplins.Niveaux[rang].Hauteur); } private float Vitesse(int rang) { return Borne(vitesses[rang].Value, 5f, 150f, Tremplins.Niveaux[rang].Vitesse); } private void Update() { if (Time.time >= prochainsReglages) { prochainsReglages = Time.time + 1f; AppliquerLesReglages(); } if (Time.time >= prochainesVoiles && !GUIManager.IsHeadless()) { prochainesVoiles = Time.time + 0.25f; try { MontrerLesVoiles(); } catch (Exception e) { Envol.Erreur("l'affichage des voiles", e); } try { EntendreLesDecollages(); } catch (Exception e2) { Envol.Erreur("les sons des autres joueurs", e2); } } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { montait = false; joueurVu = null; planaitAvant = false; elanAvant = false; dejaDit = default(Affichage.DejaDit); if (!GUIManager.IsHeadless()) { try { CouperLesSonsDuVol(); return; } catch (Exception e3) { Envol.Erreur("l'arrêt des sons du vol", e3); return; } } return; } try { ProtegerUneReapparition(localPlayer); Piloter(localPlayer); } catch (Exception e4) { Envol.Erreur("le pilotage du vol (le vol est refermé)", e4); SEMan sEMan = ((Character)localPlayer).GetSEMan(); bool flag = sEMan.HaveStatusEffect(HashPlaner) || sEMan.HaveStatusEffect(HashAscension); sEMan.RemoveStatusEffect(HashPlaner, true); sEMan.RemoveStatusEffect(HashAscension, true); try { if (Vol.ErreurAProteger(flag, SituationDe(localPlayer))) { ProtegerLaChute(localPlayer, "erreur pendant le vol"); } } catch (Exception e5) { Envol.Erreur("la protection après une erreur du pilotage", e5); if (flag) { sEMan.AddStatusEffect(HashAtterrissage, true, 0, 0f, (short)(-1)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Protection d'atterrissage : erreur pendant le vol (posée sans mesurer le vide dessous)."); } } } if (GUIManager.IsHeadless() || sonsDuVolCoupes) { return; } try { SonsDuVol(localPlayer); } catch (Exception e6) { sonsDuVolCoupes = true; Envol.Erreur("les sons du vol (coupés jusqu'à la fermeture du jeu)", e6); try { CouperLesSonsDuVol(); } catch { } } } private void ProtegerUneReapparition(Player joueur) { if ((Object)(object)joueur != (Object)(object)joueurVu) { joueurVu = joueur; apparuA = Time.time; surveille = true; } if (surveille) { switch (Vol.ApresApparition(SituationDe(joueur), Time.time - apparuA)) { case Vol.Apparition.Proteger: surveille = false; ProtegerLaChute(joueur, "apparu en l'air"); break; case Vol.Apparition.Fini: surveille = false; break; } } } private void ProtegerLaChute(Player joueur, string pourquoi) { SEMan sEMan = ((Character)joueur).GetSEMan(); sEMan.AddStatusEffect(HashAtterrissage, true, 0, 0f, (short)(-1)); StatusEffect statusEffect = sEMan.GetStatusEffect(HashAtterrissage); if ((Object)(object)statusEffect != (Object)null) { statusEffect.m_hidden = false; } ((BaseUnityPlugin)this).Logger.LogInfo((object)("Protection d'atterrissage : " + pourquoi + ", " + Envol.HauteurSousLesPieds((Character)(object)joueur).ToString("F0", CultureInfo.InvariantCulture) + " m de vide dessous.")); } private void Piloter(Player joueur) { SEMan sEMan = ((Character)joueur).GetSEMan(); bool flag = sEMan.HaveStatusEffect(HashAscension); bool flag2 = sEMan.HaveStatusEffect(HashPlaner); bool flag3 = SautPresse(); Situation s = SituationDe(joueur); bool elanJusquIci = elanAvant; if (planaitAvant && !flag2 && !fermeeIci && Vol.ChuteAProteger(s)) { ProtegerLaChute(joueur, "voile refermée d'elle-même en l'air"); } planaitAvant = flag2; elanAvant = s.Bonus; fermeeIci = false; if (Vol.FinDElanAProteger(s, elanJusquIci, flag2 && s.Planeur)) { ProtegerLaChute(joueur, "élan fini en l'air"); } Prevenir(joueur, sEMan, s, elanJusquIci, flag2); if (s.AuSol) { Tremplin tremplin = TremplinSous(joueur); if ((Object)(object)tremplin != (Object)null) { dernierTremplin = tremplin; dernierTremplinA = Time.time; } } if (!flag && flag3 && (Object)(object)dernierTremplin != (Object)null && Time.time - dernierTremplinA < 0.3f) { Tremplin tremplin2 = dernierTremplin; dernierTremplin = null; montait = Decoller(joueur, tremplin2); return; } if (montait && !flag) { montait = false; if ((Object)(object)monteeEnCours != (Object)null) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Fin de la montée : " + (monteeEnCours.Fin ?? "effet retiré") + ((monteeEnCours.Obstacle != null) ? (" (" + monteeEnCours.Obstacle + ")") : "") + ", " + monteeEnCours.Gagne.ToString("F0", CultureInfo.InvariantCulture) + " m gagnés.")); if (monteeEnCours.Fin == "toit au-dessus de la tête") { ((Character)joueur).Message((MessageType)2, "$sixvikings_envol_obstacle", 0, (Sprite)null, false); } if (Affichage.MeriteLeTitre(monteeEnCours.Fin, monteeEnCours.Gagne)) { PremierSommet(joueur, rangEnCours); } monteeEnCours = null; } if (!flag2 && Vol.RefusDOuvrir(Envol.Reglages, s) == null) { Ouvrir(joueur); return; } if (!flag2 && Vol.ChuteAProteger(s)) { ProtegerLaChute(joueur, "montée finie sans voile possible"); } } montait = flag; if (flag2) { bool flag4 = Time.time - ouvertA < 0.3f; bool flag5 = Vol.DoitFermer(s); if (flag5 || (flag3 && !flag4)) { if (flag5 && Vol.SePose(s)) { Atterrir(joueur, s.DansLEau); if (!s.DansLEau) { ProtegerLeContact(joueur); } } Fermer(joueur); } else { EcrireVoile(joueur, (!s.Planeur) ? 1 : 2); } } else if (!flag && flag3 && !s.AuSol) { string text = Vol.RefusDOuvrir(Envol.Reglages, s); if (text == null) { Ouvrir(joueur); } else if ((s.Planeur || s.Bonus) && s.HauteurAuDessusDuSol >= Envol.Reglages.HauteurMin) { ((Character)joueur).Message((MessageType)1, "$" + Vol.CleDuRefus(text), 0, (Sprite)null, false); } } } private void Prevenir(Player joueur, SEMan effets, Situation s, bool elanJusquIci, bool plane) { try { SE_Planer sE_Planer = (plane ? (effets.GetStatusEffect(HashPlaner) as SE_Planer) : null); StatusEffect val = (s.Bonus ? effets.GetStatusEffect(HashElan) : null); Affichage.ImageDuVol v = new Affichage.ImageDuVol { VoileOuverte = ((Object)(object)sE_Planer != (Object)null), Decroche = ((Object)(object)sE_Planer != (Object)null && sE_Planer.Decroche), Elan = ((Object)(object)val != (Object)null), ElanJusquIci = elanJusquIci, ElanRestant = (((Object)(object)val != (Object)null) ? val.GetRemaningTime() : 0f), ElanDuree = (((Object)(object)val != (Object)null) ? val.m_ttl : 0f), AuSol = s.AuSol, Mort = s.Mort }; Affichage.Annonces annonces = Affichage.QuoiDire(v, ref dejaDit); if ((Object)(object)sE_Planer != (Object)null) { ((StatusEffect)sE_Planer).m_flashIcon = annonces.VoileClignote; } if ((Object)(object)val != (Object)null) { val.m_flashIcon = annonces.ElanClignote; } if (annonces.Decrochage) { Dire(joueur, "$sixvikings_envol_decroche", "voile décrochée, endurance vide"); } if (annonces.FinDElanProche) { Dire(joueur, "$sixvikings_elan_bientot_fini", "élan bientôt fini, " + v.ElanRestant.ToString("F0", CultureInfo.InvariantCulture) + " s"); } if (annonces.ElanFini) { Dire(joueur, "$sixvikings_elan_fini", "élan fini"); } } catch (Exception e) { Envol.Erreur("les messages du vol", e); } } private void Dire(Player joueur, string cle, string pourJournal) { ((Character)joueur).Message((MessageType)1, cle, 0, (Sprite)null, false); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Message du vol : " + pourJournal + ".")); } private void PremierSommet(Player joueur, int rang) { try { string text = Affichage.CleDuPremierSommet(rang); bool flag = !joueur.HaveSeenTutorial(text); joueur.AddKnownLocationName(text); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Premier sommet du tremplin " + (rang + 1) + " : " + (flag ? "titre affiché" : "déjà vu par ce personnage") + ".")); } catch (Exception e) { Envol.Erreur("le titre du premier sommet", e); } } private Situation SituationDe(Player joueur) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)joueur).transform.position; return new Situation { AuSol = ((Character)joueur).IsOnGround(), DansLEau = ((Character)joueur).IsSwimming(), Attache = ((Character)joueur).IsAttached(), Mort = ((Character)joueur).IsDead(), EnTeleportation = ((Character)joueur).IsTeleporting(), Planeur = Envol.APlaneur(joueur), Bonus = Envol.AElan((Character)(object)joueur), HauteurAuDessusDuSol = Envol.HauteurSousLesPieds((Character)(object)joueur), Altitude = position.y, Endurance = joueur.GetStamina() }; } private static Tremplin TremplinSous(Player joueur) { Collider lastGroundCollider = ((Character)joueur).GetLastGroundCollider(); if (!((Object)(object)lastGroundCollider == (Object)null)) { return ((Component)lastGroundCollider).GetComponentInParent<Tremplin>(); } return null; } private bool Decoller(Player joueur, Tremplin tremplin) { //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(tremplin.Rang, 0, 2); SEMan sEMan = ((Character)joueur).GetSEMan(); if (((Character)joueur).IsSwimming() || ((Character)joueur).IsAttached() || ((Character)joueur).IsTeleporting()) { return false; } string quoi; float distanceDuToit = Envol.DistanceDuToit((Character)(object)joueur, 10f, out quoi); if (!Ascension.DepartLibre(distanceDuToit)) { ((Character)joueur).Message((MessageType)2, "$sixvikings_envol_toit", 0, (Sprite)null, false); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Décollage refusé : tremplin " + (num + 1) + ", " + quoi + " à " + distanceDuToit.ToString("F1", CultureInfo.InvariantCulture) + " m au-dessus de la tête.")); return false; } sEMan.RemoveStatusEffect(HashPlaner, true); EcrireVoile(joueur, 0); SE_Ascension sE_Ascension = sEMan.AddStatusEffect(HashAscension, true, 0, 0f, (short)(-1)) as SE_Ascension; if ((Object)(object)sE_Ascension == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"L'effet de montée n'a pas pu être donné : le tremplin ne fait rien."); return false; } sE_Ascension.Hauteur = Hauteur(num); sE_Ascension.VitesseMax = Vitesse(num); sE_Ascension.Plafond = Envol.Reglages.Plafond; sE_Ascension.Facteur = Envol.Reglages.FacteurDeDepart; monteeEnCours = sE_Ascension; rangEnCours = num; sEMan.AddStatusEffect(HashElan, true, 0, 0f, (short)(-1)); AnnoncerLeDecollage(joueur, num); ((Character)joueur).Message((MessageType)2, "$sixvikings_envol_decollage", 0, (Sprite)null, false); float num2 = Ascension.VitesseLancee(((Component)joueur).transform.position.y, ((Component)joueur).transform.position.y, sE_Ascension.Hauteur, sE_Ascension.VitesseMax, sE_Ascension.Facteur, sE_Ascension.Plafond); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Décollage : tremplin " + (num + 1) + ", " + sE_Ascension.Hauteur.ToString("F0", CultureInfo.InvariantCulture) + " m à " + sE_Ascension.VitesseMax.ToString("F0", CultureInfo.InvariantCulture) + " m/s (départ à " + num2.ToString("F0", CultureInfo.InvariantCulture) + " m/s).")); return true; } private void Ouvrir(Player joueur) { if (!((Object)(object)((Character)joueur).GetSEMan().AddStatusEffect(HashPlaner, true, 0, 0f, (short)(-1)) == (Object)null)) { ((Character)joueur).GetSEMan().RemoveStatusEffect(HashAtterrissage, true); ouvertA = Time.time; EcrireVoile(joueur, (!Envol.APlaneur(joueur)) ? 1 : 2); JouerLaToile(joueur, ouverte: true); } } private void Fermer(Player joueur) { bool num = ((Character)joueur).GetSEMan().HaveStatusEffect(HashPlaner); ((Character)joueur).GetSEMan().RemoveStatusEffect(HashPlaner, true); EcrireVoile(joueur, 0); fermeeIci = true; if (num) { JouerLaToile(joueur, ouverte: false); } } internal static bool ClavierLibre() { if (!Console.IsVisible() && !TextInput.IsVisible() && !InventoryGui.IsVisible() && !Menu.IsVisible() && !Minimap.IsOpen() && !StoreGui.IsVisible()) { if (!((Object)(object)Chat.instance == (Object)null)) { return !Chat.instance.HasFocus(); } return true; } return false; } private static bool SautPresse() { if (ClavierLibre()) { if (!ZInput.GetButtonDown("Jump")) { return ZInput.GetButtonDown("JoyJump"); } return true; } return false; } private static void EcrireVoile(Player joueur, int voile) { ZNetView component = ((Component)joueur).GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.IsValid() && component.IsOwner()) { component.GetZDO().Set(HashVoile, voile, false); } } private void MontrerLesVoiles() { foreach (Player allPlayer in Player.GetAllPlayers()) { if ((Object)(object)allPlayer == (Object)null) { continue; } ZNetView component = ((Component)allPlayer).GetComponent<ZNetView>(); int num = (((Object)(object)component != (Object)null && component.IsValid()) ? component.GetZDO().GetInt(HashVoile, 0) : 0); if ((Object)(object)allPlayer != (Object)(object)Player.m_localPlayer) { try { int value; bool dejaVu = voilesEntendues.TryGetValue(allPlayer, out value); voilesEntendues[allPlayer] = num; int num2 = Toile.Changement(dejaVu, value, num); if (num2 != 0) { JouerLaToile(allPlayer, num2 > 0); } } catch (Exception e) { Envol.Erreur("la toile des autres joueurs", e); } } if ((Object)(object)allPlayer == (Object)(object)Player.m_localPlayer && !((Character)allPlayer).GetSEMan().HaveStatusEffect(HashPlaner)) { if (num != 0) { EcrireVoile(allPlayer, 0); } num = 0; } Aile aile = ((Component)allPlayer).GetComponent<Aile>(); if ((Object)(object)aile == (Object)null) { if (num == 0) { continue; } aile = ((Component)allPlayer).gameObject.AddComponent<Aile>(); } aile.Montrer(num); } List<Player> list = null; foreach (Player key in voilesEntendues.Keys) { if ((Object)(object)key == (Object)null) { (list ?? (list = new List<Player>())).Add(key); } } if (list == null) { return; } foreach (Player item in list) { voilesEntendues.Remove(item); } } private void AnnoncerLeDecollage(Player joueur, int rang) { try { decollages++; int num = Sons.Ecrire(decollages, rang); ZNetView component = ((Component)joueur).GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.IsValid() && component.IsOwner()) { component.GetZDO().Set(HashDecollage, num, false); } decollagesVus[joueur] = num; JouerLeDecollage(joueur, rang, local: true); } catch (Exception e) { Envol.Erreur("les sons du décollage", e); } } private void Atterrir(Player joueur, bool dansLEau = false) { //IL_0010: 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_002c: Unknown result type (might be due to invalid IL or missing references) try { if (((Character)joueur).m_onLand != null) { Vector3 position = ((Component)joueur).transform.position; if (dansLEau) { position.y = ((Character)joueur).GetLiquidLevel(); } ((Character)joueur).m_onLand(position); ((BaseUnityPlugin)this).Logger.LogInfo((object)(dansLEau ? "Arrivée dans l'eau sous la voile : éclaboussure du jeu jouée." : "Atterrissage sous la voile : bruit d'atterrissage du jeu joué.")); } } catch (Exception e) { Envol.Erreur("le bruit de l'atterrissage", e); } } private void ProtegerLeContact(Player joueur) { try { SEMan sEMan = ((Character)joueur).GetSEMan(); bool flag = sEMan.HaveStatusEffect(HashAtterrissage); StatusEffect val = sEMan.AddStatusEffect(HashAtterrissage, true, 0, 0f, (short)(-1)); if ((Object)(object)val != (Object)null && !flag) { val.m_hidden = true; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Contact au sol, voile refermée : protection d'un instant posée."); } catch (Exception e) { Envol.Erreur("la protection d'un contact bref", e); } } internal static float HauteurDuTremplin(int rang) { int num = Mathf.Clamp(rang, 0, 2); if (!((Object)(object)Instance != (Object)null)) { return Tremplins.Niveaux[num].Hauteur; } return Instance.Hauteur(num); } private void EntendreLesDecollages(bool aussiLeJoueurLocal = false) { foreach (Player allPlayer in Player.GetAllPlayers()) { if ((Object)(object)allPlayer == (Object)null || ((Object)(object)allPlayer == (Object)(object)Player.m_localPlayer && !aussiLeJoueurLocal)) { continue; } ZNetView component = ((Component)allPlayer).GetComponent<ZNetView>(); if (!((Object)(object)component == (Object)null) && component.IsValid()) { int num = component.GetZDO().GetInt(HashDecollage, 0); int value; bool dejaVu = decollagesVus.TryGetValue(allPlayer, out value); decollagesVus[allPlayer] = num; if (Sons.NouveauDecollage(dejaVu, value, num)) { JouerLeDecollage(allPlayer, Sons.Rang(num), local: false); } } } List<Player> list = null; foreach (Player key in decollagesVus.Keys) { if ((Object)(object)key == (Object)null) { (list ?? (list = new List<Player>())).Add(key); } } if (list == null) { return; } foreach (Player item in list) { decollagesVus.Remove(item); } } private void JouerLeDecollage(Player joueur, int rang, bool local) { if (!sonsActifs.Value || GUIManager.IsHeadless()) { return; } float num = Sons.Reglage(volumeRebond.Value); List<string> list = new List<string>(); foreach (Sons.Son item in Rebond.Couches(rang, Assemblage)) { Sons.Son current = item; current.Volume *= num; if (!(current.Volume <= 0f) && Jouer(current, joueur, Rebond.SuitLeJoueur(local))) { list.Add(current.Nom + " " + current.Volume.ToString("F2", CultureInfo.InvariantCulture)); } } ((BaseUnityPlugin)this).Logger.LogInfo((object)((local ? "Sons du décollage" : "Décollage d'un autre joueur entendu") + " : tremplin " + (rang + 1) + ", rebond " + ((Assemblage == Rebond.Assemblage.Sobre) ? "sobre" : "physique") + ", " + ((list.Count == 0) ? "aucun son joué" : string.Join(", ", list)) + ".")); } private void JouerLaToile(Player joueur, bool ouverte) { try { if (sonsActifs.Value && !GUIManager.IsHeadless()) { float num = (ouverte ? 0.65f : 0.4f) * Sons.Reglage(volumeToile.Value); if (!(num <= 0f)) { Jouer(new Sons.Son { Nom = (ouverte ? "sfx_vulture_wing_flap" : "sfx_equip"), Volume = num, Hauteur = (ouverte ? 0.9f : 1f) }, joueur, monteAvecLui: true); } } } catch (Exception e) { Envol.Erreur("le son de la toile", e); } } private bool Jouer(Sons.Son son, Player joueur, bool monteAvecLui) { //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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) GameObject val = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab(son.Nom) : null); if ((Object)(object)val == (Object)null || (Object)(object)val.GetComponentInChildren<ZSFX>(true) == (Object)null) { if (sonsIntrouvables.Add(son.Nom)) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Son du jeu introuvable ou inutilisable : " + son.Nom + " (ce son reste muet, les autres jouent).")); } return false; } Vector3 val2 = ((Component)joueur).transform.position + Vector3.up; GameObject val3 = new GameObject("SixVikings son en attente"); val3.SetActive(false); GameObject val4 = Object.Instantiate<GameObject>(val, val2, Quaternion.identity, val3.transform); GarderLeSonSeul(val4); bool forceDisableInit = ZNetView.m_forceDisableInit; try { ZNetView.m_forceDisableInit = true; val4.transform.SetParent(monteAvecLui ? ((Component)joueur).transform : null, true); } finally { ZNetView.m_forceDisableInit = forceDisableInit; Object.Destroy((Object)(object)val3); } ZSFX[] componentsInChildren = val4.GetComponentsInChildren<ZSFX>(true); foreach (ZSFX val5 in componentsInChildren) { val5.SetVolumeModifier(Sons.Modificateur(son.Volume, val5.m_maxVol)); val5.SetPitchModifier(son.Hauteur); val5.m_closedCaptionToken = ""; val5.m_secondaryCaptionToken = ""; } Object.Destroy((Object)(object)val4, 15f); return true; } internal static void GarderLeSonSeul(GameObject objet) { Component[] componentsInChildren = objet.GetComponentsInChildren<Component>(true); foreach (Component val in componentsInChildren) { if ((Object)(object)val == (Object)null || val is Transform || val is AudioSource || val is ZSFX || val is ZNetView) { continue; } Behaviour val2 = (Behaviour)(object)((val is Behaviour) ? val : null); if (val2 != null) { val2.enabled = false; continue; } Renderer val3 = (Renderer)(object)((val is Renderer) ? val : null); if (val3 != null) { val3.enabled = false; continue; } Collider val4 = (Collider)(object)((val is Collider) ? val : null); if (val4 != null) { val4.enabled = false; } } } private void SonsDuVol(Player joueur) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) SEMan sEMan = ((Character)joueur).GetSEMan(); bool num = sEMan.HaveStatusEffect(HashPlaner); bool voileOuMontee = num || sEMan.HaveStatusEffect(HashAscension); bool flag = ((Character)joueur).IsDead(); bool flag2 = ((Character)joueur).InWater(); bool flag3 = VentDuVol.EnVol(voileOuMontee, enVolPourLesSons, ((Character)joueur).IsOnGround(), ((Character)joueur).IsAttached(), flag2, flag); if (flag3 && !enVolPourLesSons) { volDepuis = Time.time; } enVolPourLesSons = flag3; bool value = sonsActifs.Value; Vector3 velocity = ((Character)joueur).GetVelocity(); float magnitude = ((Vector3)(ref velocity)).magnitude; ventVolume = VentDuVol.Lisser(cible: (flag3 && value) ? (VentDuVol.Volume(magnitude) * Sons.Reglage(volumeVent.Value)) : 0f, actuel: ventVolume, dt: Time.deltaTime, coupure: flag || flag2 || !value); JouerLeVent(ventVolume, VentDuVol.Hauteur(magnitude)); if (num && value) { Froisser(joueur, magnitude); } else { prochainFroissement = 0f; } Musique(MusiqueDuVol.Jouer(flag3 && value && musiqueDeVol.Value, Time.time - volDepuis)); } private void CouperLesSonsDuVol() { ventVolume = 0f; enVolPourLesSons = false; prochainFroissement = 0f; if ((Object)(object)vent != (Object)null && vent.isPlaying) { vent.Stop(); } Musique(jouer: false); } private void JouerLeVent(float volume, float hauteur) { if (volume < 0.002f) { if ((Object)(object)vent != (Object)null && vent.isPlaying) { vent.Stop(); } } else if (!((Object)(object)vent == (Object)null) || CreerLeVent()) { vent.volume = volume; vent.pitch = hauteur; if (!vent.isPlaying) { vent.Play(); } } } private bool CreerLeVent() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown if (ventIntrouvable) { return false; } AudioSource source; AudioClip val = SonDuJeu("vfx_frozenking_death", "Wind_RushingStormLoop", out source); if ((Object)(object)val == (Object)null) { ventIntrouvable = true; ((BaseUnityPlugin)this).Logger.LogWarning((object)"Son du jeu introuvable ou inutilisable : vfx_frozenking_death (le vol reste sans vent)."); return false; } GameObject val2 = new GameObject("SixVikings Vent"); val2.transform.SetParent(((Component)this).transform, false); vent = val2.AddComponent<AudioSource>(); vent.clip = val; vent.loop = true; vent.playOnAwake = false; vent.spatialBlend = 0f; vent.dopplerLevel = 0f; vent.outputAudioMixerGroup = (((Object)(object)source != (Object)null && (Object)(object)source.outputAudioMixerGroup != (Object)null) ? source.outputAudioMixerGroup : (((Object)(object)AudioMan.instance != (Object)null) ? AudioMan.instance.m_ambientMixer : null)); return true; } private static AudioClip SonDuJeu(string nomDuModele, string nomDuClip, out AudioSource source) { source = null; GameObject val = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab(nomDuModele) : null); ZSFX val2 = (((Object)(object)val != (Object)null) ? val.GetComponentInChildren<ZSFX>(true) : null); if ((Object)(object)val2 == (Object)null || val2.m_audioClips == null) { return null; } source = ((Component)val2).GetComponent<AudioSource>(); AudioClip val3 = null; AudioClip[] audioClips = val2.m_audioClips; foreach (AudioClip val4 in audioClips) { if (!((Object)(object)val4 == (Object)null)) { if (((Object)val4).name == nomDuClip) { return val4; } if ((Object)(object)val3 == (Object)null) { val3 = val4; } } } return val3; } private void Froisser(Player joueur, float vitesse) { if (froissements.Count == 0) { return; } if (prochainFroissement == 0f) { prochainFroissement = Time.time + 0.5f; } else if (!(Time.time < prochainFroissement)) { int count = froissements.Count; int index = (dernierFroissement = Toile.Suivant(dernierFroissement, Random.Range(0, (dernierFroissement < 0) ? count : (count - 1)), count)); float num = Toile.VolumeDuFroissement(vitesse) * Sons.Reglage(volumeToile.Value); if (num > 0f) { SourceDeLaToile(joueur).PlayOneShot(froissements[index], num); } froissementsJoues++; prochainFroissement = Time.time + Toile.Intervalle(vitesse) * Random.Range(0.85f, 1.15f); } } private AudioSource SourceDeLaToile(Player joueur) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)toile != (Object)null && (Object)(object)((Component)toile).transform.parent == (Object)(object)((Component)joueur).transform) { return toile; } GameObject val = new GameObject("SixVikings Toile"); val.transform.SetParent(((Component)joueur).transform, false); val.transform.localPosition = Vector3.up * 1.6f; toile = val.AddComponent<AudioSource>(); toile.playOnAwake = false; toile.spatialBlend = 1f; toile.dopplerLevel = 0f; toile.rolloffMode = (AudioRolloffMode)1; toile.minDistance = 3f; toile.maxDistance = 25f; SonDuJeu("sfx_vulture_wing_flap", null, out var source); if ((Object)(object)source != (Object)null) { toile.outputAudioMixerGroup = source.outputAudioMixerGroup; } return toile; } private void Musique(bool jouer) { if (!jouer) { musiqueRefusee = false; } if (!jouer && musiqueANous == null) { return; } MusicMan instance = MusicMan.instance; if ((Object)(object)instance == (Object)null) { musiqueANous = null; return; } string actuelle = MusiqueDeLieu(instance); if (jouer) { string sailingMusic = instance.GetSailingMusic(); string text = MusiqueJouee(instance); bool flag = (Object)(object)RandEventSystem.instance != (Object)null && RandEventSystem.instance.GetMusicOverride() != null; MusiqueDuVol.Geste geste = MusiqueDuVol.Image(musiqueANous, musiqueRefusee, actuelle, text, sailingMusic, instance.m_lastLocationMusic, flag); if (geste.Retirer) { instance.LocationMusic((string)null); } if (geste.LaissePasser) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Musique du vol : « " + musiqueANous + " » laisse passer " + (flag ? "la musique d'un événement" : ("« " + text + " »")) + " ; elle reviendra après.")); } if (geste.Refus) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Musique du vol : le jeu ne joue pas « " + musiqueANous + " » (« Musique continue » décochée et déjà jouée il y a peu, ou finie) : laissée pour ce vol.")); } if (geste.Poser) { instance.LocationMusic(sailingMusic); if (musiqueANous != sailingMusic) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Musique du vol : « " + sailingMusic + " » posée.")); } } musiqueANous = geste.ANous; musiqueRefusee = geste.Refusee; } else if (musiqueANous != null) { bool flag2 = MusiqueDuVol.Retirer(actuelle, musiqueANous); if (flag2) { instance.LocationMusic((string)null); } ((BaseUnityPlugin)this).Logger.LogInfo((object)("Musique du vol : « " + musiqueANous + " » " + (flag2 ? "retirée." : "laissée au jeu, qui l'arrête comme à la descente d'un bateau."))); musiqueANous = null; } } private static string MusiqueDeLieu(MusicMan m) { if (ChampMusiqueDeLieu == null) { throw new MissingFieldException("MusicMan", "m_locationMusic"); } return ChampMusiqueDeLieu.GetValue(m) as string; } internal static string MusiqueJouee(MusicMan m) { if (MethodeMusiqueJouee == null) { throw new MissingMethodException("MusicMan", "GetCurrentMusic"); } return MethodeMusiqueJouee.Invoke(m, null) as string; } private IEnumerator ChargerLesFroissements() { string[] fichiers; try { string? directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); string path = Path.Combine(directoryName, "sons"); List<string> list = new List<string>(Directory.GetFiles(directoryName, "catch_air_*.ogg", SearchOption.TopDirectoryOnly)); if (Directory.Exists(path)) { list.AddRange(Directory.GetFiles(path, "catch_air_*.ogg", SearchOption.AllDirectories)); } fichiers = list.ToArray(); Array.Sort(fichiers, (IComparer<string>?)StringComparer.Ordinal); } catch (Exception e) { Envol.Erreur("la recherche des froissements de toile", e); yield break; } string[] array = fichiers; foreach (string fichier in array) { UnityWebRequest lecture = UnityWebRequestMultimedia.GetAudioClip(new Uri(fichier).AbsoluteUri, (AudioType)14); try { yield return lecture.SendWebRequest(); AudioClip val = (((int)lecture.result == 1) ? DownloadHandlerAudioClip.GetContent(lecture) : null); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Froissement de toile illisible : " + Path.GetFileName(fichier) + " (" + lecture.error + ").")); } else { ((Object)val).name = Path.GetFileNameWithoutExtension(fichier); froissements.Add(val); } } finally { ((IDisposable)lecture)?.Dispose(); } } ((BaseUnityPlugin)this).Logger.LogInfo((object)("Toile du planeur : " + froissements.Count + " froissement(s) chargé(s)" + ((fichiers.Length == 0) ? " (aucun fichier catch_air_*.ogg à côté du mod)" : "") + ".")); } private void Traduire() { CustomLocalization localization = LocalizationManager.Instance.GetLocalization(); string text = "French"; localization.AddTranslation(ref text, new Dictionary<string, string> { { "sixvikings_planeur", "Planeur" }, { "sixvikings_planeur_description", "Un harnais et sa voile repliée. En l'air, la touche de saut l'ouvre ou la referme. Il vole là où tu regardes. Avancer pique et prend de la vitesse ; reculer redresse : tu remontes tant qu'il te reste de la vitesse, puis tu freines. Il coûte de l'endurance." }, { "sixvikings_tremplin_bois", "Tremplin de bois" }, { "sixvikings_tremplin_fer", "Tremplin de fer" }, { "sixvikings_tremplin_flametal", "Tremplin de flammétal" }, { "sixvikings_tremplin_bois_description", "Saute dessus : il te lance à cent mètres et te donne dix minutes d'élan." }, { "sixvikings_tremplin_fer_description", "Saute dessus : il te lance à quatre cents mètres et te donne dix minutes d'élan." }, { "sixvikings_tremplin_flametal_description", "Saute dessus : il te lance à mille cinq cents mètres et te donne dix minutes d'élan." }, { "sixvikings_elan", "Élan du tremplin" }, { "sixvikings_elan_aide", "Vol sans endurance, aucun dégât de chute, planeur plus rapide. Sans planeur, la touche de saut en l'air ouvre une voile de fortune." }, { "sixvikings_planer", "Vol plané" }, { "sixvikings_planer_aide", "Tu voles là où tu regardes. Avancer pique et prend de la vitesse, reculer remonte en la dépensant puis freine. La touche de saut referme la voile." }, { "sixvikings_ascension", "Envol" }, { "sixvikings_ascension_aide", "Le tremplin te porte vers le ciel." }, { "sixvikings_atterrissage", "Atterrissage protégé" }, { "sixvikings_atterrissage_aide", "Aucun dégât de chute jusqu'au sol." }, { "sixvikings_envol_decollage", "Envol !" }, { "sixvikings_envol_toit", "Le ciel n'est pas dégagé au-dessus du tremplin" }, { "sixvikings_envol_obstacle", "Un obstacle arrête la montée" }, { "sixvikings_envol_refus", "La voile ne s'ouvre pas" }, { "sixvikings_envol_decroche", "Plus d'endurance : la voile décroche" }, { "sixvikings_elan_bientot_fini", "L'élan du tremplin s'achève dans trente secondes" }, { "sixvikings_elan_fini", "L'élan du tremplin est fini" }, { "sixvikings_premier_sommet_bois", "Premier envol" }, { "sixvikings_premier_sommet_fer", "Au-dessus des forêts" }, { "sixvikings_premier_sommet_flametal", "Le toit du monde" }, { "sixvikings_visee_saute", "Saute dessus : envol de" }, { "sixvikings_visee_ciel_bouche", "Ciel bouché au-dessus : il ne lancera sans doute pas" } }); text = "French"; localization.AddTranslation(ref text, Vol.MessagesDesRefus.Values.ToDictionary((string[] m) => m[0], (string[] m) => m[1])); text = "English"; localization.AddTranslation(ref text, Vol.MessagesDesRefus.Values.ToDictionary((string[] m) => m[0], (string[] m) => m[2])); text = "English"; localization.AddTranslation(ref text, new Dictionary<string, string> { { "sixvikings_planeur", "Glider" }, { "sixvikings_planeur_description", "A harness and its folded sail. In the air, the jump key opens or closes it. It flies where you look. Forward dives and gains speed; backward pulls up: you climb while that speed lasts, then you brake. It costs stamina." }, { "sixvikings_tremplin_bois", "Wooden springboard" }, { "sixvikings_tremplin_fer", "Iron springboard" }, { "sixvikings_tremplin_flametal", "Flametal springboard" }, { "sixvikings_tremplin_bois_description", "Jump on it: it throws you a hundred meters up and gives you ten minutes of momentum." }, { "sixvikings_tremplin_fer_description", "Jump on it: it throws you four hundred meters up and gives you ten minutes of momentum." }, { "sixvikings_tremplin_flametal_description", "Jump on it: it throws you fifteen hundred meters up and gives you ten minutes of momentum." }, { "sixvikings_elan", "Springboard momentum" }, { "sixvikings_elan_aide", "Flight without stamina, no fall damage, faster glider. Without a glider, the jump key in the air opens a makeshift sail." }, { "sixvikings_planer", "Gliding" }, { "sixvikings_planer_aide", "You fly where you look. Forward dives and gains speed, backward climbs by spending it, then brakes. The jump key closes the sail." }, { "sixvikings_ascension", "Lift-off" }, { "sixvikings_ascension_aide", "The springboard carries you to the sky." }, { "sixvikings_atterrissage", "Protected landing" }, { "sixvikings_atterrissage_aide", "No fall damage until you reach the ground." }, { "sixvikings_envol_decollage", "Lift-off!" }, { "sixvikings_envol_toit", "The sky is not clear above the springboard" }, { "sixvikings_envol_obstacle", "Something overhead stops the lift-off" }, { "sixvikings_envol_refus", "The sail will not open" }, { "sixvikings_envol_decroche", "Out of stamina: the sail stalls" }, { "sixvikings_elan_bientot_fini", "Springboard momentum ends in thirty seconds" }, { "sixvikings_elan_fini", "Springboard momentum is over" }, { "sixvikings_premier_sommet_bois", "First flight" }, { "sixvikings_premier_sommet_fer", "Above the forests" }, { "sixvikings_premier_sommet_flametal", "Roof of the world" }, { "sixvikings_visee_saute", "Jump on it: lift of" }, { "sixvikings_visee_ciel_bouche", "Sky blocked above: it will most likely not launch" } }); } } public class Tremplin : MonoBehaviour, Hoverable { public int Rang; private float prochaineMesure; private bool cielLibre = true; public string GetHoverText() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) try { if (Time.time >= prochaineMesure) { prochaineMesure = Time.time + 0.5f; cielLibre = Envol.CielLibreAuDessus(((Component)this).transform); } return Localization.instance.Localize(Affichage.Visee(Rang, Plugin.HauteurDuTremplin(Rang), cielLibre, Envol.Reglages.Plafond - ((Component)this).transform.position.y)); } catch (Exception e) { Envol.Erreur("le texte du tremplin visé", e); return ""; } } public string GetHoverName() { return Localization.instance.Localize("$sixvikings_tremplin_" + Tremplins.Niveaux[Mathf.Clamp(Rang, 0, 2)].Nom.ToLowerInvariant()); } public float GetHoverOffset() { return 0f; } } public class Aile : MonoBehaviour { private GameObject voile; private int montree; public void Montrer(int sorte) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (sorte == montree) { return; } montree = sorte; if ((Object)(object)voile != (Object)null) { Object.Destroy((Object)(object)voile); } voile = null; if (sorte != 0) { voile = Plugin.FabriquerUneVoile(sorte); if (!((Object)(object)voile == (Object)null)) { voile.transform.SetParent(((Component)this).transform, false); voile.transform.localPosition = new Vector3(0f, 2.55f, 0.1f); voile.transform.localRotation = Quaternion.Euler(-8f, 0f, 0f); } } } private void OnDestroy() { if ((Object)(object)voile != (Object)null) { Object.Destroy((Object)(object)voile); } } } internal static class Formes { private sealed class Chantier { public readonly List<Vector3> Points = new List<Vector3>(); public readonly List<Vector3> Normales = new List<Vector3>(); public readonly List<Vector2> Uv = new List<Vector2>(); public readonly List<int> Triangles = new List<int>(); public int Point(Vector3 point, Vector3 normale, Vector2 uv) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Points.Add(point); Normales.Add(normale); Uv.Add(uv); return Points.Count - 1; } public void Triangle(int a, int b, int c) { Triangles.Add(a); Triangles.Add(b); Triangles.Add(c); } public void Quad(int a, int b, int c, int d) { Triangle(a, b, c); Triangle(a, c, d); } public Mesh Maillage(string nom) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown Mesh val = new Mesh { name = nom }; val.SetVertices(Points); val.SetNormals(Normales); val.SetUVs(0, Uv); val.SetTriangles(Triangles, 0); val.RecalculateBounds(); val.RecalculateTangents(); return val; } } private static Vector3 SurCercle(float rayon, float angle, float y) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return new Vector3(Mathf.Cos(angle) * rayon, y, Mathf.Sin(angle) * rayon); } public static Mesh Anneau(string nom, float rayonInterieur, float rayonExterieur, float hauteur, int segments) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_0096: 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_00a3: U