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 Faithful v1.5.13
Faithful.Shared.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] namespace Faithful.Shared; public enum RendererModifier { None = 0, HopooShader = 10, InfusionGlass = 20, AreaIndicatorIntersectionOnly = 30, AreaIndicatorRim = 40, Artifact = 50, ArtifactShellExplosionIndicator = 60, BaubleTimestopSphere = 70, BlueprintScreen = 80, BlueprintsInvalid = 90, BlueprintsOk = 100, BootShockwave = 110, CaptainAirstrikeAltAreaIndicatorInner = 120, CaptainAirstrikeAltAreaIndicatorOuter = 130, CaptainAirstrikeAreaIndicator = 140, CaptainSupplyDropAreaIndicator2 = 150, CaptainSupplyDropAreaIndicatorOuter = 160, ChefAlwaysOnTop = 170, Chest = 175, ChildStarCore = 180, ChildStarGlow = 190, ChipProjectile = 200, ClayBubble = 210, CombinerEnergyFade = 220, CoreCage2 = 230, DefectiveUnitDenialSphereNoise = 240, DefectiveUnitDetonateSphereEnergy = 250, DefectiveUnitDetonateSphereEnergyPers = 260, DefectiveUnitDetonateSphereNoise = 270, DefectiveUnitDetonateSpherePulse = 280, DefectiveUnitNullifySpherePulse = 290, DroneBrokenGeneric = 300, NullifierArmor = 310, NullifierGemPortal = 320, NullifierGemPortal3 = 330, NullifierBlackholeZoneAreaIndicator = 340, NullifierExplosionAreaIndicatorHard = 350, RadarTowerAreaIndicator = 360, ShockDamageAuraGlass = 370, TeamAreaIndicatorFullMonster = 380, TeamAreaIndicatorFullPlayer = 390, TeamAreaIndicatorIntersectionMonster = 400, TeamAreaIndicatorIntersectionPlayer = 410, TimeCrystalAreaIndicator = 420, VoidDeathBombAreaIndicatorBack = 430, VoidDeathBombAreaIndicatorFront = 440, VoidSurvivorBlasterSphereAreaIndicator = 450, VoidSurvivorBlasterSphereAreaIndicatorCorrupted = 460 } [Serializable] public struct ShaderTextureRule { public string name; public Texture texture; } [Serializable] public struct ShaderColourRule { public string name; public Color colour; } [Serializable] public struct ShaderVectorRule { public string name; public Vector4 value; } [Serializable] public struct ShaderKeywordRule { public string keyword; public bool enabled; } [Serializable] public struct ShaderFloatRule { public string name; public float value; } [Serializable] public struct ShaderIntRule { public string name; public int value; } [DisallowMultipleComponent] public sealed class RendererRules : MonoBehaviour { [Header("General")] public RendererModifier modifier; public bool salvageExistingProperties; [Header("Dither Model")] public bool addDitherModelComponent; public float ditherModelFade = 1f; public float ditherModelOldFade = 1f; public Collider ditherModelBounds; public List<Renderer> ditherModelRenderers = new List<Renderer>(); [Header("Shader Attributes")] public List<ShaderTextureRule> textureRules = new List<ShaderTextureRule>(); public List<ShaderColourRule> colourRules = new List<ShaderColourRule>(); public List<ShaderVectorRule> vectorRules = new List<ShaderVectorRule>(); public List<ShaderKeywordRule> keywordRules = new List<ShaderKeywordRule>(); public List<ShaderFloatRule> floatRules = new List<ShaderFloatRule>(); public List<ShaderIntRule> intRules = new List<ShaderIntRule>(); }
Faithful.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.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Commando.CommandoWeapon; using EntityStates.Drone.Command; using EntityStates.Huntress; using EntityStates.Huntress.HuntressWeapon; using EntityStates.Mage; using Faithful; using Faithful.Shared; using Faithful.Skills.Technician; using Faithful.Skills.Temp; using HG; using HG.BlendableTypes; using HarmonyLib; using IL.RoR2; using IL.RoR2.UI; using ItemQualities; using ItemQualities.ContentManagement; using ItemQualities.Utilities.Extensions; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using Newtonsoft.Json; using On.EntityStates; using On.EntityStates.Drone.Command; using On.EntityStates.Huntress.HuntressWeapon; using On.EntityStates.Mage; using On.RoR2; using On.RoR2.UI; using On.RoR2.UI.LogBook; using On.RoR2.UI.MainMenu; using R2API; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Hologram; using RoR2.Navigation; using RoR2.Networking; using RoR2.Skills; using RoR2.Stats; using RoR2.UI; using RoR2.UI.MainMenu; using TMPro; using Unity; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceLocations; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyCompany("Faithful")] [assembly: AssemblyProduct("Faithful")] [assembly: AssemblyTitle("Faithful")] [assembly: AssemblyInformationalVersion("1.0.0+c4c0cdee3836eb506bdc62eec7b21bf1c70ec653")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [Embedded] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Faithful { internal static class Assets { public const string bundleName = "faithfulbundle"; public static AssetBundle assetBundle; public static Material mageJetMaterial; public static Material infusionGlassMaterial; public static Material areaIndicatorIntersectionOnlyMaterial; public static Material areaIndicatorRimMaterial; public static Material artifactMaterial; public static Material artifactShellExplosionIndicatorMaterial; public static Material baubleTimestopSphereMaterial; public static Material blueprintScreenMaterial; public static Material blueprintsInvalidMaterial; public static Material blueprintsOkMaterial; public static Material bootShockwaveMaterial; public static Material captainAirstrikeAltAreaIndicatorInnerMaterial; public static Material captainAirstrikeAltAreaIndicatorOuterMaterial; public static Material captainAirstrikeAreaIndicatorMaterial; public static Material captainSupplyDropAreaIndicator2Material; public static Material captainSupplyDropAreaIndicatorOuterMaterial; public static Material chefAlwaysOnTopMaterial; public static Material childStarCoreMaterial; public static Material childStarGlowMaterial; public static Material chipProjectileMaterial; public static Material clayBubbleMaterial; public static Material combinerEnergyFadeMaterial; public static Material coreCage2Material; public static Material defectiveUnitDenialSphereNoiseMaterial; public static Material defectiveUnitDetonateSphereEnergyMaterial; public static Material defectiveUnitDetonateSphereEnergyPersMaterial; public static Material defectiveUnitDetonateSphereNoiseMaterial; public static Material defectiveUnitDetonateSpherePulseMaterial; public static Material defectiveUnitNullifySpherePulseMaterial; public static Material droneBrokenGenericMaterial; public static Material nullifierArmorMaterial; public static Material nullifierGemPortalMaterial; public static Material nullifierGemPortal3Material; public static Material nullifierBlackholeZoneAreaIndicatorMaterial; public static Material nullifierExplosionAreaIndicatorHardMaterial; public static Material radarTowerAreaIndicatorMaterial; public static Material shockDamageAuraGlassMaterial; public static Material teamAreaIndicatorFullMonsterMaterial; public static Material teamAreaIndicatorFullPlayerMaterial; public static Material teamAreaIndicatorIntersectionMonsterMaterial; public static Material teamAreaIndicatorIntersectionPlayerMaterial; public static Material timeCrystalAreaIndicatorMaterial; public static Material voidDeathBombAreaIndicatorBackMaterial; public static Material voidDeathBombAreaIndicatorFrontMaterial; public static Material voidSurvivorBlasterSphereAreaIndicatorMaterial; public static Material voidSurvivorBlasterSphereAreaIndicatorCorruptedMaterial; public static Material chestMaterial; public static Wave[] mageJetWaves; public static GameObject mageJetAkEventsPrefab; public static GameObject radiusIndicatorPrefab; public static GameObject pennonEffectPrefab; public static GameObject matrixEffectPrefab; public static GameObject matrixEffectLocalPrefab; public static GameObject shrineUseEffectPrefab; public static GameObject technicianArcPrefab; public static GameObject technicianTrackingIndicatorPrefab; public static PhysicMaterial ragdollMaterial; public static DynamicBone scarfDynamicBone; public static Sprite dronePingIcon; public static Sprite inventoryPingIcon; public static Sprite lootPingIcon; public static Sprite shrinePingIcon; public static Sprite teleporterPingIcon; public static Sprite mysteryPingIcon; public static Sprite chestInspectIcon; public static Sprite droneInspectIcon; public static Sprite lunarInspectIcon; public static Sprite pillarInspectIcon; public static Sprite printerInspectIcon; public static Sprite radioScannerInspectIcon; public static Sprite scapperInspectIcon; public static Sprite shrineInspectIcon; public static Sprite meridianInspectIcon; public static Sprite voidInspectIcon; public static Sprite mysteryInspectIcon; public static Material chanceShrineSymbolMaterial; public static ExpansionDef sotvDef; public static ExpansionDef sotsDef; private const string defaultModel = "temporalcubemesh"; private const string defaultIcon = "textemporalcubeicon"; private const string defaultConsumedIcon = "textemporalcubeconsumedicon"; private const string defaultBuffIcon = "texbufftemporalcube"; private static readonly Dictionary<string, ItemDef> officialItemLookup = new Dictionary<string, ItemDef>(StringComparer.OrdinalIgnoreCase); private static readonly HashSet<string> scannedOfficialItemKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase); private static bool builtOfficialItemLookup; public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(Utils.pluginInfo.Location), "faithfulbundle"); public static void Init() { assetBundle = AssetBundle.LoadFromFile(AssetBundlePath); if (Utils.verboseConsole) { string[] allAssetNames = assetBundle.GetAllAssetNames(); string[] array = allAssetNames; foreach (string text in array) { Log.Debug("[ASSETS] - Loaded asset '" + text + "'"); } } FetchNeededRoR2Resources(); RiskOfOptionsWrapper.UpdateModIcon(); } private static void FetchNeededRoR2Resources() { //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_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_08b8: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Unknown result type (might be due to invalid IL or missing references) //IL_0983: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Unknown result type (might be due to invalid IL or missing references) //IL_0a4a: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Unknown result type (might be due to invalid IL or missing references) //IL_0ac6: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0b6e: Unknown result type (might be due to invalid IL or missing references) //IL_0bb5: Unknown result type (might be due to invalid IL or missing references) //IL_0c25: Unknown result type (might be due to invalid IL or missing references) //IL_0c6c: Unknown result type (might be due to invalid IL or missing references) //IL_0c7c: Unknown result type (might be due to invalid IL or missing references) //IL_0c81: Unknown result type (might be due to invalid IL or missing references) //IL_0cee: Unknown result type (might be due to invalid IL or missing references) //IL_0d1c: Unknown result type (might be due to invalid IL or missing references) //IL_0d4a: Unknown result type (might be due to invalid IL or missing references) //IL_0d78: Unknown result type (might be due to invalid IL or missing references) //IL_0d8d: Unknown result type (might be due to invalid IL or missing references) //IL_0da2: Unknown result type (might be due to invalid IL or missing references) //IL_0dc6: Unknown result type (might be due to invalid IL or missing references) //IL_0e6c: Unknown result type (might be due to invalid IL or missing references) //IL_0ea9: Unknown result type (might be due to invalid IL or missing references) //IL_0f56: Unknown result type (might be due to invalid IL or missing references) //IL_0f9d: Unknown result type (might be due to invalid IL or missing references) //IL_105e: Unknown result type (might be due to invalid IL or missing references) //IL_10e2: Unknown result type (might be due to invalid IL or missing references) //IL_115c: Unknown result type (might be due to invalid IL or missing references) //IL_11a3: Unknown result type (might be due to invalid IL or missing references) //IL_11ea: Unknown result type (might be due to invalid IL or missing references) //IL_1296: Unknown result type (might be due to invalid IL or missing references) //IL_129b: Unknown result type (might be due to invalid IL or missing references) //IL_12a4: Unknown result type (might be due to invalid IL or missing references) //IL_12b4: Unknown result type (might be due to invalid IL or missing references) //IL_12b9: Unknown result type (might be due to invalid IL or missing references) //IL_1310: Unknown result type (might be due to invalid IL or missing references) //IL_1368: Unknown result type (might be due to invalid IL or missing references) //IL_1396: Unknown result type (might be due to invalid IL or missing references) //IL_1451: Unknown result type (might be due to invalid IL or missing references) //IL_1465: Unknown result type (might be due to invalid IL or missing references) //IL_1497: Unknown result type (might be due to invalid IL or missing references) //IL_14c9: Unknown result type (might be due to invalid IL or missing references) //IL_14fb: Unknown result type (might be due to invalid IL or missing references) //IL_152d: Unknown result type (might be due to invalid IL or missing references) //IL_155f: Unknown result type (might be due to invalid IL or missing references) //IL_1591: Unknown result type (might be due to invalid IL or missing references) //IL_1618: Unknown result type (might be due to invalid IL or missing references) //IL_164f: Unknown result type (might be due to invalid IL or missing references) //IL_1669: Unknown result type (might be due to invalid IL or missing references) //IL_166e: Unknown result type (might be due to invalid IL or missing references) //IL_1697: Unknown result type (might be due to invalid IL or missing references) //IL_169c: Unknown result type (might be due to invalid IL or missing references) mageJetMaterial = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"aa5dbb90045bc694bb20ffb706507091").WaitForCompletion()); mageJetMaterial.SetTexture("_RemapTex", GetTexture("texRamp4T0NFire")); infusionGlassMaterial = FetchAsset<Material>("RoR2/Base/Infusion/matInfusionGlass.mat"); areaIndicatorIntersectionOnlyMaterial = FetchAsset<Material>("RoR2/Base/Common/VFX/matAreaIndicatorIntersectionOnly.mat"); areaIndicatorRimMaterial = FetchAsset<Material>("RoR2/Base/Common/VFX/matAreaIndicatorRim.mat"); artifactMaterial = FetchAsset<Material>("RoR2/GlobalContent/matArtifact.mat"); artifactShellExplosionIndicatorMaterial = FetchAsset<Material>("RoR2/Base/artifactworld/matArtifactShellExplosionIndicator.mat"); baubleTimestopSphereMaterial = FetchAsset<Material>("RoR2/Base/SlowOnHit/matBaubleTimestopSphere.mat"); blueprintScreenMaterial = FetchAsset<Material>("RoR2/Junk/Misc/matBlueprintScreen.mat"); blueprintsInvalidMaterial = FetchAsset<Material>("RoR2/Base/Engi/matBlueprintsInvalid.mat"); blueprintsOkMaterial = FetchAsset<Material>("RoR2/Base/Engi/matBlueprintsOk.mat"); bootShockwaveMaterial = FetchAsset<Material>("RoR2/Base/FallBoots/matBootShockwave.mat"); captainAirstrikeAltAreaIndicatorInnerMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorInner.mat"); captainAirstrikeAltAreaIndicatorOuterMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorOuter.mat"); captainAirstrikeAreaIndicatorMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainAirstrikeAreaIndicator.mat"); captainSupplyDropAreaIndicator2Material = FetchAsset<Material>("RoR2/Base/Captain/matCaptainSupplyDropAreaIndicator2.mat"); captainSupplyDropAreaIndicatorOuterMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainSupplyDropAreaIndicatorOuter.mat"); chefAlwaysOnTopMaterial = FetchAsset<Material>("RoR2/DLC2/Chef/matChef_AlwaysOnTop.mat"); childStarCoreMaterial = FetchAsset<Material>("RoR2/DLC2/Child/matChildStarCore.mat"); childStarGlowMaterial = FetchAsset<Material>("RoR2/DLC2/Child/matChildStarGlow.mat"); chipProjectileMaterial = FetchAsset<Material>("RoR2/DLC3/SolusHeart/matChipProjectile.mat"); clayBubbleMaterial = FetchAsset<Material>("RoR2/Base/Clay/matClayBubble.mat"); combinerEnergyFadeMaterial = FetchAsset<Material>("RoR2/DLC3/DroneCombinerStation/matCombinerEnergyFade.mat"); coreCage2Material = FetchAsset<Material>("RoR2/DLC3/Items/MasterCore/matCoreCage2.mat"); defectiveUnitDenialSphereNoiseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDenialSphereNoise.mat"); defectiveUnitDetonateSphereEnergyMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSphereEnergy.mat"); defectiveUnitDetonateSphereEnergyPersMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSphereEnergyPers.mat"); defectiveUnitDetonateSphereNoiseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSphereNoise.mat"); defectiveUnitDetonateSpherePulseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSpherePulse.mat"); defectiveUnitNullifySpherePulseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitNullifySpherePulse.mat"); droneBrokenGenericMaterial = FetchAsset<Material>("RoR2/Base/Drones/matDroneBrokenGeneric.mat"); nullifierArmorMaterial = FetchAsset<Material>("RoR2/Base/Nullifier/matNullifierArmor.mat"); nullifierGemPortalMaterial = FetchAsset<Material>("RoR2/Base/Nullifier/matNullifierGemPortal.mat"); nullifierGemPortal3Material = FetchAsset<Material>("RoR2/DLC1/Common/Void/matNullifierGemPortal3.mat"); nullifierBlackholeZoneAreaIndicatorMaterial = FetchAsset<Material>("RoR2/DLC1/Common/Void/matNullifierBlackholeZoneAreaIndicator.mat"); nullifierExplosionAreaIndicatorHardMaterial = FetchAsset<Material>("RoR2/Base/Nullifier/matNullifierExplosionAreaIndicatorHard.mat"); radarTowerAreaIndicatorMaterial = FetchAsset<Material>("RoR2/Base/RadarTower/matRadarTowerAreaIndicator.mat"); shockDamageAuraGlassMaterial = FetchAsset<Material>("RoR2/DLC3/Items/ShockDamageAura/matShockDamageAuraGlass.mat"); teamAreaIndicatorFullMonsterMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorFullMonster.mat"); teamAreaIndicatorFullPlayerMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorFullPlayer.mat"); teamAreaIndicatorIntersectionMonsterMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorIntersectionMonster.mat"); teamAreaIndicatorIntersectionPlayerMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorIntersectionPlayer.mat"); timeCrystalAreaIndicatorMaterial = FetchAsset<Material>("RoR2/Base/crystalworld/matTimeCrystalAreaIndicator.mat"); voidDeathBombAreaIndicatorBackMaterial = FetchAsset<Material>("RoR2/Base/Common/matVoidDeathBombAreaIndicatorBack.mat"); voidDeathBombAreaIndicatorFrontMaterial = FetchAsset<Material>("RoR2/Base/Common/matVoidDeathBombAreaIndicatorFront.mat"); voidSurvivorBlasterSphereAreaIndicatorMaterial = FetchAsset<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterSphereAreaIndicator.mat"); voidSurvivorBlasterSphereAreaIndicatorCorruptedMaterial = FetchAsset<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterSphereAreaIndicatorCorrupted.mat"); chestMaterial = FetchAsset<Material>("RoR2/Base/Chest1/matChest1.mat"); mageJetWaves = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"92199783eae803f4095bc93685a5ee70").WaitForCompletion().GetComponent<Transform>() .Find("ModelBase") .Find("mdlMage") .Find("MageArmature") .Find("ROOT") .Find("base") .Find("stomach") .Find("chest") .Find("JetsOn") .Find("Point Light")).GetComponent<FlickerLight>().sinWaves; GameObject val = Object.Instantiate<GameObject>(((Component)Addressables.LoadAssetAsync<GameObject>((object)"92199783eae803f4095bc93685a5ee70").WaitForCompletion().transform.Find("ModelBase").Find("mdlMage").Find("MageArmature") .Find("ROOT") .Find("base") .Find("stomach") .Find("chest") .Find("JetsOn")).gameObject); mageJetAkEventsPrefab = PrefabAPI.InstantiateClone(val, "faithfulMageJetAkEvents", false); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("Fire")).gameObject); Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("Point Light")).gameObject); Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("JetsL")).gameObject); Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("JetsR")).gameObject); Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("FireRing")).gameObject); mageJetAkEventsPrefab.transform.SetParent((Transform)null); mageJetAkEventsPrefab.transform.position = Vector3.zero; mageJetAkEventsPrefab.transform.localEulerAngles = Vector3.zero; mageJetAkEventsPrefab.transform.localScale = Vector3.zero; Object.DestroyImmediate((Object)(object)mageJetAkEventsPrefab.GetComponent<Rigidbody>()); GameObject val2 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"6b314230ed88f3c4b8d55cc64846854b").WaitForCompletion()); pennonEffectPrefab = PrefabAPI.InstantiateClone(val2, "faithfulLeadersPennonEffect", false); Object.DestroyImmediate((Object)(object)val2); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.5803921f, 0.22745098f, 61f / 85f)); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.5803921f, 0.22745098f, 61f / 85f)); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampPennonBuff")); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_MainTex", GetTexture("texIndicatorPennonMask")); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.mainTexture = GetTexture("texIndicatorPennonMask"); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.1f, 0f, 2.6384087f)); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.1f, 0f, 2.6384087f)); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.1f, 0f, 1f)); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.1f, 0f, 1f)); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.5803921f, 0.22745098f, 1f)); ((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.5803921f, 0.22745098f, 1f)); GameObject val3 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"6b314230ed88f3c4b8d55cc64846854b").WaitForCompletion()); matrixEffectPrefab = PrefabAPI.InstantiateClone(val3, "faithfulTargetingMatrixEffect", false); Object.DestroyImmediate((Object)(object)val3); Material material = ((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material; ((Object)material).name = "matTargetingMatrixEffect"; material.SetFloat("_InvFade", 0f); material.SetColor("_Color", new Color(1f, 0f, 0f)); material.SetColor("_TintColor", new Color(1f, 0f, 0f)); material.SetTexture("_RemapTex", GetTexture("texRampPennonBuff")); material.SetTexture("_MainTex", GetTexture("texIndicatorMatrixMask")); material.mainTexture = GetTexture("texIndicatorMatrixMask"); ((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f)); ((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f)); Object.DestroyImmediate((Object)(object)((Component)matrixEffectPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).gameObject); ((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f)); ((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f)); GameObject val4 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"6b314230ed88f3c4b8d55cc64846854b").WaitForCompletion()); matrixEffectLocalPrefab = PrefabAPI.InstantiateClone(val4, "faithfulTargetingMatrixEffect", false); Object.DestroyImmediate((Object)(object)val4); Material material2 = ((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material; ((Object)material2).name = "matTargetingMatrixLocalEffect"; material2.SetColor("_Color", new Color(1f, 0f, 0f)); material2.SetColor("_TintColor", new Color(1f, 0f, 0f)); material2.SetTexture("_RemapTex", GetTexture("texRampPennonBuff")); material2.SetTexture("_MainTex", GetTexture("texIndicatorMatrixMask")); material2.mainTexture = GetTexture("texIndicatorMatrixMask"); ((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f)); ((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f)); Object.DestroyImmediate((Object)(object)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).gameObject); ((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f)); ((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f)); GameObject val5 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"5ba295c0a3919a544939e6efe1ff17b3").WaitForCompletion()); radiusIndicatorPrefab = PrefabAPI.InstantiateClone(val5, "faithfulRadiusIndicator", false); Object.DestroyImmediate((Object)(object)val5); Object.DestroyImmediate((Object)(object)radiusIndicatorPrefab.GetComponent<NetworkedBodyAttachment>()); Object.DestroyImmediate((Object)(object)radiusIndicatorPrefab.GetComponent<NetworkIdentity>()); ((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Donut")).GetComponent<MeshRenderer>()).material.SetColor("_Color", Color.white); ((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Donut")).GetComponent<MeshRenderer>()).material.SetColor("_TintColor", Color.white); ((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Radius, Spherical")).GetComponent<MeshRenderer>()).material.SetColor("_Color", Color.white); ((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Radius, Spherical")).GetComponent<MeshRenderer>()).material.SetColor("_TintColor", Color.white); radiusIndicatorPrefab.transform.position = Vector3.zero; radiusIndicatorPrefab.transform.eulerAngles = Vector3.zero; radiusIndicatorPrefab.transform.localScale = new Vector3(1f, 1f, 1f); radiusIndicatorPrefab.AddComponent<FaithfulRadiusIndicatorBehaviour>(); shrineUseEffectPrefab = FetchAsset<GameObject>("RoR2/Base/Common/VFX/ShrineUseEffect.prefab"); GameObject val6 = Object.Instantiate<GameObject>(FetchAsset<GameObject>("RoR2/Base/Engi/LaserEngiTurret.prefab")); technicianArcPrefab = PrefabAPI.InstantiateClone(val6, "faithfulTechnicianArc", false); Object.DestroyImmediate((Object)(object)val6); ((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>().widthMultiplier = 3f; ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetColor("_TintColor", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician")); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetTexture("_Cloud2Tex", GetTexture("texLightningTechnician")); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_MainTex", GetTexture("texTechnicianFlare")); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician")); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("HitFlash")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("HitFlash")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician")); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Ring, Bright")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Ring, Bright")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician")); ((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Point light")).GetComponent<Light>().color = new Color(0.9725f, 1f, 0.5373f); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.9725f, 1f, 0.5373f)); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_MainTex", GetTexture("texTechnicianFlare")); ((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician")); ParticleSystem component = ((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystem>(); MainModule main = component.main; ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(4f); GameObject val7 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"2c791c24593eab442b64bb8c822a4f01").WaitForCompletion()); technicianTrackingIndicatorPrefab = PrefabAPI.InstantiateClone(val7, "faithfulTechnicianTracker", false); Object.DestroyImmediate((Object)(object)val7); ((Component)technicianTrackingIndicatorPrefab.transform.Find("Core Pip")).GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 0.375f, 0.286f); ((Renderer)((Component)technicianTrackingIndicatorPrefab.transform.Find("Core Pip")).GetComponent<SpriteRenderer>()).sortingOrder = 1; ((Component)technicianTrackingIndicatorPrefab.transform.Find("Core, Dark")).GetComponent<SpriteRenderer>().color = new Color(0.5f, 0.5f, 0.25f, 0.953f); technicianTrackingIndicatorPrefab.transform.Find("Holder").localScale = new Vector3(1f, 1f, 1f); ((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<RotateAroundAxis>().reverse = true; ((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<RotateAroundAxis>().fastRotationSpeed = 60f; ((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<RotateAroundAxis>().slowRotationSpeed = 30f; Object.DestroyImmediate((Object)(object)((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<ObjectScaleCurve>()); GameObject[] array = Utils.FindChildrenWithTerm(technicianTrackingIndicatorPrefab.transform.Find("Holder"), "Nib Holder"); array[0].transform.localEulerAngles = Vector3.zero; array[1].transform.localEulerAngles = Vector3.zero; ((Component)array[0].transform.Find("Nib")).transform.localPosition = new Vector3(0.22f, 0f, 0f); ((Component)array[1].transform.Find("Nib")).transform.localPosition = new Vector3(-0.22f, 0f, 0f); ((Component)array[0].transform.Find("Nib")).transform.localEulerAngles = new Vector3(0f, 0f, 90f); ((Component)array[1].transform.Find("Nib")).transform.localEulerAngles = new Vector3(0f, 0f, 270f); ((Component)array[0].transform.Find("Nib")).transform.localScale = new Vector3(0.15f, 0.15f, 1f); ((Component)array[1].transform.Find("Nib")).transform.localScale = new Vector3(0.15f, 0.15f, 1f); ((Component)array[0].transform.Find("Nib")).GetComponent<SpriteRenderer>().sprite = GetSprite("texCrosshairTrackerBracket"); ((Component)array[1].transform.Find("Nib")).GetComponent<SpriteRenderer>().sprite = GetSprite("texCrosshairTrackerBracket"); ((Component)array[0].transform.Find("Nib")).GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 0.375f, 0.286f); ((Component)array[1].transform.Find("Nib")).GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 0.375f, 0.286f); Object.DestroyImmediate((Object)(object)array[2]); ragdollMaterial = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"64ee0a4463fdfdc41ac7a06c8f5f2f0f").WaitForCompletion().GetComponentInChildren<RagdollController>() .bones[1]).GetComponent<Collider>().material; scarfDynamicBone = Utils.FindChildByName(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/LunarSun/DisplaySunHeadNeck.prefab").WaitForCompletion().transform, "Bandage1").GetComponent<DynamicBone>(); dronePingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texDroneIconOutlined.png"); inventoryPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texInventoryIconOutlined.png"); lootPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texLootIconOutlined.png"); shrinePingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texShrineIconOutlined.png"); teleporterPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texTeleporterIconOutlined.png"); mysteryPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texMysteryIcon.png"); chestInspectIcon = FetchAsset<Sprite>("RoR2/Base/ChestIcon_1.png"); droneInspectIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texDroneIconOutlined.png"); lunarInspectIcon = FetchAsset<Sprite>("RoR2/Base/LunarIcon_1.png"); pillarInspectIcon = FetchAsset<Sprite>("RoR2/Base/PillarIcon.png"); printerInspectIcon = FetchAsset<Sprite>("RoR2/Base/PrinterIcon_1.png"); radioScannerInspectIcon = FetchAsset<Sprite>("RoR2/Base/RadioScannerIcon_2.png"); scapperInspectIcon = FetchAsset<Sprite>("RoR2/Base/ScrapperIcon.png"); shrineInspectIcon = FetchAsset<Sprite>("RoR2/Base/ShrineIcon.png"); meridianInspectIcon = FetchAsset<Sprite>("RoR2/DLC2/texColossusExpansionIcon.png"); voidInspectIcon = FetchAsset<Sprite>("RoR2/Base/VoidIcon_2.png"); mysteryInspectIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texMysteryIcon.png"); chanceShrineSymbolMaterial = FetchAsset<Material>("RoR2/Base/ShrineChance/matShrineChanceSymbol.mat"); sotvDef = FetchAsset<ExpansionDef>("RoR2/DLC1/Common/DLC1.asset"); sotsDef = FetchAsset<ExpansionDef>("RoR2/DLC2/Common/DLC2.asset"); if (Utils.verboseConsole) { Log.Debug("[ASSETS] - Fetched all needed resources from RoR2 assets."); } } public static string FindAsset(string _file) { _file = _file.ToLower(); string[] allAssetNames = assetBundle.GetAllAssetNames(); foreach (string text in allAssetNames) { if (text.ToLower().Contains(_file)) { return text; } } return null; } public static bool HasAsset(string _name) { string text = FindAsset(_name); return text != null; } public static void LogRoR2Resources() { List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>(); LegacyResourcesAPI.GetAllPathGuidPairs(list); foreach (KeyValuePair<string, string> item in list) { Log.Debug("[ASSETS] - Resource found: '" + item.Key + "' | GUID: " + item.Value); } } public static void FindRoR2Resources(string _searchTerm) { List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>(); LegacyResourcesAPI.GetAllPathGuidPairs(list); string text = "\n[ASSETS]\n====================\nAttempting to find resources with search term: '" + _searchTerm + "'\n--------------------"; bool flag = false; foreach (KeyValuePair<string, string> item in list) { if (item.Key.ToUpper().Contains(_searchTerm.ToUpper())) { flag = true; text = text + "\nResource found: '" + item.Key + "' | GUID: " + item.Value; } } text += (flag ? "\n====================" : "\nNo resources found...\n===================="); Log.Info(text); } public static T FetchAsset<T>(string _path) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync<T>((object)_path).WaitForCompletion(); } public static bool TryGetOfficialItem(string _value, out ItemDef _itemDef) { _itemDef = null; if (string.IsNullOrWhiteSpace(_value)) { return false; } BuildOfficialItemLookup(); return officialItemLookup.TryGetValue(_value.Trim(), out _itemDef) && (Object)(object)_itemDef != (Object)null; } private static void BuildOfficialItemLookup() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if (builtOfficialItemLookup) { return; } builtOfficialItemLookup = true; foreach (IResourceLocator resourceLocator in Addressables.ResourceLocators) { foreach (object key in resourceLocator.Keys) { if (!(key is string text) || !text.StartsWith("RoR2/", StringComparison.OrdinalIgnoreCase) || !text.EndsWith(".asset", StringComparison.OrdinalIgnoreCase) || !scannedOfficialItemKeys.Add(text)) { continue; } IList<IResourceLocation> list = Addressables.LoadResourceLocationsAsync((object)text, typeof(ItemDef)).WaitForCompletion(); if (list != null && list.Count != 0) { ItemDef val = Addressables.LoadAssetAsync<ItemDef>(list[0]).WaitForCompletion(); if (!((Object)(object)val == (Object)null)) { CacheOfficialItemAliases(val, text); } } } } } private static void CacheOfficialItemAliases(ItemDef _itemDef, string _path) { if (!((Object)(object)_itemDef == (Object)null)) { AddOfficialItemAlias(((Object)_itemDef).name, _itemDef); AddOfficialItemAlias(_itemDef.nameToken, _itemDef); AddOfficialItemAlias(_path, _itemDef); string text = Language.GetString(_itemDef.nameToken); if (!string.IsNullOrWhiteSpace(text) && !string.Equals(text, _itemDef.nameToken, StringComparison.Ordinal)) { AddOfficialItemAlias(text, _itemDef); } } } private static void AddOfficialItemAlias(string _alias, ItemDef _itemDef) { if (!string.IsNullOrWhiteSpace(_alias) && !((Object)(object)_itemDef == (Object)null)) { _alias = _alias.Trim(); if (!officialItemLookup.ContainsKey(_alias)) { officialItemLookup.Add(_alias, _itemDef); } } } public static Sprite GetIcon(string _name) { string text = _name + ".png"; string text2 = FindAsset(text); if (text2 == null) { if (Utils.verboseConsole) { Log.Error("Requested asset '" + text + "' could not be found."); } _name = _name.ToLower(); return assetBundle.LoadAsset<Sprite>(_name.Contains("buff") ? FindAsset("texbufftemporalcube") : (_name.Contains("consumed") ? FindAsset("textemporalcubeconsumedicon") : FindAsset("textemporalcubeicon"))); } return assetBundle.LoadAsset<Sprite>(text2); } public static GameObject GetCrosshair(string _crosshairName) { GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + _crosshairName + "Crosshair"); if ((Object)(object)val == (Object)null) { Log.Error("Crosshair '" + _crosshairName + "' could not be found - defaulting to standard crosshair."); return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair"); } return val; } public static GameObject GetObject(string _name, string _default = null) { string text = _name + ".prefab"; string text2 = FindAsset(text); if (text2 == null) { if (Utils.verboseConsole) { Log.Error("Requested asset '" + text + "' could not be found."); } if (_default != null) { return assetBundle.LoadAsset<GameObject>(_default); } return null; } return assetBundle.LoadAsset<GameObject>(text2); } public static Mesh GetMesh(string _name, string _default = null) { string text = _name + ".prefab"; string text2 = FindAsset(text); GameObject val = null; if (text2 == null) { if (Utils.verboseConsole) { Log.Error("Requested asset '" + text + "' could not be found."); } if (_default != null) { val = assetBundle.LoadAsset<GameObject>(_default); } } else { val = assetBundle.LoadAsset<GameObject>(text2); } if ((Object)(object)val == (Object)null) { return null; } MeshFilter component = val.GetComponent<MeshFilter>(); if ((Object)(object)component == (Object)null) { Log.Error("[ASSETS] | Unable to get mesh for asset '" + text + "' - Mesh filter component not found!"); return null; } return component.sharedMesh; } public static GameObject GetModel(string _name) { return GetObject(_name, "temporalcubemesh"); } public static Texture GetTexture(string _name) { string text = _name + ".png"; string text2 = FindAsset(text); if (text2 == null) { Log.Error("Requested asset '" + text + "' could not be found."); return null; } return assetBundle.LoadAsset<Texture>(text2); } public static Sprite GetSprite(string _name) { string text = _name + ".png"; string text2 = FindAsset(text); if (text2 == null) { Log.Error("Requested asset '" + text + "' could not be found."); return null; } return assetBundle.LoadAsset<Sprite>(text2); } public static Material GetMaterial(string _name) { string text = _name + ".mat"; string text2 = FindAsset(text); if (text2 == null) { Log.Error("Requested asset '" + text + "' could not be found."); return null; } return assetBundle.LoadAsset<Material>(text2); } public static Shader GetShader(string _name) { string text = _name + ".shader"; string text2 = FindAsset(text); if (text2 == null) { Log.Error("Requested asset '" + text + "' could not be found."); return null; } return assetBundle.LoadAsset<Shader>(text2); } public static Material GetShrineSymbolMaterial(Texture _texture, Color _colour) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(chanceShrineSymbolMaterial); val.SetTexture("_MainTex", _texture); val.SetColor("_TintColor", _colour); return val; } public static GameObject GetClonedDopplegangerMaster(GameObject _bodyPrefab, string _masterName, string _masterToCopy) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/" + _masterToCopy + "MonsterMaster"), _masterName, true); val.GetComponent<CharacterMaster>().bodyPrefab = _bodyPrefab; ContentAddition.AddMaster(val); return val; } } internal class FaithfulHermitsShawlBehaviour : MonoBehaviour, ICharacterBehaviour { public CharacterBody character; private Item m_hermitsShawlItem; private Buff patienceBuff; private int itemCount = -1; private bool ooc = false; private bool forcedInCombat = false; private int maxBuffs; private int maxBuffsStacking; private float buffCooldown; private Item hermitsShawlItem { get { if (m_hermitsShawlItem == null) { m_hermitsShawlItem = Items.GetItem("HERMITS_SHAWL"); } return m_hermitsShawlItem; } } private int currentMaxBuffs => Utils.CalculateStackingValue(itemCount, maxBuffs, maxBuffsStacking); private float currentBuffCooldown { get { int num = currentMaxBuffs; return buffCooldown / (float)((num <= 1) ? 1 : (num - 1)); } } public FaithfulHermitsShawlBehaviour() { Utils.RegisterCharacterBehaviour(this); } public void Init(CharacterBody _character) { character = _character; patienceBuff = Buffs.GetBuff("PATIENCE"); FetchSettings(); Inventory inventory = character.inventory; if ((Object)(object)inventory != (Object)null) { UpdateItemCount(inventory.GetItemCountEffective(hermitsShawlItem.itemDef)); } character.UpdateAllTemporaryVisualEffects(); } public void FetchSettings() { if (hermitsShawlItem != null) { maxBuffsStacking = hermitsShawlItem.FetchSetting<int>("MAX_BUFFS_STACKING").Value; maxBuffs = hermitsShawlItem.FetchSetting<int>("MAX_BUFFS").Value; buffCooldown = hermitsShawlItem.FetchSetting<float>("BUFF_RECHARGE").Value; } } private void OnDestroy() { Utils.UnregisterCharacterBehaviour(this); } public void OnInventoryChanged(Inventory _inventory) { int itemCountEffective = _inventory.GetItemCountEffective(hermitsShawlItem.itemDef); UpdateItemCount(itemCountEffective); } public void OnCharacterBodyFixedUpdate() { if (!((Object)(object)character == (Object)null) && Utils.hosting && itemCount >= 1) { UpdateOutOfCombat(); } } private void UpdateOutOfCombat() { bool flag = character.outOfCombat && !forcedInCombat; if (flag == ooc) { return; } ooc = flag; if (ooc) { int buffCount = character.GetBuffCount(patienceBuff.buffDef); if (buffCount < currentMaxBuffs) { character.AddBuff(patienceBuff.buffDef); } ((MonoBehaviour)this).Invoke("DelayedBuff", currentBuffCooldown); } } public void ForceIntoCombat() { ((MonoBehaviour)this).CancelInvoke("AllowOutOfCombat"); forcedInCombat = true; ((MonoBehaviour)this).Invoke("AllowOutOfCombat", 5f); } private void AllowOutOfCombat() { forcedInCombat = false; } private void DelayedBuff() { if (ooc) { int buffCount = character.GetBuffCount(patienceBuff.buffDef); if (buffCount < currentMaxBuffs) { character.AddBuff(patienceBuff.buffDef); } ((MonoBehaviour)this).Invoke("DelayedBuff", currentBuffCooldown); } } private void UpdateItemCount(int _newCount) { if (_newCount != itemCount) { itemCount = _newCount; } } } internal class FaithfulLeadersPennonBehaviour : MonoBehaviour, ICharacterBehaviour { public CharacterBody character; private TemporaryVisualEffect visualEffect; private int count = 0; private bool enableRadiusIndicator; private float baseRadius; private float radiusStacking; private FaithfulRadiusIndicatorBehaviour radiusIndicator; public FaithfulLeadersPennonBehaviour() { Utils.RegisterCharacterBehaviour(this); } public void Init(CharacterBody _character) { character = _character; FetchSettings(); Inventory inventory = character.inventory; if ((Object)(object)inventory != (Object)null) { UpdateItemCount(inventory.GetItemCountEffective(Items.GetItem("LEADERS_PENNON").itemDef)); } character.UpdateAllTemporaryVisualEffects(); } public void FetchSettings() { Item item = Items.GetItem("LEADERS_PENNON"); enableRadiusIndicator = item.FetchSetting<bool>("ENABLE_RADIUS_INDICATOR").Value; baseRadius = item.FetchSetting<float>("RADIUS").Value; radiusStacking = item.FetchSetting<float>("RADIUS_STACKING").Value; } private void OnDestroy() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) Utils.UnregisterCharacterBehaviour(this); if ((Object)(object)radiusIndicator != (Object)null) { Object.Destroy((Object)(object)((Component)radiusIndicator).gameObject); } if ((Object)(object)visualEffect != (Object)null) { visualEffect.visualState = (VisualState)1; } } public void OnInventoryChanged(Inventory _inventory) { int itemCountEffective = _inventory.GetItemCountEffective(Items.GetItem("LEADERS_PENNON").itemDef); UpdateItemCount(itemCountEffective); } protected void UpdateItemCount(int _newCount) { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (_newCount == count) { return; } count = _newCount; if (!enableRadiusIndicator) { return; } if ((Object)(object)radiusIndicator != (Object)null) { if (count == 0) { Object.Destroy((Object)(object)((Component)radiusIndicator).gameObject); return; } float targetSize = Utils.CalculateStackingValue(count, baseRadius, radiusStacking); radiusIndicator.SetTargetSize(targetSize); } else { float startingTargetSize = Utils.CalculateStackingValue(count, baseRadius, radiusStacking); radiusIndicator = Utils.CreateRadiusIndicator(character, 0f, startingTargetSize, new Color(0.5803921f, 0.22745098f, 61f / 85f)); } } public void UpdateVisualEffect(bool _active) { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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) if ((Object)(object)Assets.pennonEffectPrefab == (Object)null) { return; } if (_active) { if (!((Object)(object)visualEffect != (Object)null)) { GameObject val = Object.Instantiate<GameObject>(Assets.pennonEffectPrefab, character.corePosition, Quaternion.identity); visualEffect = val.GetComponent<TemporaryVisualEffect>(); visualEffect.parentTransform = character.coreTransform; visualEffect.visualState = (VisualState)0; visualEffect.healthComponent = character.healthComponent; visualEffect.radius = character.radius; LocalCameraEffect component = val.GetComponent<LocalCameraEffect>(); if (Object.op_Implicit((Object)(object)component)) { component.targetCharacter = ((Component)this).gameObject; } } } else if (!((Object)(object)visualEffect == (Object)null)) { visualEffect.visualState = (VisualState)1; } } } internal class FaithfulLongshotGeodeBehaviour : MonoBehaviour, ICharacterBehaviour { public CharacterBody character; private bool enableRadiusIndicator; private float effectRadius; private QualityValues<float> qualityRadiuses = new QualityValues<float>(); private FaithfulRadiusIndicatorBehaviour radiusIndicator; public FaithfulLongshotGeodeBehaviour() { Utils.RegisterCharacterBehaviour(this); } public void Init(CharacterBody _character) { character = _character; FetchSettings(); Inventory inventory = character.inventory; if ((Object)(object)inventory != (Object)null) { UpdateRadiusIndicator(inventory); } } public void FetchSettings() { Item item = Items.GetItem("LONGSHOT_GEODE"); enableRadiusIndicator = item.FetchSetting<bool>("ENABLE_RADIUS_INDICATOR").Value; effectRadius = item.FetchSetting<float>("DISTANCE").Value; if (Utils.qualityEnabled) { qualityRadiuses.UpdateValues(item.FetchQualitySetting<float>("DISTANCE")); } } private void OnDestroy() { Utils.UnregisterCharacterBehaviour(this); if ((Object)(object)radiusIndicator != (Object)null) { Object.Destroy((Object)(object)((Component)radiusIndicator).gameObject); } } public void OnInventoryChanged(Inventory _inventory) { if (enableRadiusIndicator) { UpdateRadiusIndicator(_inventory); } } protected void UpdateRadiusIndicator(Inventory _inventory) { //IL_0155: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_inventory == (Object)null) { return; } Item item = Items.GetItem("LONGSHOT_GEODE"); bool flag = _inventory.GetItemCountEffective(item.itemDef) != 0; float num = effectRadius; if (Utils.qualityEnabled) { QualityCounts itemCountsEffective = QualityCompat.GetItemCountsEffective(_inventory, item); if (itemCountsEffective.LEGENDARY != 0) { num = qualityRadiuses.LEGENDARY; } else if (itemCountsEffective.EPIC != 0) { num = qualityRadiuses.EPIC; } else if (itemCountsEffective.RARE != 0) { num = qualityRadiuses.RARE; } else if (itemCountsEffective.UNCOMMON != 0) { num = qualityRadiuses.UNCOMMON; } } if (!enableRadiusIndicator) { return; } if ((Object)(object)radiusIndicator != (Object)null) { if (!flag) { Object.Destroy((Object)(object)((Component)radiusIndicator).gameObject); } else if (radiusIndicator.targetSize != num) { radiusIndicator.SetTargetSize(num); } } else if (flag) { radiusIndicator = Utils.CreateRadiusIndicator(character, 0f, num, new Color(0.78039217f, 0.14901961f, 43f / 85f)); } } } internal class FaithfulTargetingMatrixBehaviour : NetworkBehaviour, ICharacterBehaviour, IDisplayModelBehaviour { public CharacterBody character; public CharacterBody target; private List<CharacterBody> targets = new List<CharacterBody>(); private Dictionary<CharacterBody, float> targetOutOfRangeTimers = new Dictionary<CharacterBody, float>(); private TemporaryVisualEffect visualEffect; private CharacterBody visualEffectTargeter; private Vector3 displayPos; private Vector3 displayTargetingMovement = new Vector3(-0.0135f, 0f, 0f); private Vector3 lensMovement = new Vector3(0f, 0.00675f, 0f); private float displayOpen = 0f; private float displaySpeed = 4f; private bool targeting = false; private GameObject m_displayMesh; private GameObject m_display; private GameObject m_clockwiseLens; private GameObject m_antiClockwiseLens; private Transform m_modelTransform; private Vector3 clockwiseLensScale; private Vector3 antiClockwiseLensScale; private Vector3 clockwiseLensPos; private Vector3 antiClockwiseLensPos; private bool enableTargetEffect; private bool targetEffectGlobal; private float maxDistance; private float outOfRangeTime; private string[] blacklisted = new string[2] { "AffixEarthHealerBody", "ArtifactShellBody" }; private BodyIndex[] blacklistedIndexes; private string[] blacklistedBuffs = new string[3] { "bdBrotherThroneShield", "bdHiddenInvincibility", "bdHiddenRejectAllDamage" }; private BuffIndex[] blacklistedBuffIndexes; private static int kCmdCmdSyncTarget; private static int kRpcRpcSyncTargets; private bool HasAnyTarget { get { UpdatePrimaryTarget(); return (Object)(object)target != (Object)null; } } private GameObject displayMesh { get { if ((Object)(object)modelTransform == (Object)null) { return null; } if ((Object)(object)m_displayMesh == (Object)null) { m_displayMesh = Utils.FindChildByName(modelTransform, "TargetingMatrixDisplayMesh(Clone)"); } return m_displayMesh; } } private GameObject display { get { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)displayMesh == (Object)null) { return null; } if ((Object)(object)m_display == (Object)null) { m_display = Utils.FindChildByName(displayMesh.transform, "Display"); displayPos = m_display.transform.localPosition; } return m_display; } } private GameObject clockwiseLens { get { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)displayMesh == (Object)null) { return null; } if ((Object)(object)m_clockwiseLens == (Object)null) { m_clockwiseLens = Utils.FindChildByName(displayMesh.transform, "Lens_Clock"); clockwiseLensScale = m_clockwiseLens.transform.localScale; clockwiseLensPos = m_clockwiseLens.transform.localPosition; } return m_clockwiseLens; } } private GameObject antiClockwiseLens { get { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)displayMesh == (Object)null) { return null; } if ((Object)(object)m_antiClockwiseLens == (Object)null) { m_antiClockwiseLens = Utils.FindChildByName(displayMesh.transform, "Lens_Anti"); antiClockwiseLensScale = m_antiClockwiseLens.transform.localScale; antiClockwiseLensPos = m_antiClockwiseLens.transform.localPosition; } return m_antiClockwiseLens; } } private Transform modelTransform { get { if ((Object)(object)m_modelTransform == (Object)null) { CharacterBody obj = character; object obj2; if (obj == null) { obj2 = null; } else { ModelLocator modelLocator = obj.modelLocator; obj2 = ((modelLocator != null) ? modelLocator.modelTransform : null); } m_modelTransform = (Transform)obj2; } return m_modelTransform; } } public string relatedItemToken => "TARGETING_MATRIX"; public FaithfulTargetingMatrixBehaviour() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Utils.RegisterCharacterBehaviour(this); } public void Init(CharacterBody _character) { character = _character; FetchBlacklistedIndexes(); FetchSettings(); if ((Object)(object)modelTransform != (Object)null) { DisplayModelBehaviourRelay displayModelBehaviourRelay = ((Component)modelTransform).gameObject.AddComponent<DisplayModelBehaviourRelay>(); displayModelBehaviourRelay.Init(this); } UpdateDisplayObject(); } private void FetchBlacklistedIndexes() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 //IL_0072: Unknown result type (might be due to invalid IL or missing references) List<BodyIndex> list = new List<BodyIndex>(); string[] array = blacklisted; foreach (string text in array) { list.Add(BodyCatalog.FindBodyIndex(text)); } blacklistedIndexes = list.ToArray(); List<BuffIndex> list2 = new List<BuffIndex>(); string[] array2 = blacklistedBuffs; foreach (string text2 in array2) { BuffIndex val = BuffCatalog.FindBuffIndex(text2); if ((int)val != -1) { list2.Add(val); } } blacklistedBuffIndexes = list2.ToArray(); } private bool HasBlacklistedBuff(CharacterBody _character) { //IL_0010: 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) BuffIndex[] array = blacklistedBuffIndexes; foreach (BuffIndex val in array) { if (_character.HasBuff(val)) { return true; } } return false; } public void FetchSettings() { Item item = Items.GetItem("TARGETING_MATRIX"); enableTargetEffect = item.FetchSetting<bool>("ENABLE_TARGET_EFFECT").Value; targetEffectGlobal = item.FetchSetting<bool>("TARGET_EFFECT_GLOBAL").Value; maxDistance = item.FetchSetting<float>("MAX_DISTANCE").Value; outOfRangeTime = item.FetchSetting<float>("OUT_OF_RANGE_TIME").Value; } private void FixedUpdate() { //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) FaithfulRuntimeProfiler.StartScope("FaithfulTargetingMatrixBehaviour.FixedUpdate"); try { if (targeting && !HasAnyTarget) { targeting = false; ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(CloseDisplay()); } if (!targeting && HasAnyTarget) { targeting = true; ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(OpenDisplay()); } if (!Utils.hosting || !HasAnyTarget) { return; } int num = 0; for (int num2 = targets.Count - 1; num2 >= 0; num2--) { CharacterBody val = targets[num2]; if ((Object)(object)val == (Object)null || (Object)(object)val.healthComponent == (Object)null || !val.healthComponent.alive) { RemoveTarget(val, _sync: false); num++; } else { Vector3 corePosition = val.corePosition; if (Vector3.Distance(corePosition, character.corePosition) > maxDistance) { targetOutOfRangeTimers[val] = (targetOutOfRangeTimers.TryGetValue(val, out var value) ? (value + Time.fixedDeltaTime) : Time.fixedDeltaTime); } else { targetOutOfRangeTimers[val] = 0f; } if (targetOutOfRangeTimers.TryGetValue(val, out var value2) && value2 > outOfRangeTime) { RemoveTarget(val, _sync: false); num++; } } } if (num > 0) { CallCmdSyncTarget(); SearchForTarget(num); } } finally { FaithfulRuntimeProfiler.StopScope("FaithfulTargetingMatrixBehaviour.FixedUpdate"); } } private void UpdateDisplayObject() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)display == (Object)null)) { display.transform.localPosition = displayPos + displayTargetingMovement * (1f - displayOpen); clockwiseLens.transform.localPosition = clockwiseLensPos + lensMovement * (1f - displayOpen); antiClockwiseLens.transform.localPosition = antiClockwiseLensPos + lensMovement * (1f - displayOpen); clockwiseLens.transform.localScale = clockwiseLensScale * displayOpen; antiClockwiseLens.transform.localScale = antiClockwiseLensScale * displayOpen; } } private IEnumerator OpenDisplay() { while (displayOpen < 1f) { displayOpen = Mathf.Clamp01(displayOpen + Time.deltaTime * displaySpeed); UpdateDisplayObject(); yield return null; } } private IEnumerator CloseDisplay() { while (displayOpen > 0f) { displayOpen = Mathf.Clamp01(displayOpen - Time.deltaTime * displaySpeed); UpdateDisplayObject(); yield return null; } } private void OnDestroy() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) Utils.UnregisterCharacterBehaviour(this); RemoveTarget(_sync: false); if ((Object)(object)visualEffect != (Object)null) { visualEffect.visualState = (VisualState)1; } } public void OnKill(CharacterBody _killed) { if (HasTarget(_killed)) { RemoveTarget(_killed); } ((MonoBehaviour)this).Invoke("SearchForTargetForKill", 0.1f); } private void SearchForTargetForKill() { if (!((Object)(object)character == (Object)null) && !((Object)(object)character.inventory == (Object)null)) { int maxTargetsToAdd = ((Faithful.targetingMatrix != null) ? Faithful.targetingMatrix.GetTargetsPerKill(character.inventory) : 0); SearchForTarget(maxTargetsToAdd); } } private void SearchForTarget(int _maxTargetsToAdd) { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) if (!Utils.hosting || (Object)(object)character == (Object)null || (Object)(object)character.inventory == (Object)null) { return; } int num = ((Faithful.targetingMatrix != null) ? Faithful.targetingMatrix.GetTargetCapacity(character.inventory) : 0); if (num <= 0) { RemoveTarget(); return; } if (TrimTargetsToCapacity(num)) { CallCmdSyncTarget(); } if (targets.Count >= num || _maxTargetsToAdd <= 0) { return; } int num2 = ((_maxTargetsToAdd == int.MaxValue) ? num : Mathf.Min(num, targets.Count + _maxTargetsToAdd)); ReadOnlyCollection<CharacterBody> readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return; } List<CharacterBody> list = new List<CharacterBody>(); Vector3 corePosition = character.corePosition; foreach (CharacterBody item in readOnlyInstancesList) { if (!HasTarget(item) && item.teamComponent.teamIndex != character.teamComponent.teamIndex && !((Object)(object)item.master == (Object)null) && !((Object)(object)item.healthComponent == (Object)null) && item.healthComponent.alive) { float num3 = Vector3.Distance(corePosition, item.corePosition); if (!(num3 > maxDistance) && !blacklistedIndexes.Contains(item.bodyIndex) && !HasBlacklistedBuff(item)) { list.Add(item); } } } bool flag = false; while (list.Count > 0 && targets.Count < num2) { CharacterBody val = list[Random.Range(0, list.Count)]; list.Remove(val); FaithfulCharacterBodyBehaviour faithfulCharacterBodyBehaviour = Utils.FindCharacterBodyHelper(val); if (!((Object)(object)faithfulCharacterBodyBehaviour == (Object)null)) { FaithfulTargetingMatrixBehaviour targetingMatrix = faithfulCharacterBodyBehaviour.targetingMatrix; if (!((Object)(object)targetingMatrix == (Object)null)) { AddTarget(val, targetingMatrix); flag = true; } } } if (flag) { CallCmdSyncTarget(); } } public void RemoveTarget(bool _sync = true) { if (!HasAnyTarget) { return; } List<CharacterBody> list = targets.ToList(); foreach (CharacterBody item in list) { RemoveTarget(item, _sync: false); } targets.Clear(); targetOutOfRangeTimers.Clear(); target = null; if (_sync && Utils.hosting) { CallCmdSyncTarget(); } } public bool RemoveTarget(CharacterBody _target, bool _sync = true) { if ((Object)(object)_target == (Object)null) { bool result = targets.RemoveAll((CharacterBody targetBody) => (Object)(object)targetBody == (Object)null) > 0; UpdatePrimaryTarget(); return result; } if (!targets.Contains(_target)) { return false; } FaithfulCharacterBodyBehaviour faithfulCharacterBodyBehaviour = Utils.FindCharacterBodyHelper(_target); (((Object)(object)faithfulCharacterBodyBehaviour == (Object)null) ? null : faithfulCharacterBodyBehaviour.targetingMatrix)?.SetNotTargeted(character); targets.Remove(_target); targetOutOfRangeTimers.Remove(_target); UpdatePrimaryTarget(); if (_sync && Utils.hosting) { CallCmdSyncTarget(); } return true; } public void RefreshTargetCapacity() { if (Utils.hosting && !((Object)(object)character == (Object)null) && !((Object)(object)character.inventory == (Object)null)) { int num = ((Faithful.targetingMatrix != null) ? Faithful.targetingMatrix.GetTargetCapacity(character.inventory) : 0); if (num <= 0) { RemoveTarget(); } else if (TrimTargetsToCapacity(num)) { CallCmdSyncTarget(); } } } public bool HasTarget(CharacterBody _target) { if ((Object)(object)_target == (Object)null) { return false; } return targets.Contains(_target); } private void AddTarget(CharacterBody _target, FaithfulTargetingMatrixBehaviour _targetTargetingMatrixBehaviour) { if (!((Object)(object)_target == (Object)null) && !HasTarget(_target)) { targets.Add(_target); targetOutOfRangeTimers[_target] = 0f; UpdatePrimaryTarget(); _targetTargetingMatrixBehaviour?.SetTargeted(character); } } private void UpdatePrimaryTarget() { targets.RemoveAll((CharacterBody targetBody) => (Object)(object)targetBody == (Object)null); target = ((targets.Count > 0) ? targets[0] : null); } private bool TrimTargetsToCapacity(int _targetCapacity) { bool result = false; while (targets.Count > _targetCapacity) { RemoveTarget(targets[targets.Count - 1], _sync: false); result = true; } return result; } public void SetTargeted(CharacterBody _targeter) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_targeter == (Object)null) && !((Object)(object)Utils.localPlayerBody != (Object)(object)_targeter) && !((Object)(object)visualEffect != (Object)null) && enableTargetEffect) { GameObject val = Object.Instantiate<GameObject>(targetEffectGlobal ? Assets.matrixEffectPrefab : Assets.matrixEffectLocalPrefab, character.corePosition, Quaternion.identity); visualEffect = val.GetComponent<TemporaryVisualEffect>(); visualEffect.parentTransform = character.coreTransform; visualEffect.visualState = (VisualState)0; visualEffect.healthComponent = character.healthComponent; visualEffect.radius = character.radius; visualEffectTargeter = _targeter; LocalCameraEffect component = val.GetComponent<LocalCameraEffect>(); if (Object.op_Implicit((Object)(object)component)) { component.targetCharacter = ((Component)this).gameObject; } } } public void SetNotTargeted(CharacterBody _targeter) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)visualEffectTargeter != (Object)(object)_targeter)) { if ((Object)(object)visualEffect != (Object)null) { visualEffect.visualState = (VisualState)1; } visualEffect = null; visualEffectTargeter = null; } } [Command] public void CmdSyncTarget() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) List<NetworkInstanceId> list = new List<NetworkInstanceId>(); foreach (CharacterBody target in targets) { if (!((Object)(object)target == (Object)null)) { NetworkIdentity component = ((Component)target).GetComponent<NetworkIdentity>(); if (!((Object)(object)component == (Object)null)) { list.Add(component.netId); } } } CallRpcSyncTargets(list.ToArray()); } [ClientRpc] private void RpcSyncTargets(NetworkInstanceId[] _targetNetIDs) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) if (Utils.hosting) { return; } List<CharacterBody> list = targets.ToList(); foreach (CharacterBody item in list) { NetworkIdentity val = (((Object)(object)item == (Object)null) ? null : ((Component)item).GetComponent<NetworkIdentity>()); if ((Object)(object)val == (Object)null || !_targetNetIDs.Contains(val.netId)) { RemoveTarget(item, _sync: false); } } foreach (NetworkInstanceId val2 in _targetNetIDs) { GameObject obj = ClientScene.FindLocalObject(val2); CharacterBody val3 = ((obj != null) ? obj.GetComponent<CharacterBody>() : null); if ((Object)(object)val3 == (Object)null) { Log.Warning($"[TARGETING MATRIX] | Could not find target body with net ID {val2} - Sync unsuccessful."); } else { if (HasTarget(val3)) { continue; } FaithfulCharacterBodyBehaviour faithfulCharacterBodyBehaviour = Utils.FindCharacterBodyHelper(val3); if (!((Object)(object)faithfulCharacterBodyBehaviour == (Object)null)) { FaithfulTargetingMatrixBehaviour targetingMatrix = faithfulCharacterBodyBehaviour.targetingMatrix; if (!((Object)(object)targetingMatrix == (Object)null)) { AddTarget(val3, targetingMatrix); } } } } } public void OnDisplayModelCreated() { UpdateDisplayObject(); } private void UNetVersion() { } protected static void InvokeCmdCmdSyncTarget(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) { Debug.LogError((object)"Command CmdSyncTarget called on client."); } else { ((FaithfulTargetingMatrixBehaviour)(object)obj).CmdSyncTarget(); } } public void CallCmdSyncTarget() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active) { Debug.LogError((object)"Command function CmdSyncTarget called on server."); return; } if (((NetworkBehaviour)this).isServer) { CmdSyncTarget(); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)5); val.WritePackedUInt32((uint)kCmdCmdSyncTarget); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdSyncTarget"); } protected static void InvokeRpcRpcSyncTargets(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcSyncTargets called on server."); } else { ((FaithfulTargetingMatrixBehaviour)(object)obj).RpcSyncTargets(GeneratedNetworkCode._ReadArrayNetworkInstanceId_None(reader)); } } public void CallRpcSyncTargets(NetworkInstanceId[] _targetNetIDs) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcSyncTargets called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcSyncTargets); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); GeneratedNetworkCode._WriteArrayNetworkInstanceId_None(val, _targetNetIDs); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcSyncTargets"); } static FaithfulTargetingMatrixBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown kCmdCmdSyncTarget = -1894886286; NetworkBehaviour.RegisterCommandDelegate(typeof(FaithfulTargetingMatrixBehaviour), kCmdCmdSyncTarget, new CmdDelegate(InvokeCmdCmdSyncTarget)); kRpcRpcSyncTargets = -410356565; NetworkBehaviour.RegisterRpcDelegate(typeof(FaithfulTargetingMatrixBehaviour), kRpcRpcSyncTargets, new CmdDelegate(InvokeRpcRpcSyncTargets)); NetworkCRC.RegisterBehaviour("FaithfulTargetingMatrixBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } internal class FaithfulTJetpackBehaviour : NetworkBehaviour, ICharacterBehaviour { public CharacterBody character; protected Buff emptyFuelBuff; protected Buff lowFuelBuff; protected Buff highFuelBuff; protected int currentFuelBuffPerc; [SyncVar] private bool fuelBuffUsesDisplayValue; protected bool active = false; protected int itemCount = 0; protected int buffedItemCount = 5; protected float baseMaxVelocity = 42f; protected float baseRisingAcceleration = 36f; protected float fallingAcceleration = 320f; protected float baseFuel = 4f; protected float fuelPerStack = 2f; protected float baseRefuelDuration = 12f; protected float refuelDurationReductionPerStack = 0.2f; protected float maxVelocityMultiplier = 1f; protected float accelerationMultiplier = 1f; protected float maxVelocityBuff = 10f; protected float risingAccelerationBuff = 8f; protected bool grounded = false; protected bool jetActivated = false; protected bool firstJet = true; protected bool refueling = false; protected float fuelUsed = 0f; protected float lastJetTime; protected bool hasSyncedJetpack = false; protected JetpackSyncData lastSyncedJetpack; protected float lastJetpackSyncTime; protected const float jetpackSyncRefreshInterval = 1f; protected bool hasDisplay = false; protected bool ignoreFallDamage = false; protected GameObject jetpack; protected GameObject additionalBoosters; protected GameObject dial; protected GameObject jetMiddle; protected GameObject jetLeft; protected GameObject jetRight; protected GameObject jetsOn; protected GameObject jetsOff; protected bool initialised = false; protected static readonly float igniteRange; protected static readonly float igniteAngle; protected static readonly float baseIgniteDuration; protected static readonly float directDamageFraction; protected static readonly float burnDamageFraction; protected static readonly float igniteDurationIncreaseFraction; protected bool hasDoneInitialIgnite = false; protected float igniteStopwatch = 0f; private static int kCmdCmdSyncJetpack; private static int kRpcRpcSyncJetpack; protected float fuelCapacity => Utils.CalculateStackingValue(itemCount, baseFuel, fuelPerStack); protected float fuelRemaining => fuelCapacity - fuelUsed; protected float fuelRemainingPerc => 1f - fuelUsed / fuelCapacity; protected float refuelDuration => baseRefuelDuration * Mathf.Max(0.1f, 1f - Mathf.Log((float)itemCount, Mathf.Pow(2f, 1f / refuelDurationReductionPerStack))); protected float refuelRate => fuelCapacity / refuelDuration; protected float timeSinceLastJet => Time.time - lastJetTime; protected float dynamicAccelerationDifference => fallingAcceleration - risingAcceleration; protected bool canBeActivated => character.characterMotor.velocity.y < 0f && fuelRemaining > 0f; protected float buffPerc { get { int num = itemCount - 1; int num2 = buffedItemCount - 1; return Mathf.Min((float)num / (float)num2, 1f); } } protected float maxVelocity => (baseMaxVelocity + maxVelocityBuff * buffPerc) * jumpPowerModifier * maxVelocityMultiplier; protected float risingAcceleration => baseRisingAcceleration + risingAccelerationBuff * buffPerc; protected float jumpPowerModifier => Mathf.Sqrt(character.jumpPower / character.baseJumpPower); public bool NetworkfuelBuffUsesDisplayValue { get { return fuelBuffUsesDisplayValue; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<bool>(value, ref fuelBuffUsesDisplayValue, 1u); } } public FaithfulTJetpackBehaviour() { Utils.RegisterCharacterBehaviour(this); } public void AssignCharacter(CharacterBody _character) { character = _character; } protected void Init(CharacterBody _characterBody) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_0454: Unknown result type (might be due to invalid IL or missing references) if (initialised && ((Object)(object)jetpack != (Object)null || !hasDisplay)) { return; } initialised = true; FetchSettings(); emptyFuelBuff = Buffs.GetBuff("4T0N_JETPACK_EMPTY"); lowFuelBuff = Buffs.GetBuff("4T0N_JETPACK_LOW"); highFuelBuff = Buffs.GetBuff("4T0N_JETPACK_HIGH"); Transform modelTransform = _characterBody.modelLocator.modelTransform; jetpack = Utils.FindChildByName(modelTransform, "4T0NJetpackDisplayMesh(Clone)"); if ((Object)(object)jetpack == (Object)null) { hasDisplay = false; additionalBoosters = null; dial = null; jetMiddle = null; jetLeft = null; jetRight = null; jetsOff = null; jetsOn = new GameObject("JetsOn"); jetsOn.transform.SetParent(modelTransform, false); GameObject val = Object.Instantiate<GameObject>(Assets.mageJetAkEventsPrefab); val.transform.SetParent(jetsOn.transform, false); val.SetActive(true); return; } hasDisplay = true; additionalBoosters = Utils.FindChildByName(jetpack.transform, "Pack"); dial = Utils.FindChildByName(jetpack.transform, "Dial"); jetMiddle = Utils.FindChildByName(jetpack.transform, "Jet_Middle"); jetLeft = Utils.FindChildByName(jetpack.transform, "Jet_Left"); jetRight = Utils.FindChildByName(jetpack.transform, "Jet_Right"); ((Component)jetpack.GetComponent<Transform>().Find("4-T0N_Jetpack_Jetflare_Display")).gameObject.AddComponent<TJetpackJetFlare>(); jetsOn = ((Component)jetpack.GetComponent<Transform>().Find("Jets_On")).gameObject; jetsOff = ((Component)jetpack.GetComponent<Transform>().Find("Jets_Off")).gameObject; jetsOn.SetActive(false); GameObject val2 = Object.Instantiate<GameObject>(Assets.mageJetAkEventsPrefab); val2.transform.SetParent(jetsOn.transform, false); val2.SetActive(true); FlickerLight val3 = ((Component)jetsOn.GetComponent<Transform>().Find("Point_Light_Middle")).gameObject.AddComponent<FlickerLight>(); FlickerLight val4 = ((Component)jetsOn.GetComponent<Transform>().Find("Point_Light_Left")).gameObject.AddComponent<FlickerLight>(); FlickerLight val5 = ((Component)jetsOn.GetComponent<Transform>().Find("Point_Light_Right")).gameObject.AddComponent<FlickerLight>(); val3.light = ((Component)jetsOn.GetComponent<Transform>().Find("Point_Light_Middle")).GetComponent<Light>(); val3.sinWaves = Assets.mageJetWaves; val4.light = ((Component)jetsOn.GetComponent<Transform>().Find("Point_Light_Left")).GetComponent<Light>(); val4.sinWaves = Assets.mageJetWaves; val5.light = ((Component)jetsOn.GetComponent<Transform>().Find("Point_Light_Right")).GetComponent<Light>(); val5.sinWaves = Assets.mageJetWaves; FlickerLight val6 = ((Component)jetsOff.GetComponent<Transform>().Find("Point_Light_Middle")).gameObject.AddComponent<FlickerLight>(); FlickerLight val7 = ((Component)jetsOff.GetComponent<Transform>().Find("Point_Light_Left")).gameObject.AddComponent<FlickerLight>(); FlickerLight val8 = ((Component)jetsOff.GetComponent<Transform>().Find("Point_Light_Right")).gameObject.AddComponent<FlickerLight>(); val6.light = ((Component)jetsOff.GetComponent<Transform>().Find("Point_Light_Middle")).GetComponent<Light>(); val6.sinWaves = Assets.mageJetWaves; val7.light = ((Component)jetsOff.GetComponent<Transform>().Find("Point_Light_Left")).GetComponent<Light>(); val7.sinWaves = Assets.mageJetWaves; val8.light = ((Component)jetsOff.GetComponent<Transform>().Find("Point_Light_Right")).GetComponent<Light>(); val8.sinWaves = Assets.mageJetWaves; if (((Object)modelTransform).name == "mdlMage" || ((Object)modelTransform).name == "mdlSeeker") { additionalBoosters.transform.localScale = Vector3.zero; } } private void OnDestroy() { Deactivate(); Utils.UnregisterCharacterBehaviour(this); } public void FetchSettings() { Item item = Items.GetItem("4T0N_JETPACK"); ignoreFallDamage = item.FetchSetting<bool>("DISABLE_FALL_DAMAGE").Value; baseFuel = item.FetchSetting<float>("FUEL_TIME").Value; fuelPerStack = item.FetchSetting<float>("FUEL_TIME_STACKING").Value; baseRefuelDuration = item.FetchSetting<float>("RECHARGE_TIME").Value; refuelDurationReductionPerStack = item.FetchSetting<float>("RECHARGE_TIME_REDUCTION").Value / 100f; maxVelocityMultiplier = item.FetchSetting<float>("MAX_VELOCITY_MULTIPLIER").Value; accelerationMultiplier = item.FetchSetting<float>("ACCELERATION_MULTIPLIER").Value; } public void UpdateItemCount(int _itemCount) { itemCount = _itemCount; if (!active && itemCount > 0) { Activate(); } else if (active && itemCount == 0) { Deactivate(); } } protected void Activate() { if (!active && !((Object)(object)character == (Object)null)) { active = true; grounded = false; jetActivated = false; firstJet = true; refueling = false; fuelUsed = 0f; hasSyncedJetpack = false; Behaviour.AddProcessJumpOverrideCallback(character, OnProcessJump); Behaviour.AddCharacterPreFixedUpdateCallback(character, OnFixedUpdate); Behaviour.AddArtificerProcessJumpOverrideCallback(character, OnArtificerProcessJump); Behaviour.AddArtificerJetpackFixedUpdateOverrideCallback(character, SkipArtificerJetpackFixedUpdate); Behaviour.AddFallDamageImmunityCallback(character, IsImmuneToFallDamage); } } protected void Deactivate() { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) if (!active) { return; } active = false; Behaviour.RemoveProcessJumpOverrideCallback(character, OnProcessJump); Behaviour.RemoveCharacterPreFixedUpdateCallback(character, OnFixedUpdate); Behaviour.RemoveArtificerProcessJumpOverrideCallback(character, OnArtificerProcessJump); Behaviour.RemoveArtificerJetpackFixedUpdateOverrideCallback(character, SkipArtificerJetpackFixedUpdate); Behaviour.RemoveFallDamageImmunityCallback(character, IsImmuneToFallDamage); currentFuelBuffPerc = -1; if (Utils.hosting && (Object)(object)character != (Object)null) { if ((Object)(object)emptyFuelBuff?.buffDef != (Object)null) { character.SetBuffCount(emptyFuelBuff.buffDef.buffIndex, 0); } if ((Object)(object)lowFuelBuff?.buffDef != (Object)null) { character.SetBuffCount(lowFuelBuff.buffDef.buffIndex, 0); } if ((Object)(object)highFuelBuff?.buffDef != (Object)null) { character.SetBuffCount(highFuelBuff.buffDef.buffIndex, 0); } } } public void OnFixedUpdate(GenericCharacterMain self) { if (active) { Init(((EntityState)self).characterBody); UpdateVisuals(); UpdateDisplayBuff(); UpdateIgnite(); SyncJetpack(); } } public bool OnArtificerProcessJump(MageCharacterMain self) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown if (!active) { return false; } bool flag = ((object)self.jetpackStateMachine.state).GetType() == typeof(JetpackOn); if (((BaseCharacterMain)self).hasCharacterMotor && ((BaseCharacterMain)self).hasInputBank && ((EntityState)self).isAuthority && (jetActivated || (character.inputBank.jump.down && canBeActivated))) { JetpackBehaviour((GenericCharacterMain)(object)self); if (flag && !jetActivated) { self.jetpackStateMachine.SetNextState((EntityState)new Idle()); } else if (!flag && jetActivated) { self.jetpackStateMachine.SetNextState((EntityState)new JetpackOn()); } return true; } return false; } public bool OnProcessJump(GenericCharacterMain self) { if (!active || !((BaseCharacterMain)self).hasCharacterMotor || !((BaseCharacterMain)self).hasInputBank || !((EntityState)self).isAuthority) { return false; } JetpackBehaviour(self); return jetActivated || (character.inputBank.jump.down && canBeActivated); } public bool IsImmuneToFallDamage(GlobalEventManager _manager, CharacterBody _body) { return active && ignoreFallDamage && jetActivated; } protected void JetpackBehaviour(GenericCharacterMain self) { if (Time.timeScale == 0f) { lastJetTime += Time.fixedDeltaTime; return; } if (((BaseState)self).isGrounded) { Grounded(); } else { MidAir(); } Refuel(); } protected void UpdateVisuals() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_009d: Unknown result type (might be due to invalid IL or missing references) if (hasDisplay) { dial.transform.localEulerAngles = new Vector3(0f, 0f, 360f * fuelRemainingPerc); Vector3 localScale = (jetActivated ? new Vector3(1f, 3.5f, 1f) : new Vector3(1f, 1f, 1f)); jetMiddle.transform.localScale = localScale; jetLeft.transform.localScale = localScale; jetRight.transform.localScale = localScale; jetsOn.SetActive(jetActivated); jetsOff.SetActive(!jetActivated); } else { jetsOn.SetActive(jetActivated); } } protected void UpdateDisplayBuff() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0174: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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) if (!Utils.hosting) { return; } int num = Mathf.CeilToInt(fuelRemainingPerc * 100f); bool buffDisplayValuesAvailable = Behaviour.buffDisplayValuesAvailable; if (num != currentFuelBuffPerc || fuelBuffUsesDisplayValue != buffDisplayValuesAvailable) { NetworkfuelBuffUsesDisplayValue = buffDisplayValuesAvailable; currentFuelBuffPerc = num; if (num == 0) { character.SetBuffCount(emptyFuelBuff.buffDef.buffIndex, 1); character.SetBuffCount(lowFuelBuff.buffDef.buffIndex, 0); character.SetBuffCount(highFuelBuff.buffDef.buffIndex, 0); } else if (num < 26) { character.RemoveBuff(emptyFuelBuff.buffDef.buffIndex); character.SetBuffCount(lowFuelBuff.buffDef.buffIndex, buffDisplayValuesAvailable ? 1 : num); character.SetBuffCount(highFuelBuff.buffDef.buffIndex, 0); } else { character.RemoveBuff(emptyFuelBuff.buffDef.buffIndex); character.SetBuffCount(lowFuelBuff.buffDef.buffIndex, 0); character.SetBuffCount(highFuelBuff.buffDef.buffIndex, buffDisplayValuesAvailable ? 1 : num); } } } public bool SkipArtificerJetpackFixedUpdate(JetpackOn _state) { return active && jetActivated; } protected void Grounded() { if (!grounded) { DeactivateJet(); grounded = true; } } protected void MidAir() { grounded = false; if (jetActivated) { JettingMidAir(); } else if (character.inputBank.jump.down && canBeActivated) { ActivateJet(); Jet(); } } protected void Refuel() { if (jetActivated || !grounded) { refueling = false; } else if (fuelUsed != 0f) { if (refueling) { fuelUsed = Mathf.Max(fuelUsed - refuelRate * Time.fixedDeltaTime, 0f); } else { refueling = true; } } } protected void JettingMidAir() { if (!character.inputBank.jump.down || fuelRemaining == 0f || character.characterMotor.velocity.y > maxVelocity) { DeactivateJet(); } else { Jet(); } } protected void ActivateJet() { if (!jetActivated) { jetActivated = true; firstJet = true; } } protected void DeactivateJet() { if (jetActivated) { jetActivated = false; } } protected void Jet() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) float y = character.characterMotor.velocity.y; float num = (risingAcceleration + Mathf.Clamp01((0f - y + maxVelocity * 0.3f) / 80f) * dynamicAccelerationDifference) * jumpPowerModifier * accelerationMultiplier; character.characterMotor.velocity = new Vector3(character.characterMotor.velocity.x, Mathf.MoveTowards(y, maxVelocity, num * Time.fixedDeltaTime), character.characterMotor.velocity.z); if (firstJet) { firstJet = false; } else { ReduceFuel(); } lastJetTime = Time.time; } protected void ReduceFuel() { fuelUsed = Mathf.Min(fuelUsed + timeSinceLastJet, fuelCapacity); } protected void SyncJetpack() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)character == (Object)(object)Utils.localPlayerBody && (Object)(object)Utils.netUtils != (Object)null && (!hasSyncedJetpack || fuelUsed != lastSyncedJetpack.fuelUsed || jetActivated != lastSyncedJetpack.jetActivated || !(Time.fixedTime - lastJetpackSyncTime < 1f))) { JetpackSyncData data = new JetpackSyncData(fuelUsed, jetActivated); Utils.netUtils.SyncJetpack(((Component)this).GetComponent<NetworkIdentity>().netId, data); lastSyncedJetpack = data; lastJetpackSyncTime = Time.fixedTime; hasSyncedJetpack = true; } } [Command] public void CmdSyncJetpack(JetpackSyncData _data) { CallRpcSyncJetpack(_data); } [ClientRpc] private void RpcSyncJetpack(JetpackSyncData _data) { if (!((Object)(object)character == (Object)(object)Utils.localPlayerBody)) { fuelUsed = _data.fuelUsed; jetActivated = _data.jetActivated; } } protected void UpdateIgnite() { if (!Utils.hosting || itemCount <= 0 || (Object)(object)character == (Object)null || (Object)(object)character.inventory == (Object)null || (Object)(object)character.healthComponent == (Object)null || !character.healthComponent.alive) { igniteStopwatch = 0f; hasDoneInitialIgnite = false; return; } if (!Utils.qualityEnabled) { igniteStopwatch = 0f; hasDoneInitialIgnite = false; return; } if (Faithful.tJetpack == null || !Faithful.tJetpack.MainItem.supportsQuality) { igniteStopwatch = 0f; hasDoneInitialIgnite = false; return; } QualityCounts itemCountsEffective = QualityCompat.GetItemCountsEffective(character.inventory, Faithful.tJetpack.MainItem); if (itemCountsEffective.Total <= 0) { igniteStopwatch = 0f; hasDoneInitialIgnite = false; return; } float num = CalculateIgniteFrequenc