Decompiled source of Sandswept v1.2.5
Sandswept.dll
Decompiled 3 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EmotesAPI; using EntityStates; using EntityStates.Bandit2; using EntityStates.Croco; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Mage.Weapon; using HG; using HG.Reflection; using HarmonyLib; using IL.EntityStates.Drone; using IL.RoR2; using IL.RoR2.Orbs; using IL.RoR2.UI; using JetBrains.Annotations; using KinematicCharacterController; using LookingGlass; using LookingGlass.ItemStatsNameSpace; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MoreStats; using On.EntityStates; using On.EntityStates.Engi.EngiMissilePainter; using On.EntityStates.Mage.Weapon; using On.RoR2; using On.RoR2.Items; using On.RoR2.Orbs; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.EntitlementManagement; using RoR2.EntityLogic; using RoR2.ExpansionManagement; using RoR2.HudOverlay; using RoR2.Navigation; using RoR2.Networking; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using Sandswept.Artifacts; using Sandswept.Buffs; using Sandswept.DoTs; using Sandswept.Drones; using Sandswept.Drones.Inferno; using Sandswept.Drones.Voltaic; using Sandswept.Elites; using Sandswept.Elites.VFX; using Sandswept.Enemies; using Sandswept.Enemies.CannonballJellyfish.SkillDefs; using Sandswept.Enemies.CannonballJellyfish.States; using Sandswept.Enemies.DeltaConstruct; using Sandswept.Enemies.GammaConstruct; using Sandswept.Enemies.SwepSwepTheSandy; using Sandswept.Equipment; using Sandswept.Equipment.Lunar; using Sandswept.Interactables; using Sandswept.Interactables.Regular; using Sandswept.Items; using Sandswept.Items.Greens; using Sandswept.Items.Reds; using Sandswept.Items.VoidGreens; using Sandswept.Items.Whites; using Sandswept.Survivors; using Sandswept.Survivors.Electrician; using Sandswept.Survivors.Electrician.Achievements; using Sandswept.Survivors.Electrician.Hooks; using Sandswept.Survivors.Electrician.Skills; using Sandswept.Survivors.Electrician.States; using Sandswept.Survivors.Electrician.VFX; using Sandswept.Survivors.Megalomaniac.Skills; using Sandswept.Survivors.Megalomaniac.States; using Sandswept.Survivors.Ranger; using Sandswept.Survivors.Ranger.Achievements; using Sandswept.Survivors.Ranger.Crosshairs; using Sandswept.Survivors.Ranger.Hooks; using Sandswept.Survivors.Ranger.Pod; using Sandswept.Survivors.Ranger.Projectiles; using Sandswept.Survivors.Ranger.SkillDefs.Passive; using Sandswept.Survivors.Ranger.SkillDefs.Primary; using Sandswept.Survivors.Ranger.SkillDefs.Secondary; using Sandswept.Survivors.Ranger.SkillDefs.Special; using Sandswept.Survivors.Ranger.SkillDefs.Utility; using Sandswept.Survivors.Ranger.States.Primary; using Sandswept.Survivors.Ranger.States.Secondary; using Sandswept.Survivors.Ranger.States.Special; using Sandswept.Survivors.Ranger.States.Utility; using Sandswept.Survivors.Ranger.VFX; using Sandswept.Survivors.Renegade.Skills; using Sandswept.Survivors.Renegade.States; using Sandswept.Utils; using Sandswept.Utils.Assets; using Sandswept.Utils.Components; using TMPro; using ThreeEyedGames; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.UIElements; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Sandswept")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a40429e216e277886bce92473faa5829665b6eb2")] [assembly: AssemblyProduct("Sandswept")] [assembly: AssemblyTitle("Sandswept")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Sandswept { public static class CursedConfig { [CompilerGenerated] private static class <>O { public static hook_GiveItem_ItemIndex_int <0>__Inventory_GiveItem_ItemIndex_int; public static Action<DamageReport> <1>__GlobalEventManager_onCharacterDeathGlobal; } public static LazyIndex VoltIndex = new LazyIndex("ElectricianBody"); public static void Init() { //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown if (Main.cursedConfig.Value) { LanguageAPI.AddOverlay("ITEM_SANDSWEPT_SMOULDERING_DOCUMENT_NAME", "The Nefarious Smouldering Document"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_AMBER_KNIFE_NAME", "Barrier-focused item mod"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_RED_SPRING_WATER_NAME", "[CHEESE PUFF] spring water"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_CROWNS_DIAMOND_NAME", "Barrier-focused item mod"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_DRIFTING_PERCEPTION_NAME", "hifu when two music references in one item name"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_DRIFTING_PERCEPTION_LORE", "Yeah but I just don't get the point of attaching this to cloak. Cloak is a repositioning utility buff (enemies still 'see' you every couple seconds anyway) that helps you in a quick burst in the short term, whereas this effect just screams \"I hate cloak, it's a damage buff now\". Like whats the point of cloaking on entering combat other than brute forcing this 'synergy' where you incentivize ignoring the original portion of the mechanic.\r\nTake this with a grain of salt though, I am a horribly pessimistic person who is also extremely critical.\r\n\r\nno offense but I really don't understand what you're trying to mean from any of that\r\n\r\ngives you cloak when you need it to efficiently kill enemies\r\nyet in this context this is no different than it giving its own independent crit chance and damage buff; one could argue the movement speed, and yeah sure, but outside of that, the only reason cloak is doing anything for this scenario is because this item is forcing it to instead be a different buff, with a completely different goal.\r\nlets you use it for mobility outside of combat too\r\nyet it only gives you that mobility when entering combat? And on a cooldown at that? it's like if red whip was only active for 5s then went on a 15s cd \r\nplus you get a bonus synergy from it\r\nyet the only general 'synergy' gotten from implementing this, assuming only sandswept / vanilla(sandswept atm doesn't even have any other cloak items to help realize / justify this concept) is that you can deal bonus crit damage while you're more worried about staying alive when hitting 25 % health with stealthkit ?\r\nand it sets up other skills and items for that extra crit\r\nI never complained about the interactions or implications of the damage buff part itself, just that it felt really weird shoehorning this effect onto cloak\r\n\r\nIt just feels like this item had the crit chance and damage as an independent buff and then it was just moved into cloak for no good reason, or rather just a \"but what if I did.\""); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_UNIVERSAL_VIP_PASS_NAME", "Universal VIP Paws"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_SACRIFICIAL_BAND_NAME", "B(r)and of Sacrifice"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_TEMPORAL_TRANSISTOR_NAME", "hrt install"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_CEREMONIAL_JAR_NAME", "The Nefarious Jar"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_TORN_FEATHER_NAME", "Respect"); if (ItemBase.DefaultEnabledCallback(ItemBase<TornFeather>.instance)) { ItemBase<TornFeather>.instance.ItemDef.pickupIconSprite = Main.hifuSandswept.LoadAsset<Sprite>("respectPNG.png"); } LanguageAPI.AddOverlay("ITEM_SANDSWEPT_THEIR_PROMINENCE_NAME", "must take bruh :pray:"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_HALLOWED_ICHOR_NAME", "yet another terraria reference (borbo would be proud)"); LanguageAPI.AddOverlay("SS_RANGER_BODY_NAME", "gay little [CHEESE PUFF]"); LanguageAPI.AddOverlay("SS_RANGER_DESCRIPTION", "this is a [CHEESE PUFF]"); LanguageAPI.AddOverlay("SKINDEF_MAJOR", "minor"); LanguageAPI.AddOverlay("SKINDEF_RENEGADE", "holy shit its been more than 2 years and we still havent added renegade thagt this skin is a reference to"); LanguageAPI.AddOverlay("SKINDEF_MILEZERO", "literally just Periphery 2"); LanguageAPI.AddOverlay("ACHIEVEMENT_RANGERCLEARGAMEMONSOON_NAME", "[CHEESE PUFF]: Mastery"); LanguageAPI.AddOverlay("ACHIEVEMENT_RANGERCLEARGAMEMONSOON_DESCRIPTION", "As [CHEESE PUFF], beat the game or obliterate on Monsoon."); LanguageAPI.AddOverlay("SANDSWEPT_ELECTR_NAME", "(WOKE DEI WARNING!) gay robot [CHEESE PUFF] girl"); LanguageAPI.AddOverlay("SKIN_ELEC_MASTERY", "Covenant (hifu when the skin name is a music reference OMG WOJAK RAISING HANDS JPEG) https://www.youtube.com/watch?v=tjcUCwe4yaY"); LanguageAPI.AddOverlay("ACHIEVEMENT_ELECTRICIANCLEARGAMEMONSOON_NAME", "(WOKE DEI WARNING!) gay robot [CHEESE PUFF] girl: Mastery"); LanguageAPI.AddOverlay("SANDSWEPT_CANNONJELLY_NAME", "[CHEESE PUFF]"); LanguageAPI.AddOverlay("SANDSWEPT_SWEPSWEP_NAME", "https://www.youtube.com/watch?v=XYCQcy76100"); LanguageAPI.AddOverlay("SANDSWEPT_VOLATILECONTEXT", "Forcefully Insert Battery~"); LanguageAPI.AddOverlay("SANDSWEPT_VOLATILEINSERT", "your life is as valuable as a <style=cDeath>summer ant</style>"); LanguageAPI.AddOverlay("SANDSWEPT_INFERNO_DRONE_BODY", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_INFERNO_DRONE_BROKEN_NAME", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_INFERNO_DRONE_CONTEXT", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_VOLTAIC_DRONE_BODY", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_VOLTAIC_DRONE_BROKEN_NAME", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_VOLTAIC_DRONE_CONTEXT", "Can you find the moredrones ?"); Main.SandsweptExpansionDef.nameToken.AddOverlay("Sandstorm 2"); Main.SandsweptExpansionDef.descriptionToken.AddOverlay("sandswept is pretty mid\r\nsorry\r\nthere are a few cool items but other than those its all just bad or mediocre\r\nthe characters lack polish"); object obj = <>O.<0>__Inventory_GiveItem_ItemIndex_int; if (obj == null) { hook_GiveItem_ItemIndex_int val = Inventory_GiveItem_ItemIndex_int; <>O.<0>__Inventory_GiveItem_ItemIndex_int = val; obj = (object)val; } Inventory.GiveItem_ItemIndex_int += (hook_GiveItem_ItemIndex_int)obj; GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; } } private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport report) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = report.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && attackerBody.bodyIndex == VoltIndex.Value && Util.CheckRoll(3f, 0f, (CharacterMaster)null)) { Chat.AddMessage("<color=#7D42B2>Cheese puff girl</color>: Wlasnie zabilam kiegos chlopa czy tam babe :3"); } } private static void Inventory_GiveItem_ItemIndex_int(orig_GiveItem_ItemIndex_int orig, Inventory self, ItemIndex itemIndex, int count) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, itemIndex, count); SmoulderingDocument instance = ItemBase<SmoulderingDocument>.instance; if (instance != null && itemIndex != instance.ItemDef.itemIndex) { } } } public class EggController : MonoBehaviour { private float decayStopwatch = 0.5f; private bool decaying = false; private Vector3 baseScale; private Vector3 tl; private Vector3 bl; private Vector3 tr; private Vector3 br; internal Vector3 velocity; private float boundsSize; public void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_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) baseScale = ((Component)this).transform.localScale; bl = Camera.main.ViewportToScreenPoint(new Vector3(0f, 0f)); tl = Camera.main.ViewportToScreenPoint(new Vector3(0f, 1f)); br = Camera.main.ViewportToScreenPoint(new Vector3(1f, 0f)); tr = Camera.main.ViewportToScreenPoint(new Vector3(1f, 1f)); BoxCollider2D component = ((Component)this).GetComponent<BoxCollider2D>(); Bounds bounds = ((Collider2D)component).bounds; Vector3 size = ((Bounds)(ref bounds)).size; boundsSize = ((Vector3)(ref size)).magnitude / 2f; } public void OnMouseDown() { if (!decaying) { decaying = true; } } public void Update() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (decaying) { decayStopwatch -= Time.deltaTime; if (decayStopwatch <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } ((Component)this).transform.localScale = baseScale * (1f - decayStopwatch / 0.5f); } } public void FixedUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; transform.position += velocity * Time.fixedDeltaTime; Vector3 val = Camera.main.WorldToScreenPoint(((Component)this).transform.position) + boundsSize * ((Vector3)(ref velocity)).normalized; if (val.y >= tr.y) { velocity = Vector3.Reflect(velocity, Vector3.down); } if (val.y <= br.y) { velocity = Vector3.Reflect(velocity, Vector3.up); } if (val.x >= br.x) { velocity = Vector3.Reflect(velocity, Vector3.left); } if (val.x <= bl.x) { velocity = Vector3.Reflect(velocity, Vector3.right); } } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void LogDebug(object data) { _logSource.LogDebug(data); } internal static void LogError(object data) { _logSource.LogError(data); } internal static void LogFatal(object data) { _logSource.LogFatal(data); } internal static void LogInfo(object data) { _logSource.LogInfo(data); } internal static void LogMessage(object data) { _logSource.LogMessage(data); } internal static void LogWarning(object data) { _logSource.LogWarning(data); } } [BepInPlugin("com.TeamSandswept.Sandswept", "Sandswept", "1.2.5")] [BepInDependency("com.bepis.r2api.skins", "1.2.1")] [BepInDependency("com.bepis.r2api.dot", "1.0.4")] [BepInDependency("com.bepis.r2api.items", "1.0.7")] [BepInDependency("com.bepis.r2api.elites", "1.0.7")] [BepInDependency("com.bepis.r2api.damagetype", "1.1.7")] [BepInDependency("com.bepis.r2api.prefab", "1.0.4")] [BepInDependency("com.bepis.r2api.language", "1.0.1")] [BepInDependency("com.bepis.r2api.recalculatestats", "1.6.0")] [BepInDependency("com.bepis.r2api.content_management", "1.0.10")] [BepInDependency("com.bepis.r2api.networking", "1.0.3")] [BepInDependency("com.bepis.r2api.director", "2.3.5")] [BepInDependency("com.bepis.r2api.skills", "1.0.2")] [BepInDependency("com.bepis.r2api.proctype", "1.0.2")] [BepInDependency("com.RiskOfBrainrot.MoreStats", "1.2.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static AnimationChanged <0>__RangerEmotesFix; } public const string ModGuid = "com.TeamSandswept.Sandswept"; public const string ModName = "Sandswept"; public const string ModVersion = "1.2.5"; public static AssetBundle mainAssets; public static AssetBundle assets; public static AssetBundle prodAssets; public static AssetBundle hifuSandswept; public static AssetBundle sandsweptHIFU; public static AssetBundle dgoslingAssets; public static ModdedDamageType eclipseSelfDamage = DamageAPI.ReserveDamageType(); public static ExpansionDef SOTV; public static ExpansionDef SandsweptExpansionDef; public static List<ArtifactBase> Artifacts = new List<ArtifactBase>(); public static List<ItemBase> AllItems = new List<ItemBase>(); public static List<ItemBase> EnabledItems = new List<ItemBase>(); public static List<EquipmentBase> AllEquipment = new List<EquipmentBase>(); public static List<EquipmentBase> EnabledEquipment = new List<EquipmentBase>(); public static List<BuffBase> Buffs = new List<BuffBase>(); public static List<EliteEquipmentBase> EliteEquipments = new List<EliteEquipmentBase>(); public static List<UnlockableDef> Unlocks = new List<UnlockableDef>(); public static List<GameObject> EffectPrefabs = new List<GameObject>(); public static Dictionary<BuffBase, bool> BuffStatusDictionary = new Dictionary<BuffBase, bool>(); public static ManualLogSource ModLogger; public static ConfigFile config; public static ConfigFile backupConfig; public static Main Instance; public static bool LookingGlassLoaded = false; private static string rangerBoneMapperName; public static GameObject tempestSphereDefault; public static GameObject tempestSphereCovenant; public static bool ran = true; public static ConfigEntry<bool> enableLogging { get; set; } public ConfigEntry<bool> enableAutoConfig { get; private set; } public ConfigEntry<string> latestVersion { get; private set; } public static ConfigEntry<bool> cursedConfig { get; private set; } public static Material lineRendererBase => CreateLineRenderer(); private void Awake() { Instance = this; Stopwatch stopwatch = Stopwatch.StartNew(); LookingGlassLoaded = Chainloader.PluginInfos.ContainsKey("droppod.lookingglass"); SOTV = ExpansionDef.DLC1; ModLogger = ((BaseUnityPlugin)this).Logger; SetUpConfig(); SetUpAssets(); SetUpContent(); SetUpHooks(); ModLogger.LogDebug((object)"#SANDSWEEP"); ModLogger.LogDebug((object)("Initialized mod in " + stopwatch.ElapsedMilliseconds + "ms")); } public void SetUpConfig() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown config = ((BaseUnityPlugin)this).Config; backupConfig = new ConfigFile(Paths.ConfigPath + "\\com.TeamSandswept.Sandswept.Backup.cfg", true); backupConfig.Bind<string>(": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :"); enableAutoConfig = config.Bind<bool>("Config", "Enable Auto Config Sync", true, "Disabling this would stop Sandswept from syncing config whenever a new version is found."); bool flag = !((Dictionary<ConfigDefinition, string>)AccessTools.DeclaredPropertyGetter(typeof(ConfigFile), "OrphanedEntries").Invoke(config, null)).Keys.Any((ConfigDefinition x) => x.Key == "Latest Version"); latestVersion = config.Bind<string>("Config", "Latest Version", "1.2.5", "DO NOT CHANGE THIS"); cursedConfig = config.Bind<bool>("Config", "Enable Cursed Config?", false, "just dumb shit"); if (enableAutoConfig.Value && (flag || latestVersion.Value != "1.2.5")) { latestVersion.Value = "1.2.5"; ConfigManager.VersionChanged = true; ModLogger.LogInfo((object)"Config Autosync Enabled."); } AutoRunCollector.HandleAutoRun(); ConfigManager.HandleConfigAttributes(Assembly.GetExecutingAssembly(), ((BaseUnityPlugin)this).Config); } public void SetUpAssets() { assets = LoadAssetBundle("sandsweptassets2"); prodAssets = LoadAssetBundle("sandsweep3"); hifuSandswept = LoadAssetBundle("hifusandswept"); sandsweptHIFU = LoadAssetBundle("sandswepthifu"); dgoslingAssets = LoadAssetBundle("dgoslingstuff"); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Sandswept.sandsweptassets")) { mainAssets = AssetBundle.LoadFromStream(stream); } SwapShaders(mainAssets); SwapShaders(assets); SwapShaders(prodAssets); SwapShaders(hifuSandswept); SwapShaders(sandsweptHIFU); SwapShaders(dgoslingAssets); } public void SetUpContent() { SelfDamageHook.Init(); Keywords.SetupKeywords(); Decay.Init(); GenerateExpansionDef(); Initialize.Init(); DamageColourHelper.Init(); IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)) select type; foreach (Type item2 in enumerable) { ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item2); if (LoadArtifact(artifactBase, Artifacts)) { artifactBase.Init(((BaseUnityPlugin)this).Config); } } IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)) select type; foreach (Type item3 in enumerable2) { ItemBase item = (ItemBase)Activator.CreateInstance(item3); AllItems.Add(item); } foreach (ItemBase allItem in AllItems) { if (LoadItem(allItem, new List<ItemBase>())) { EnabledItems.Add(allItem); allItem.Init(); } } IEnumerable<Type> enumerable3 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase)) select type; foreach (Type item4 in enumerable3) { EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item4); if (LoadEquipment(equipmentBase, AllEquipment)) { EnabledEquipment.Add(equipmentBase); equipmentBase.Init(); } } IEnumerable<Type> enumerable4 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase)) select type; foreach (Type item5 in enumerable4) { EliteEquipmentBase eliteEquipmentBase = (EliteEquipmentBase)Activator.CreateInstance(item5); if (LoadEliteEquipment(eliteEquipmentBase, EliteEquipments)) { eliteEquipmentBase.Init(((BaseUnityPlugin)this).Config); } } IEnumerable<Type> enumerable5 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase)) select type; foreach (Type item6 in enumerable5) { BuffBase buffBase = (BuffBase)Activator.CreateInstance(item6); if (LoadBuff(buffBase, Buffs)) { buffBase.Init(); } } ScanTypes(delegate(SkillBase x) { x.Init(); }); ScanTypes(delegate(SurvivorBase x) { x.Init(); }); ScanTypes(delegate(EnemyBase x) { x.Create(); }); ScanTypes(delegate(InteractableBase x) { if (LoadInteractable(x, new List<InteractableBase>())) { x.Init(); } }); ScanTypes(delegate(DroneBase x) { x.Initialize(); }); ScanTypesNoInstance<EntityState>(delegate(Type x) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); ContentAddition.AddEntityState(x, ref flag); }); CorruptItems(); new ContentPacks().Initialize(); CursedConfig.Init(); SwepSwepTheSandy.Init(); NetworkingAPI.RegisterMessageType<CallNetworkedMethod>(); } public void SetUpHooks() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown SandsweptTemporaryEffects.ApplyHooks(); RoR2Content.Init += new hook_Init(OnWwiseInit); DeathState.OnImpactServer += new Manipulator(DroneDropFix); } [SystemInitializer(new Type[] { typeof(SurvivorCatalog) })] public static void SetUpEmotes() { if (Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI")) { AddRangerEmotes(); } } public AssetBundle LoadAssetBundle(string assetBundleName) { return AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Instance).Info.Location), assetBundleName)); } private static SpawnCard GetDroneCard(string str) { if (!(str == "SpawnCards/InteractableSpawnCard/iscBrokenInfernoDrone")) { if (str == "SpawnCards/InteractableSpawnCard/iscBrokenVoltaicDrone") { return (SpawnCard)(object)DroneBase<VoltaicDrone>.Instance.iscBroken; } return LegacyResourcesAPI.Load<SpawnCard>(str); } return (SpawnCard)(object)DroneBase<InfernoDrone>.Instance.iscBroken; } private void OnWwiseInit(orig_Init orig) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(); string text = typeof(Main).Assembly.Location.Replace("Sandswept.dll", ""); AkSoundEngine.AddBasePath(text); uint num = default(uint); AkSoundEngine.LoadBank("initsoundswept", ref num); AkSoundEngine.LoadBank("soundswept", ref num); } public void GenerateExpansionDef() { SandsweptExpansionDef = dgoslingAssets.LoadAsset<ExpansionDef>("SandSweptExpDef"); SandsweptExpansionDef.nameToken.Add("Sandswept"); SandsweptExpansionDef.descriptionToken.Add("Adds content from the 'Sandswept' expansion to the game <3. Have fun <3."); SandsweptExpansionDef.disabledIconSprite = hifuSandswept.LoadAsset<Sprite>("texUnlockIcon.png"); ContentAddition.AddExpansionDef(SandsweptExpansionDef); } internal static void ScanTypes<T>(Action<T> action) { IEnumerable<Type> enumerable = from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(T)) select x; foreach (Type item in enumerable) { T obj = (T)Activator.CreateInstance(item); action(obj); } } internal static void ScanTypesNoInstance<T>(Action<Type> action) { IEnumerable<Type> enumerable = from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(T)) select x; foreach (Type item in enumerable) { action(item); } } public bool LoadArtifact(ArtifactBase artifact, List<ArtifactBase> artifactList) { bool flag = ArtifactBase.DefaultEnabledCallback(artifact); if (flag) { artifactList.Add(artifact); } return flag; } public bool LoadItem(ItemBase item, List<ItemBase> itemList) { bool flag = ItemBase.DefaultEnabledCallback(item); if (flag) { itemList.Add(item); } return flag; } public bool LoadEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList) { if (EquipmentBase.DefaultEnabledCallback(equipment)) { equipmentList.Add(equipment); return true; } return false; } public bool LoadEliteEquipment(EliteEquipmentBase eliteEquipment, List<EliteEquipmentBase> eliteEquipmentList) { if (EliteEquipmentBase.DefaultEnabledCallback(eliteEquipment)) { eliteEquipmentList.Add(eliteEquipment); return true; } return false; } public bool LoadBuff(BuffBase buff, List<BuffBase> buffList) { BuffStatusDictionary.Add(buff, value: true); buffList.Add(buff); return true; } public bool LoadInteractable(InteractableBase interactable, List<InteractableBase> interactableList) { if (InteractableBase.DefaultEnabledCallback(interactable)) { interactableList.Add(interactable); return true; } return false; } public void SwapShaders(AssetBundle bundle) { Material[] array = bundle.LoadAllAssets<Material>(); Material[] array2 = array; foreach (Material val in array2) { switch (((Object)val.shader).name) { case "Hopoo Games/FX/Cloud Remap": val.shader = Shader.HGCloudRemap; break; case "Stubbed Hopoo Games/Deferred/Standard": val.shader = Resources.Load<Shader>("shaders/deferred/hgstandard"); break; case "StubbedShader/deferred/hgstandard": val.shader = Shader.HGStandard; break; case "StubbedShader/fx/hgintersectioncloudremap": val.shader = Resources.Load<Shader>("shaders/fx/hgintersectioncloudremap"); break; case "Stubbed Hopoo Games/Deferred/Snow Topped": val.shader = Resources.Load<Shader>("shaders/deferred/hgsnowtopped"); break; case "Stubbed Hopoo Games/FX/Cloud Remap": val.shader = Resources.Load<Shader>("shaders/fx/hgcloudremap"); break; case "Stubbed Hopoo Games/FX/Cloud Intersection Remap": val.shader = Resources.Load<Shader>("shaders/fx/hgintersectioncloudremap"); break; case "Stubbed Hopoo Games/FX/Opaque Cloud Remap": val.shader = Resources.Load<Shader>("shaders/fx/hgopaquecloudremap"); break; case "Stubbed Hopoo Games/FX/Distortion": val.shader = Resources.Load<Shader>("shaders/fx/hgdistortion"); break; case "Stubbed Hopoo Games/FX/Solid Parallax": val.shader = Resources.Load<Shader>("shaders/fx/hgsolidparallax"); break; case "Stubbed Hopoo Games/Environment/Distant Water": val.shader = Resources.Load<Shader>("shaders/environment/hgdistantwater"); break; case "StubbedRoR2/Base/Shaders/HGStandard": val.shader = LegacyShaderAPI.Find("Hopoo Games/Deferred/Standard"); break; case "StubbedRoR2/Base/Shaders/HGCloudRemap": val.shader = Shader.HGCloudRemap; break; case "StubbedRoR2/Base/Shaders/HGIntersectionCloudRemap": val.shader = LegacyShaderAPI.Find("Hopoo Games/FX/Cloud Intersection Remap"); break; } } } private void CorruptItems() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance<ItemRelationshipProvider>(); ((Object)val).name = "SANDSWEPT_VOID_ITEM_RELATIONSHIP_PROVIDER"; val.relationshipType = ItemRelationshipType.ContagiousItem; List<Pair> list = new List<Pair>(); for (int num = EnabledItems.Count - 1; num >= 0; num--) { ItemBase itemBase = AllItems[num]; ItemDef itemDef = itemBase.ItemDef; ItemDef itemToCorrupt = itemBase.ItemToCorrupt; if (!((Object)(object)itemToCorrupt == (Object)null) && ItemBase.DefaultEnabledCallback(itemBase)) { Pair val2 = default(Pair); val2.itemDef2 = itemDef; val2.itemDef1 = itemToCorrupt; Pair item = val2; list.Add(item); } } val.relationships = list.ToArray(); ContentAddition.AddItemRelationshipProvider(val); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddRangerEmotes() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown GameObject val = dgoslingAssets.LoadAsset<GameObject>("mdlRangerEmote"); CustomEmotesAPI.ImportArmature(SurvivorBase<Sandswept.Survivors.Ranger.Ranger>.instance.Body, val, 0, true); BoneMapper componentInChildren = val.GetComponentInChildren<BoneMapper>(); componentInChildren.scale = 0.9f; rangerBoneMapperName = ((Object)componentInChildren).name; object obj = <>O.<0>__RangerEmotesFix; if (obj == null) { AnimationChanged val2 = RangerEmotesFix; <>O.<0>__RangerEmotesFix = val2; obj = (object)val2; } CustomEmotesAPI.animChanged += (AnimationChanged)obj; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void RangerEmotesFix(string newAnimation, BoneMapper mapper) { if (((Object)mapper).name == rangerBoneMapperName) { GameObject gameObject = ((Component)((Component)mapper).transform.parent.Find("Gun")).gameObject; if (newAnimation != "none") { gameObject.SetActive(false); } else { gameObject.SetActive(true); } } } private void DroneDropFix(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1) }); val.Prev.Operand = typeof(Main).GetMethod("GetDroneCard", BindingFlags.Static | BindingFlags.NonPublic); } public void FixedUpdate() { if (!ran) { ((MonoBehaviour)this).StartCoroutine(CreateDefaultPrefab()); ((MonoBehaviour)this).StartCoroutine(CreateCovenantPrefab()); ran = true; } } public IEnumerator CreateDefaultPrefab() { Color32 beamStartColor = new Color32((byte)0, (byte)77, byte.MaxValue, byte.MaxValue); Color32 beamEndColor = new Color32(byte.MaxValue, (byte)191, (byte)0, byte.MaxValue); Color32 sphereFillColor = new Color32(byte.MaxValue, (byte)165, (byte)0, byte.MaxValue); Color32 sphereOutlineColor = new Color32((byte)158, (byte)93, (byte)0, byte.MaxValue); Color32 smallSphereFillColor = new Color32((byte)0, (byte)42, byte.MaxValue, byte.MaxValue); tempestSphereDefault = PrefabAPI.InstantiateClone(assets.LoadAsset<GameObject>("TempestSphereProjectile.prefab"), "Tempest Sphere Projectile Default"); ContentAddition.AddProjectile(tempestSphereDefault); GameObject sphereVFX = new GameObject("Tempest Sphere VFX Holder Default"); sphereVFX.transform.position = Vector3.zero; sphereVFX.transform.localPosition = Vector3.zero; GameObject tempestSphereIndicator = PrefabAPI.InstantiateClone(GameObject.VagrantNovaAreaIndicator, "Tempest Sphere Indicator Default", false); ((Component)tempestSphereIndicator.transform.Find("Particle System")).gameObject.SetActive(false); Light pointLight = ((Component)tempestSphereIndicator.transform.Find("Point Light")).GetComponent<Light>(); pointLight.color = Color32.op_Implicit(sphereOutlineColor); pointLight.intensity = 100f; ((Behaviour)((Component)pointLight).GetComponent<LightIntensityCurve>()).enabled = false; ((Behaviour)((Component)pointLight).GetComponent<LightScaleFromParent>()).enabled = false; pointLight.range = 20f; Material newSphereFillMaterial = new Material(Material.matWarbannerSphereIndicator); newSphereFillMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone); newSphereFillMaterial.SetColor("_TintColor", Color32.op_Implicit(sphereFillColor)); newSphereFillMaterial.SetFloat("_InvFade", 30f); newSphereFillMaterial.SetFloat("_SoftPower", 0.1f); newSphereFillMaterial.SetFloat("_Boost", 3f); newSphereFillMaterial.SetFloat("_RimPower", 17f); newSphereFillMaterial.SetFloat("_RimStrength", 5f); newSphereFillMaterial.SetFloat("_AlphaBoost", 20f); newSphereFillMaterial.SetFloat("_IntersectionStrength", 1.223287f); Material newSphereOutlineMaterial = new Material(Material.matLightningSphere); newSphereOutlineMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); newSphereOutlineMaterial.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.texCloudLightning1); newSphereOutlineMaterial.SetTexture("_Cloud2Tex", (Texture)null); newSphereOutlineMaterial.SetColor("_TintColor", Color32.op_Implicit(sphereOutlineColor)); newSphereOutlineMaterial.SetFloat("_InvFade", 3f); newSphereOutlineMaterial.SetFloat("_SoftPower", 0.85f); newSphereOutlineMaterial.SetFloat("_Boost", 1.5f); newSphereOutlineMaterial.SetFloat("_RimPower", 0.1f); newSphereOutlineMaterial.SetFloat("_RimStrength", 0.052f); newSphereOutlineMaterial.SetFloat("_AlphaBoost", 1f); newSphereOutlineMaterial.SetFloat("_IntersectionStrength", 6.4f); Material[] newTempestSphereMaterials = (Material[])(object)new Material[2] { newSphereFillMaterial, newSphereOutlineMaterial }; ((Renderer)tempestSphereIndicator.GetComponent<MeshRenderer>()).sharedMaterials = newTempestSphereMaterials; tempestSphereIndicator.RemoveComponent<ObjectScaleCurve>(); yield return (object)new WaitForSeconds(0.1f); tempestSphereIndicator.transform.localScale = new Vector3(14f, 14f, 14f); tempestSphereIndicator.RemoveComponent<AnimateShaderAlpha>(); Material newOrbCoreOutlineMaterial = new Material(Material.matLoaderLightningTile); newOrbCoreOutlineMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); newOrbCoreOutlineMaterial.SetColor("_TintColor", Color32.op_Implicit(sphereFillColor)); newOrbCoreOutlineMaterial.SetFloat("_InvFade", 1.3f); newOrbCoreOutlineMaterial.SetFloat("_Boost", 4f); newOrbCoreOutlineMaterial.SetFloat("_AlphaBoost", 3.67f); newOrbCoreOutlineMaterial.SetFloat("_AlphaBias", 0f); Material newOrbCoreFillMaterial = new Material(Material.matJellyfishLightningSphere); newOrbCoreFillMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); newOrbCoreFillMaterial.SetColor("_TintColor", Color32.op_Implicit(smallSphereFillColor)); newOrbCoreFillMaterial.SetFloat("_InvFade", 0.8f); newOrbCoreFillMaterial.SetFloat("_SoftPower", 1f); newOrbCoreFillMaterial.SetFloat("_Boost", 1.86f); newOrbCoreFillMaterial.SetFloat("_RimPower", 1.5f); newOrbCoreFillMaterial.SetFloat("_RimStrength", 0.7f); newOrbCoreFillMaterial.SetFloat("_AlphaBoost", 6f); newOrbCoreFillMaterial.SetFloat("_AlphaBias", 2f); Material[] newOrbCoreMaterials = (Material[])(object)new Material[2] { newOrbCoreOutlineMaterial, newOrbCoreFillMaterial }; GameObject tempestOrb = PrefabAPI.InstantiateClone(GameObject.VoidSurvivorChargeMegaBlaster, "Tempest Sphere Orb Default", false); ((Component)tempestOrb.transform.Find("Base")).gameObject.SetActive(false); ((Component)tempestOrb.transform.Find("Base (1)")).gameObject.SetActive(false); Transform tempestOrbPointLight = tempestOrb.transform.Find("Point light"); ((Behaviour)((Component)tempestOrbPointLight).GetComponent<FlickerLight>()).enabled = false; ((Behaviour)((Component)tempestOrbPointLight).GetComponent<LightIntensityCurve>()).enabled = false; Light tempestOrbPointLightLight = ((Component)tempestOrbPointLight).GetComponent<Light>(); ((Behaviour)tempestOrbPointLightLight).enabled = false; GameObject sparksIn = ((Component)tempestOrb.transform.Find("Sparks, In")).gameObject; GameObject sparksMisc = ((Component)tempestOrb.transform.Find("Sparks, Misc")).gameObject; sparksIn.transform.localScale = Vector3.one * 2f; EmissionModule sparksInEmission = sparksIn.GetComponent<ParticleSystem>().emission; MinMaxCurve sparksInRateOverTime = ((EmissionModule)(ref sparksInEmission)).rateOverTime; ((MinMaxCurve)(ref sparksInRateOverTime)).curveMultiplier = 2f; Material sparksInMaterial = new Material(Material.matLoaderCharging); sparksInMaterial.SetFloat("_Boost", 15f); sparksInMaterial.SetFloat("_AlphaBoost", 20f); sparksInMaterial.SetFloat("_AlphaBias", 1f); ((Renderer)sparksIn.GetComponent<ParticleSystemRenderer>()).sharedMaterial = sparksInMaterial; ((Renderer)sparksMisc.GetComponent<ParticleSystemRenderer>()).sharedMaterial = Material.matIceOrbCore; VFXUtils.RecolorMaterialsAndLights(sparksIn, beamStartColor, beamStartColor, convertRampsToGrayscale: true); VFXUtils.RecolorMaterialsAndLights(sparksMisc, beamStartColor, beamStartColor, convertRampsToGrayscale: true); Transform orbCore = tempestOrb.transform.Find("OrbCore"); orbCore.localScale = Vector3.one * 0.5f; ((Renderer)((Component)orbCore).GetComponent<MeshRenderer>()).sharedMaterials = newOrbCoreMaterials; RotateAroundAxis rotateX = ((Component)(object)orbCore).AddComponent<RotateAroundAxis>(); rotateX.speed = (Speed)2; rotateX.slowRotationSpeed = 5f; rotateX.fastRotationSpeed = 30f; rotateX.rotateAroundAxis = (RotationAxis)0; rotateX.relativeTo = (Space)1; rotateX.reverse = false; RotateAroundAxis rotateY = ((Component)(object)orbCore).AddComponent<RotateAroundAxis>(); rotateY.speed = (Speed)2; rotateY.slowRotationSpeed = 5f; rotateY.fastRotationSpeed = 45f; rotateY.rotateAroundAxis = (RotationAxis)1; rotateY.relativeTo = (Space)1; rotateY.reverse = false; ObjectScaleCurve objectScaleCurve = ((Component)(object)orbCore).AddComponent<ObjectScaleCurve>(); objectScaleCurve.useOverallCurveOnly = true; objectScaleCurve.timeMax = 10f; objectScaleCurve.overallCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.5f), new Keyframe(0.03f, 1f), new Keyframe(1f, 4.19f) }); ((Component)(object)tempestOrb.transform).RemoveComponent<ObjectScaleCurve>(); yield return (object)new WaitForSeconds(0.1f); tempestOrb.transform.localScale = Vector3.one * 3f; tempestSphereIndicator.transform.parent = sphereVFX.transform; tempestOrb.transform.parent = sphereVFX.transform; sphereVFX.transform.SetParent(tempestSphereDefault.transform); tempestSphereIndicator.transform.position = Vector3.zero; tempestSphereIndicator.transform.localPosition = Vector3.zero; tempestOrb.transform.position = Vector3.zero; tempestOrb.transform.localPosition = Vector3.zero; LineRenderer lineRenderer = ((Component)tempestSphereDefault.transform.Find("LR")).GetComponent<LineRenderer>(); lineRenderer.endWidth = 0.5f; lineRenderer.startColor = Color32.op_Implicit(beamStartColor); lineRenderer.endColor = Color32.op_Implicit(beamEndColor); ((Renderer)lineRenderer).material = lineRendererBase; DetachAndCollapse detachAndCollapse = tempestSphereDefault.AddComponent<DetachAndCollapse>(); detachAndCollapse.collapseTime = 0.4f; detachAndCollapse.target = sphereVFX.transform; } public IEnumerator CreateCovenantPrefab() { Color32 beamStartColor = new Color32(byte.MaxValue, (byte)0, (byte)230, byte.MaxValue); Color32 beamEndColor = new Color32((byte)0, (byte)0, byte.MaxValue, byte.MaxValue); Color32 sphereFillColor = new Color32((byte)0, (byte)12, byte.MaxValue, byte.MaxValue); Color32 sphereOutlineColor = new Color32((byte)129, (byte)57, (byte)176, byte.MaxValue); Color32 smallSphereFillColor = new Color32((byte)39, (byte)6, (byte)40, byte.MaxValue); tempestSphereCovenant = PrefabAPI.InstantiateClone(assets.LoadAsset<GameObject>("TempestSphereProjectile.prefab"), "Tempest Sphere Projectile Covenant"); ContentAddition.AddProjectile(tempestSphereCovenant); GameObject sphereVFX = new GameObject("Tempest Sphere VFX Holder Covenant"); sphereVFX.transform.position = Vector3.zero; sphereVFX.transform.localPosition = Vector3.zero; GameObject tempestSphereIndicator = PrefabAPI.InstantiateClone(GameObject.VagrantNovaAreaIndicator, "Tempest Sphere Indicator Covenant", false); ((Component)tempestSphereIndicator.transform.Find("Particle System")).gameObject.SetActive(false); Light pointLight = ((Component)tempestSphereIndicator.transform.Find("Point Light")).GetComponent<Light>(); pointLight.color = Color32.op_Implicit(sphereOutlineColor); pointLight.intensity = 100f; ((Behaviour)((Component)pointLight).GetComponent<LightIntensityCurve>()).enabled = false; ((Behaviour)((Component)pointLight).GetComponent<LightScaleFromParent>()).enabled = false; pointLight.range = 20f; Material newSphereFillMaterial = new Material(Material.matWarbannerSphereIndicator); newSphereFillMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone); newSphereFillMaterial.SetColor("_TintColor", Color32.op_Implicit(sphereFillColor)); newSphereFillMaterial.SetFloat("_InvFade", 30f); newSphereFillMaterial.SetFloat("_SoftPower", 0.1f); newSphereFillMaterial.SetFloat("_Boost", 3f); newSphereFillMaterial.SetFloat("_RimPower", 17f); newSphereFillMaterial.SetFloat("_RimStrength", 5f); newSphereFillMaterial.SetFloat("_AlphaBoost", 20f); newSphereFillMaterial.SetFloat("_IntersectionStrength", 1.223287f); Material newSphereOutlineMaterial = new Material(Material.matLightningSphere); newSphereOutlineMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); newSphereOutlineMaterial.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.texCloudLightning1); newSphereOutlineMaterial.SetTexture("_Cloud2Tex", (Texture)null); newSphereOutlineMaterial.SetColor("_TintColor", Color32.op_Implicit(sphereOutlineColor)); newSphereOutlineMaterial.SetFloat("_InvFade", 3f); newSphereOutlineMaterial.SetFloat("_SoftPower", 0.85f); newSphereOutlineMaterial.SetFloat("_Boost", 1.5f); newSphereOutlineMaterial.SetFloat("_RimPower", 0.1f); newSphereOutlineMaterial.SetFloat("_RimStrength", 0.052f); newSphereOutlineMaterial.SetFloat("_AlphaBoost", 1f); newSphereOutlineMaterial.SetFloat("_IntersectionStrength", 6.4f); Material[] newTempestSphereMaterials = (Material[])(object)new Material[2] { newSphereFillMaterial, newSphereOutlineMaterial }; ((Renderer)tempestSphereIndicator.GetComponent<MeshRenderer>()).sharedMaterials = newTempestSphereMaterials; tempestSphereIndicator.RemoveComponent<ObjectScaleCurve>(); yield return (object)new WaitForSeconds(0.1f); tempestSphereIndicator.transform.localScale = new Vector3(14f, 14f, 14f); tempestSphereIndicator.RemoveComponent<AnimateShaderAlpha>(); Material newOrbCoreOutlineMaterial = new Material(Material.matLoaderLightningTile); newOrbCoreOutlineMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); newOrbCoreOutlineMaterial.SetColor("_TintColor", Color32.op_Implicit(sphereFillColor)); newOrbCoreOutlineMaterial.SetFloat("_InvFade", 1.3f); newOrbCoreOutlineMaterial.SetFloat("_Boost", 4f); newOrbCoreOutlineMaterial.SetFloat("_AlphaBoost", 3.67f); newOrbCoreOutlineMaterial.SetFloat("_AlphaBias", 0f); Material newOrbCoreFillMaterial = new Material(Material.matJellyfishLightningSphere); newOrbCoreFillMaterial.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); newOrbCoreFillMaterial.SetColor("_TintColor", Color32.op_Implicit(smallSphereFillColor)); newOrbCoreFillMaterial.SetFloat("_InvFade", 0.8f); newOrbCoreFillMaterial.SetFloat("_SoftPower", 1f); newOrbCoreFillMaterial.SetFloat("_Boost", 1.86f); newOrbCoreFillMaterial.SetFloat("_RimPower", 1.5f); newOrbCoreFillMaterial.SetFloat("_RimStrength", 0.7f); newOrbCoreFillMaterial.SetFloat("_AlphaBoost", 6f); newOrbCoreFillMaterial.SetFloat("_AlphaBias", 2f); Material[] newOrbCoreMaterials = (Material[])(object)new Material[2] { newOrbCoreOutlineMaterial, newOrbCoreFillMaterial }; GameObject tempestOrb = PrefabAPI.InstantiateClone(GameObject.VoidSurvivorChargeMegaBlaster, "Tempest Sphere Orb Covenant", false); ((Component)tempestOrb.transform.Find("Base")).gameObject.SetActive(false); ((Component)tempestOrb.transform.Find("Base (1)")).gameObject.SetActive(false); Transform tempestOrbPointLight = tempestOrb.transform.Find("Point light"); ((Behaviour)((Component)tempestOrbPointLight).GetComponent<FlickerLight>()).enabled = false; ((Behaviour)((Component)tempestOrbPointLight).GetComponent<LightIntensityCurve>()).enabled = false; Light tempestOrbPointLightLight = ((Component)tempestOrbPointLight).GetComponent<Light>(); ((Behaviour)tempestOrbPointLightLight).enabled = false; GameObject sparksIn = ((Component)tempestOrb.transform.Find("Sparks, In")).gameObject; GameObject sparksMisc = ((Component)tempestOrb.transform.Find("Sparks, Misc")).gameObject; sparksIn.transform.localScale = Vector3.one * 2f; EmissionModule sparksInEmission = sparksIn.GetComponent<ParticleSystem>().emission; MinMaxCurve sparksInRateOverTime = ((EmissionModule)(ref sparksInEmission)).rateOverTime; ((MinMaxCurve)(ref sparksInRateOverTime)).curveMultiplier = 2f; Material sparksInMaterial = new Material(Material.matLoaderCharging); sparksInMaterial.SetFloat("_Boost", 15f); sparksInMaterial.SetFloat("_AlphaBoost", 20f); sparksInMaterial.SetFloat("_AlphaBias", 1f); ((Renderer)sparksIn.GetComponent<ParticleSystemRenderer>()).sharedMaterial = sparksInMaterial; ((Renderer)sparksMisc.GetComponent<ParticleSystemRenderer>()).sharedMaterial = Material.matIceOrbCore; VFXUtils.RecolorMaterialsAndLights(sparksIn, beamStartColor, beamStartColor, convertRampsToGrayscale: true); VFXUtils.RecolorMaterialsAndLights(sparksMisc, beamStartColor, beamStartColor, convertRampsToGrayscale: true); Transform orbCore = tempestOrb.transform.Find("OrbCore"); orbCore.localScale = Vector3.one * 0.5f; ((Renderer)((Component)orbCore).GetComponent<MeshRenderer>()).sharedMaterials = newOrbCoreMaterials; RotateAroundAxis rotateX = ((Component)(object)orbCore).AddComponent<RotateAroundAxis>(); rotateX.speed = (Speed)2; rotateX.slowRotationSpeed = 5f; rotateX.fastRotationSpeed = 30f; rotateX.rotateAroundAxis = (RotationAxis)0; rotateX.relativeTo = (Space)1; rotateX.reverse = false; RotateAroundAxis rotateY = ((Component)(object)orbCore).AddComponent<RotateAroundAxis>(); rotateY.speed = (Speed)2; rotateY.slowRotationSpeed = 5f; rotateY.fastRotationSpeed = 45f; rotateY.rotateAroundAxis = (RotationAxis)1; rotateY.relativeTo = (Space)1; rotateY.reverse = false; ObjectScaleCurve objectScaleCurve = ((Component)(object)orbCore).AddComponent<ObjectScaleCurve>(); objectScaleCurve.useOverallCurveOnly = true; objectScaleCurve.timeMax = 10f; objectScaleCurve.overallCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.5f), new Keyframe(0.03f, 1f), new Keyframe(1f, 4.19f) }); ((Component)(object)tempestOrb.transform).RemoveComponent<ObjectScaleCurve>(); yield return (object)new WaitForSeconds(0.1f); tempestOrb.transform.localScale = Vector3.one * 3f; tempestSphereIndicator.transform.parent = sphereVFX.transform; tempestOrb.transform.parent = sphereVFX.transform; sphereVFX.transform.SetParent(tempestSphereCovenant.transform); tempestSphereIndicator.transform.position = Vector3.zero; tempestSphereIndicator.transform.localPosition = Vector3.zero; tempestOrb.transform.position = Vector3.zero; tempestOrb.transform.localPosition = Vector3.zero; LineRenderer lineRenderer = ((Component)tempestSphereCovenant.transform.Find("LR")).GetComponent<LineRenderer>(); lineRenderer.endWidth = 0.5f; lineRenderer.startColor = Color32.op_Implicit(beamStartColor); lineRenderer.endColor = Color32.op_Implicit(beamEndColor); ((Renderer)lineRenderer).material = lineRendererBase; DetachAndCollapse detachAndCollapse = tempestSphereCovenant.AddComponent<DetachAndCollapse>(); detachAndCollapse.collapseTime = 0.4f; detachAndCollapse.target = sphereVFX.transform; } public static Material CreateLineRenderer() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003d: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(Material.matLightningLongYellow); val.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritoneHShrine); val.SetTexture("_Cloud1Tex", (Texture)null); val.SetTexture("_Cloud2Tex", (Texture)null); val.SetColor("_TintColor", Color.white); val.SetFloat("_InvFade", 1f); val.SetFloat("_Boost", 2f); val.SetFloat("_AlphaBoost", 1f); val.SetTextureScale("_MainTex", new Vector2(0.02f, 1f)); val.SetTextureOffset("_MainTex", Vector2.zero); val.SetFloat("_AlphaBias", 0.1f); val.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.texCloudLightning1); val.SetTextureScale("_Cloud1Tex", new Vector2(0.2f, 1f)); val.SetColor("_CutoffScroll", new Color(50f, 25f, 180f, 0f)); return val; } } public class SandsweptTemporaryEffects : MonoBehaviour { [CompilerGenerated] private static class <>O { public static hook_UpdateAllTemporaryVisualEffects <0>__OnUpdateVisualEffects; } public TemporaryVisualEffect GalvanicShield; public void UpdateTemporaryEffects(CharacterBody body) { } internal static void ApplyHooks() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__OnUpdateVisualEffects; if (obj == null) { hook_UpdateAllTemporaryVisualEffects val = OnUpdateVisualEffects; <>O.<0>__OnUpdateVisualEffects = val; obj = (object)val; } CharacterBody.UpdateAllTemporaryVisualEffects += (hook_UpdateAllTemporaryVisualEffects)obj; } private static void OnUpdateVisualEffects(orig_UpdateAllTemporaryVisualEffects orig, CharacterBody self) { orig.Invoke(self); SandsweptTemporaryEffects sandsweptTemporaryEffects = ((Component)self).GetComponent<SandsweptTemporaryEffects>(); if (!Object.op_Implicit((Object)(object)sandsweptTemporaryEffects)) { sandsweptTemporaryEffects = ((Component)(object)self).AddComponent<SandsweptTemporaryEffects>(); } sandsweptTemporaryEffects.UpdateTemporaryEffects(self); } } [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class ConfigFieldAttribute : SearchableAttribute { public string name; public string desc; public object defaultValue; public ConfigFieldAttribute(string name, string desc, object defaultValue) { this.name = name; this.desc = desc; this.defaultValue = defaultValue; } } [AttributeUsage(AttributeTargets.Class)] public class ConfigSectionAttribute : Attribute { public string name; public ConfigSectionAttribute(string name) { this.name = name; } } public class ConfigManager { internal static bool ConfigChanged; internal static bool VersionChanged; public static void HandleConfigAttributes(Assembly assembly, ConfigFile config) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown Type[] types = assembly.GetTypes(); foreach (Type type in types) { TypeInfo typeInfo = type.GetTypeInfo(); ConfigSectionAttribute customAttribute = typeInfo.GetCustomAttribute<ConfigSectionAttribute>(); if (customAttribute == null) { continue; } FieldInfo[] fields = typeInfo.GetFields(); foreach (FieldInfo fieldInfo in fields) { if (!fieldInfo.IsStatic) { continue; } Type fieldType = fieldInfo.FieldType; ConfigFieldAttribute customAttribute2 = ((MemberInfo)fieldInfo).GetCustomAttribute<ConfigFieldAttribute>(); if (customAttribute2 != null) { MethodInfo methodInfo = (from x in typeof(ConfigFile).GetMethods() where x.Name == "Bind" select x).First(); methodInfo = methodInfo.MakeGenericMethod(fieldType); ConfigEntryBase val = (ConfigEntryBase)methodInfo.Invoke(config, new object[3] { (object)new ConfigDefinition(customAttribute.name, customAttribute2.name), customAttribute2.defaultValue, (object)new ConfigDescription(customAttribute2.desc, (AcceptableValueBase)null, Array.Empty<object>()) }); ConfigEntryBase val2 = (ConfigEntryBase)methodInfo.Invoke(Main.backupConfig, new object[3] { (object)new ConfigDefinition(Regex.Replace(config.ConfigFilePath, "\\W", "") + " : " + customAttribute.name, customAttribute2.name), val.DefaultValue, (object)new ConfigDescription(customAttribute2.desc, (AcceptableValueBase)null, Array.Empty<object>()) }); if (!ConfigEqual(val2.DefaultValue, val2.BoxedValue) && VersionChanged) { val.BoxedValue = val.DefaultValue; val2.BoxedValue = val2.DefaultValue; } if (!ConfigEqual(val.DefaultValue, val.BoxedValue)) { ConfigChanged = true; } fieldInfo.SetValue(null, val.BoxedValue); } } } } private static bool ConfigEqual(object a, object b) { if (a.Equals(b)) { return true; } if (float.TryParse(a.ToString(), out var result) && float.TryParse(b.ToString(), out var result2) && (double)Mathf.Abs(result - result2) < 0.0001) { return true; } return false; } } } namespace Sandswept.Utils { public class BasicLaserBeam { public float DamageCoefficient; public CharacterBody Owner; public Transform TargetMuzzle; private LineRenderer lr; public GameObject effectInstance; private bool firing = false; private float stopwatch = 0f; private float growthStopwatch = 0f; private float delay; private BasicLaserInfo info; private Transform origin; private Transform end; private Vector3 targetEndpoint; private float origWidth = 0f; public bool Active => firing; public BasicLaserBeam(CharacterBody owner, Transform muzzle, BasicLaserInfo info) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) this.info = info; delay = 1f / info.TickRate; TargetMuzzle = muzzle; DamageCoefficient = info.DamageCoefficient * delay; effectInstance = Object.Instantiate<GameObject>(info.EffectPrefab, ((Component)muzzle).transform.position, Quaternion.identity); growthStopwatch = info.ChargeDelay; origin = (info.OriginIsBase ? effectInstance.transform : effectInstance.GetComponent<ChildLocator>().FindChild(info.OriginName)); end = effectInstance.GetComponent<ChildLocator>().FindChild(info.EndpointName); lr = effectInstance.GetComponent<DetachLineRendererAndFade>().line; origWidth = lr.widthMultiplier; Owner = owner; targetEndpoint = GetEndpoint(out var _); ((Component)end).transform.position = targetEndpoint; ((Component)origin).transform.position = ((Component)TargetMuzzle).transform.position; } public void Fire() { if (Object.op_Implicit((Object)(object)info.FiringMaterial)) { ((Renderer)lr).material = info.FiringMaterial; } lr.widthMultiplier = origWidth * info.FiringWidthMultiplier; firing = true; stopwatch = 0f; } public void UpdateVisual(float deltaTime) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_004a: Unknown result type (might be due to invalid IL or missing references) ((Component)origin).transform.position = ((Component)TargetMuzzle).transform.position; ((Component)end).transform.position = Vector3.MoveTowards(((Component)end).transform.position, targetEndpoint, 250f * deltaTime); } public void Update(float deltaTime) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown stopwatch += deltaTime; if (stopwatch >= delay) { targetEndpoint = GetEndpoint(out var unmodified); stopwatch = 0f; if (firing && ((NetworkBehaviour)Owner).hasAuthority) { GetBulletAttack().Fire(); if (Object.op_Implicit((Object)(object)info.ImpactEffect)) { EffectManager.SpawnEffect(info.ImpactEffect, new EffectData { origin = unmodified, scale = 1f }, false); } } } if (!firing) { growthStopwatch -= deltaTime; lr.widthMultiplier = Mathf.Max(0f, growthStopwatch / info.ChargeDelay); } } public Vector3 GetEndpoint(out Vector3 unmodified) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_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_00c4: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimDirection : TargetMuzzle.forward); Vector3 val2 = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimOrigin : TargetMuzzle.position); Ray val3 = new Ray(val2, val); Vector3 point = ((Ray)(ref val3)).GetPoint(info.MaxRange); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val2, val, ref val4, info.MaxRange, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { point = ((RaycastHit)(ref val4)).point; } unmodified = point; return point + val * 5f; } public BulletAttack GetBulletAttack() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) BulletAttack val = new BulletAttack(); val.radius = lr.startWidth * 0.75f; val.damage = Owner.damage * DamageCoefficient; val.origin = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimOrigin : TargetMuzzle.position); Vector3 val2 = ((Component)end).transform.position - TargetMuzzle.position; val.aimVector = ((Vector3)(ref val2)).normalized; val.procCoefficient = 1f; val.owner = ((Component)Owner).gameObject; val.falloffModel = (FalloffModel)0; val.isCrit = Util.CheckRoll(Owner.crit, Owner.master); val.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask; return val; } public void Stop() { Object.Destroy((Object)(object)effectInstance); } } public class BasicLaserInfo { public GameObject EffectPrefab; public string OriginName = "Origin"; public string EndpointName = "End"; public bool OriginIsBase = true; public float TickRate = 20f; public float DamageCoefficient = 1f; public Material FiringMaterial; public float ChargeDelay = 0.5f; public float FiringWidthMultiplier = 2f; public LaserFiringMode FiringMode = LaserFiringMode.Straight; public float MaxRange = 60f; public GameObject ImpactEffect; } public enum LaserFiringMode { TrackAim, Straight } public abstract class CoolerBasicMeleeAttack : BasicMeleeAttack { public abstract float BaseDuration { get; } public abstract float DamageCoefficient { get; } public abstract string HitboxName { get; } public abstract GameObject HitEffectPrefab { get; } public abstract float ProcCoefficient { get; } public abstract float HitPauseDuration { get; } public abstract GameObject SwingEffectPrefab { get; } public abstract string MuzzleString { get; } public virtual string MechanimHitboxParameter { get; } public virtual bool ScaleHitPauseDurationWithAttackSpeed { get; } = true; public virtual Func<bool> AlternateActiveParameter { get; } = () => true; public override void OnEnter() { base.baseDuration = BaseDuration; base.damageCoefficient = DamageCoefficient; base.hitBoxGroupName = HitboxName; base.hitEffectPrefab = HitEffectPrefab; base.procCoefficient = ProcCoefficient; base.hitPauseDuration = HitPauseDuration; base.swingEffectPrefab = SwingEffectPrefab; base.swingEffectMuzzleString = MuzzleString; if (MechanimHitboxParameter != null) { base.mecanimHitboxActiveParameter = MechanimHitboxParameter; } base.scaleHitPauseDurationAndVelocityWithAttackSpeed = ScaleHitPauseDurationWithAttackSpeed; ((BasicMeleeAttack)this).OnEnter(); } public override void FixedUpdate() { ((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime; if (string.IsNullOrEmpty(MechanimHitboxParameter) && AlternateActiveParameter()) { ((BasicMeleeAttack)this).BeginMeleeAttackEffect(); } else if (base.animator.GetFloat(MechanimHitboxParameter) >= 0.5f) { ((BasicMeleeAttack)this).BeginMeleeAttackEffect(); } if (((EntityState)this).isAuthority) { ((BasicMeleeAttack)this).AuthorityFixedUpdate(); } } } [RequireComponent(typeof(InputBankTest))] [RequireComponent(typeof(CharacterBody))] public abstract class Tracker : MonoBehaviour { public Transform target; public Indicator indicator; public GameObject targetingIndicatorPrefab; private float stopwatch = 0f; public float searchDelay = 0.1f; public float maxSearchAngle = 40f; public float maxSearchDistance = 60f; public bool isActive = true; public InputBankTest inputBank; public CharacterBody body; public Func<bool> isActiveCallback = DefaultIsActiveCallback; public float minDot => Mathf.Cos(Mathf.Clamp(maxSearchAngle, 0f, 180f) * (MathF.PI / 180f)); private static bool DefaultIsActiveCallback() { return true; } public virtual void Start() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown indicator = new Indicator(((Component)this).gameObject, targetingIndicatorPrefab); body = ((Component)this).GetComponent<CharacterBody>(); inputBank = ((Component)this).GetComponent<InputBankTest>(); } public virtual void FixedUpdate() { if (indicator != null && !DefaultIsActiveCallback()) { indicator.active = false; return; } if (indicator != null && !Object.op_Implicit((Object)(object)target)) { indicator.active = false; } if (indicator != null && Object.op_Implicit((Object)(object)target)) { indicator.active = true; } stopwatch += Time.fixedDeltaTime; if (stopwatch >= searchDelay) { stopwatch = 0f; target = SearchForTarget(); if (Object.op_Implicit((Object)(object)target)) { indicator.targetTransform = target; } } } public abstract Transform SearchForTarget(); } public class HurtboxTracker : Tracker { public enum TargetType { Enemy, Friendly, All } public TeamIndex userIndex; public TargetType targetType; public override void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) base.Start(); userIndex = body.teamComponent.teamIndex; } public override Transform SearchForTarget() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) BullseyeSearch val = new BullseyeSearch(); Ray aimRay = inputBank.GetAimRay(); val.searchDirection = ((Ray)(ref aimRay)).direction; val.searchOrigin = ((Component)this).transform.position; val.maxDistanceFilter = maxSearchDistance; val.maxAngleFilter = maxSearchAngle; TeamMask teamMaskFilter = TeamMask.all; switch (targetType) { case TargetType.Enemy: ((TeamMask)(ref teamMaskFilter)).RemoveTeam(userIndex); break; case TargetType.Friendly: teamMaskFilter = TeamMask.none; ((TeamMask)(ref teamMaskFilter)).AddTeam(userIndex); break; case TargetType.All: teamMaskFilter = TeamMask.all; break; } val.teamMaskFilter = teamMaskFilter; val.sortMode = (SortMode)2; val.RefreshCandidates(); val.FilterOutGameObject(((Component)this).gameObject); IEnumerable<HurtBox> results = val.GetResults(); HurtBox? obj = results.FirstOrDefault(); return ((obj != null) ? ((Component)obj).transform : null) ?? null; } } public class ComponentTracker<T> : Tracker where T : Component { public Func<T, bool> validFilter = DefaultFilter; private static bool DefaultFilter(T t) { return true; } public override Transform SearchForTarget() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) T[] array = Object.FindObjectsOfType<T>(); foreach (T val in array) { if (validFilter(val) && !(Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) > maxSearchDistance)) { Ray aimRay = inputBank.GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; Vector3 val2 = ((Component)val).transform.position - ((Component)this).transform.position; float num = Vector3.Dot(direction, ((Vector3)(ref val2)).normalized); if (!(num < base.minDot)) { return ((Component)val).transform; } } } return null; } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] internal sealed class AutoRunAttribute : Attribute { } internal sealed class AutoRunCollector { public static void HandleAutoRun() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); List<Type> list = types.ToList(); list.RemoveAll(asdf); types = list.ToArray(); Type[] array = types; foreach (Type type in array) { if (!type.FullName.Contains("CustomEmotesAPI")) { continue; } TypeInfo typeInfo = type.GetTypeInfo(); MethodInfo[] methods = typeInfo.GetMethods((BindingFlags)(-1)); foreach (MethodInfo methodInfo in methods) { AutoRunAttribute customAttribute = methodInfo.GetCustomAttribute<AutoRunAttribute>(); if (customAttribute != null && methodInfo.IsStatic) { methodInfo.Invoke(null, null); } } } } private static bool asdf(Type s) { return s.FullName.Contains("CustomEmotesAPI"); } } public class CallNetworkedMethod : INetMessage, ISerializableObject { private GameObject obj; private string method; private uint id; public CallNetworkedMethod(GameObject obj, string method) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) this.obj = obj; this.method = method; NetworkInstanceId netId = obj.GetComponent<NetworkIdentity>().netId; id = ((NetworkInstanceId)(ref netId)).Value; } public void Serialize(NetworkWriter writer) { writer.Write(id); writer.Write(method); } public void Deserialize(NetworkReader reader) { id = reader.ReadUInt32(); method = reader.ReadString(); } public void OnReceived() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) obj = Util.FindNetworkObject(new NetworkInstanceId(id)); obj.SendMessage(method, (SendMessageOptions)1); } public CallNetworkedMethod() { } } public class LockLocalTransform : MonoBehaviour { public Vector3 Position; public Vector3 Rotation; public Vector3 Scale; public void LateUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.localPosition = Position; ((Component)this).transform.localRotation = Quaternion.Euler(Rotation); ((Component)this).transform.localScale = Scale; } } public static class ConfigExtension { public static ConfigOption<T> ActiveBind<T>(this ConfigFile configWrapper, string categoryName, string configOptionName, T defaultValue, string fullDescription) { return new ConfigOption<T>(configWrapper, categoryName, configOptionName, defaultValue, fullDescription); } } public class ConfigOption<T> { private ConfigEntry<T> Bind; public ConfigOption(ConfigFile config, string categoryName, string configOptionName, T defaultValue, string fullDescription) { Bind = config.Bind<T>(categoryName, configOptionName, defaultValue, fullDescription); } public static implicit operator T(ConfigOption<T> x) { return x.Bind.Value; } public override string ToString() { return Bind.Value.ToString(); } } public class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public string identifier => "Sandswept"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.unlockableDefs.Add(Main.Unlocks.ToArray()); contentPack.effectDefs.Add(Main.EffectPrefabs.ConvertAll((Converter<GameObject, EffectDef>)((GameObject x) => new EffectDef(x))).ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } public static class DamageColourHelper { [CompilerGenerated] private static class <>O { public static hook_FindColor <0>__DamageColor_FindColor; } public static List<DamageColorIndex> registeredColorIndicies = new List<DamageColorIndex>(); internal static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__DamageColor_FindColor; if (obj == null) { hook_FindColor val = DamageColor_FindColor; <>O.<0>__DamageColor_FindColor = val; obj = (object)val; } DamageColor.FindColor += (hook_FindColor)obj; } private static Color DamageColor_FindColor(orig_FindColor orig, DamageColorIndex colorIndex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) if (registeredColorIndicies.Contains(colorIndex)) { return DamageColor.colors[colorIndex]; } return orig.Invoke(colorIndex); } public static DamageColorIndex RegisterDamageColor(Color color) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) int num = DamageColor.colors.Length; DamageColorIndex val = (DamageColorIndex)(byte)num; ArrayUtils.ArrayAppend<Color>(ref DamageColor.colors, ref color); registeredColorIndicies.Add(val); return val; } } public static class CharacterExtensions { public static bool HasSkillEquipped(this CharacterBody body, SkillDef skill) { GenericSkill[] components = ((Component)body).GetComponents<GenericSkill>(); foreach (GenericSkill val in components) { if ((Object)(object)val.skillDef == (Object)(object)skill) { return true; } } return false; } public static void ClearInventory(this CharacterBody body) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body.inventory)) { return; } List<ItemDef> list = new List<ItemDef>(); foreach (ItemIndex item in body.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); list.Add(itemDef); } foreach (ItemDef item2 in list) { body.inventory.RemoveItem(item2, body.inventory.GetItemCount(item2)); } } public static void ClearInventory(this CharacterBody body, bool hidden) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body.inventory)) { return; } List<ItemDef> list = new List<ItemDef>(); foreach (ItemIndex item in body.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (hidden) { list.Add(itemDef); } else if (!itemDef.hidden) { list.Add(itemDef); } } foreach (ItemDef item2 in list) { body.inventory.RemoveItem(item2, body.inventory.GetItemCount(item2)); } } } public static class EnumeratorExtensions { public static T GetRandom<T>(this IEnumerable<T> self) { return self.ElementAt(Random.Range(0, self.Count())); } public static T GetRandom<T>(this IEnumerable<T> self, Xoroshiro128Plus rng) { return self.ElementAt(rng.RangeInt(0, self.Count())); } public static T GetRandom<T>(this IEnumerable<T> self, Func<T, bool> predicate) { try { return self.Where(predicate).ElementAt(Random.Range(0, self.Count())); } catch { return default(T); } } public static T GetRandom<T>(this IEnumerable<T> self, Xoroshiro128Plus rng, Func<T, bool> predicate) { try { return self.Where(predicate).ElementAt(rng.RangeInt(0, self.Count())); } catch { return default(T); } } } public static class StringExtensions { public static void Add(this string str, string text) { LanguageAPI.Add(str, text); } public static void AddOverlay(this string str, string text) { LanguageAPI.AddOverlay(str, text); } public static T Load<T>(this string str) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) try { return Addressables.LoadAssetAsync<T>((object)str).WaitForCompletion(); } catch { return default(T); } } public static string RemoveUnsafeCharacters(this string str) { string[] array = new string[17] { "\n", "'", " ", "!", "`", "&", "-", ")", "(", "{", "}", "|", "@", "<", ">", ".", "\\" }; string text = str; string[] array2 = array; foreach (string oldValue in array2) { text = text.Replace(oldValue, ""); } return text; } public static string RemoveUnsafeCharacters(this string str, string[] unsafeChars) { string text = str; foreach (string oldValue in unsafeChars) { text = text.Replace(oldValue, ""); } return text; } public static string AutoFormat(this string str) { return Formatter.FormatString(str); } } internal class Formatter { internal struct Format { public string match; public string expanded; } private static List<Format> formats = new List<Format> { new Format { match = "$su", expanded = "<style=cIsUtility>" }, new Format { match = "$sd", expanded = "<style=cIsDamage>" }, new Format { match = "$ss", expanded = "<style=cStack>" }, new Format { match = "$sr", expanded = "<style=cDeath>" }, new Format { match = "$sh", expanded = "<style=cIsHealing>" }, new Format { match = "$se", expanded = "</style>" }, new Format { match = "$rc", expanded = "<color=#36D7A9>" }, new Format { match = "$ec", expanded = "</color>" }, new Format { match = "$pc", expanded = "<color=#406096>" }, new Format { match = "$sv", expanded = "<style=cIsVoid>" } }; internal static string FormatString(string str) { foreach (Format format in formats) { str = str.Replace(format.match, format.expanded); } return str; } } public static class UnityExtensions { public static void RemoveComponent<T>(this GameObject self) where T : Component { Object.Destroy((Object)(object)self.GetComponent<T>()); } public static void RemoveComponents<T>(this GameObject self) where T : Component { T[] components = self.GetComponents<T>(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } } public static void CallNetworkedMethod(this GameObject self, string method, NetworkDestination dest = 1) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) NetMessageExtensions.Send((INetMessage)(object)new CallNetworkedMethod(self, method), dest); } public static T FindComponent<T>(this GameObject self, string name) where T : Component { return self.GetComponentsInChildren<T>().FirstOrDefault((T x) => ((Object)((Component)x).gameObject).name == name); } public static void RemoveComponent<T>(this Component self) where T : Component { Object.Destroy((Object)(object)self.GetComponent<T>()); } public static void RemoveComponents<T>(this Component self) where T : Component { T[] components = self.GetComponents<T>(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } } public static T AddComponent<T>(this Component self) where T : Component { return self.gameObject.AddComponent<T>(); } public static Sprite MakeSprite(this Texture2D self) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) return Sprite.Create(new Rect(0f, 0f, 512f, 512f), new Vector2(256f, 256f), 1f, self); } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class HookAttribute : SearchableAttribute { public Type type; public string eventName; public HookAttribute(Type type, string eventName) { this.type = type; this.eventName = eventName; } } public class HookAttributeHandler { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnLoad <>9__0_0; internal IEnumerator <Hook>b__0_0(orig_OnLoad orig, RoR2Application self) { Initialize(); return orig.Invoke(self); } } [AutoRun] internal static void Hook() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { hook_OnLoad val = delegate(orig_OnLoad orig, RoR2Application self) { Initialize(); return orig.Invoke(self); }; <>c.<>9__0_0 = val; obj = (object)val; } RoR2Application.OnLoad += (hook_OnLoad)obj; } internal static void Initialize() { List<HookAttribute> list = new List<HookAttribute>(); SearchableAttribute.GetInstances<HookAttribute>(list); foreach (HookAttribute item in list) { if ((((SearchableAttribute)item).target as MethodInfo).IsStatic) { EventInfo @event = item.type.GetEvent(item.eventName); Delegate handler = Delegate.CreateDelegate(@event.EventHandlerType, null, ((SearchableAttribute)item).target as MethodInfo); @event.AddEventHandler(@event.DeclaringType, handler); } } } } public static class ItemHelpers { public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) List<Renderer> list = new List<Renderer>(); MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>(); if (componentsInChildren.Length != 0) { list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren); } SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>(); if (componentsInChildren2.Length != 0) { list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2); } RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count]; for (int i = 0; i < list.Count; i++) { if (debugmode) { MaterialControllerComponents.HGControllerFinder hGControllerFinder = ((Component)list[i]).gameObject.AddComponent<MaterialControllerComponents.HGControllerFinder>(); hGControllerFinder.Renderer = list[i]; } array[i] = new RendererInfo { defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material), renderer = list[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } public static string OrderManifestLoreFormatter(string deviceName, string estimatedDelivery, string sentTo, string trackingNumber, string devicePickupDesc, string shippingMethod, string orderDetails) { string[] value = new string[19] { "<align=left>Estimated Delivery:<indent=70%>Sent To:</indent></align>", "<align=left>" + estimatedDelivery + "<indent=70%>" + sentTo + "</indent></align>", "", "<indent=1%><style=cIsDamage><size=125%><u> Shipping Details:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</u></size></style></indent>", "", "<indent=2%>-Order: <style=cIsUtility>" + deviceName + "</style></indent>", "<indent=4%><style=cStack>Tracking Number: " + trackingNumber + "</style></indent>", "", "<indent=2%>-Order Description: " + devicePickupDesc + "</indent>", "", "<indent=2%>-Shipping Method: <style=cIsHealth>" + shippingMethod + "</style></indent>", "", "", "", "<indent=2%>-Order Details: " + orderDetails + "</indent>", "", "", "", "<style=cStack>Delivery being brought to you by the brand new </style><style=cIsUtility>Orbital Drop-Crate System (TM)</style>. <style=cStack><u>No refunds.</u></style>" }; return string.Join("\n", value); } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = duration; } } } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } int num = 0; foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = taperStart + (float)num * taperDuration; num++; } } } public static void AddBuffAndDot(BuffDef buff, float duration, int stackCount, CharacterBody body) { //IL_0033: 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_003b: Invalid comparison between Unknown and I4 //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } DotIndex val = (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff); for (int i = 0; i < stackCount; i++) { if ((int)val != -1) { DotController.InflictDot(((Component)body).gameObject, ((Component)body).gameObject, val, duration, 0.25f, (uint?)null); } else { body.AddTimedBuff(buff.buffIndex, duration); } } } public static DotIndex FindAssociatedDotForBuff(BuffDef buff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references)