Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of HarbCrateRevived v1.0.0
plugins/HarbCrateRevived/HarbCrateRevived.dll
Decompiled a day agousing System; 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 BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HG.Reflection; using HarbCrateRevived.Modules.Pickups; using HarbCrateRevived.Modules.StandaloneBuffs; using HarbCrateRevived.Modules.Utils; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2BepInExPack.GameAssetPathsBetter; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HarbCrateRevived")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c988079955e49d627ea90ee7f89be9a0c0585f20")] [assembly: AssemblyProduct("HarbCrateRevived")] [assembly: AssemblyTitle("HarbCrateRevived")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace HarbCrateRevived { internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber) { int num = callerPath.LastIndexOf("HarbCrateRevived"); if (num >= 0) { callerPath = callerPath.Substring(num + "HarbCrateRevived".Length + 1); } return $"{callerPath}:{callerLineNumber} ({callerMemberName}) "; } internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Error_NoCallerPrefix(object data) { _logSource.LogError(data); } internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Fatal_NoCallerPrefix(object data) { _logSource.LogFatal(data); } internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Info_NoCallerPrefix(object data) { _logSource.LogInfo(data); } internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Message_NoCallerPrefix(object data) { _logSource.LogMessage(data); } internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Warning_NoCallerPrefix(object data) { _logSource.LogWarning(data); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("Phreelosu.HarbCrateRevived", "HarbCrateRevived", "1.0.0")] public class Main : BaseUnityPlugin { public const string PluginGUID = "Phreelosu.HarbCrateRevived"; public const string PluginAuthor = "Phreelosu"; public const string PluginName = "HarbCrateRevived"; public const string PluginVersion = "1.0.0"; public static AssetBundle MainAssets; public List<BuffBase> Buffs = new List<BuffBase>(); public List<ItemBase> Items = new List<ItemBase>(); public List<EquipmentBase> Equipments = new List<EquipmentBase>(); public static Dictionary<ItemBase, bool> ItemStatusDictionary = new Dictionary<ItemBase, bool>(); public static Dictionary<EquipmentBase, bool> EquipmentStatusDictionary = new Dictionary<EquipmentBase, bool>(); internal static Main Instance { get; private set; } public void Awake() { Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HarbCrateRevived.harbcrate")) { MainAssets = AssetBundle.LoadFromStream(stream); } AssetHelpers.ConvertBundleMaterials(MainAssets); IEnumerable<Type> source = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract select type; Log.Info("--------------BUFFS---------------------", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Main.cs", "Awake", 54); foreach (Type item in source.Where((Type type) => type.IsSubclassOf(typeof(BuffBase)))) { BuffBase buffBase = (BuffBase)Activator.CreateInstance(item); buffBase.Init(((BaseUnityPlugin)this).Config); Buffs.Add(buffBase); Log.Info("Buff: " + buffBase.BuffName + " Initialized!", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Main.cs", "Awake", 60); } Log.Info("----------------------ITEMS--------------------", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Main.cs", "Awake", 63); foreach (Type item2 in source.Where((Type type) => type.IsSubclassOf(typeof(ItemBase)))) { ItemBase itemBase = (ItemBase)Activator.CreateInstance(item2); if (ValidateItem(itemBase, Items)) { itemBase.Init(((BaseUnityPlugin)this).Config); Log.Info("Item: " + itemBase.ItemName + " Initialized!", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Main.cs", "Awake", 70); } } Log.Info("-----------------EQUIPMENT---------------------", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Main.cs", "Awake", 74); foreach (Type item3 in source.Where((Type type) => type.IsSubclassOf(typeof(EquipmentBase)))) { EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item3); if (ValidateEquipment(equipmentBase, Equipments)) { equipmentBase.Init(((BaseUnityPlugin)this).Config); Log.Info("Equipment: " + equipmentBase.EquipmentName + " Initialized!", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Main.cs", "Awake", 81); } } } public bool ValidateItem(ItemBase item, List<ItemBase> itemList) { bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ConfigItemName, "Enable Item?", true, "Should this item appear in runs?").Value; ItemStatusDictionary.Add(item, value); if (value) { itemList.Add(item); } return value; } public bool ValidateEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList) { bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + equipment.ConfigEquipmentName, "Enable Equipment?", true, "Should this equipment appear in runs?").Value; EquipmentStatusDictionary.Add(equipment, value); if (value) { equipmentList.Add(equipment); } return value; } } } namespace HarbCrateRevived.Modules.Utils { internal static class AssetHelpers { private const float TransparentAlphaThreshold = 0.75f; public static void ConvertBundleMaterials(AssetBundle bundle) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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) Shader val = Addressables.LoadAssetAsync<Shader>((object)RoR2_Base_Shaders.HGStandard_shader).WaitForCompletion(); Material val2 = Addressables.LoadAssetAsync<Material>((object)RoR2_DLC1_HealingPotion.matHealingPotionGlass_mat).WaitForCompletion(); Material[] array = bundle.LoadAllAssets<Material>(); foreach (Material val3 in array) { Color color = val3.GetColor("_Color"); if (val3.renderQueue >= 3000 && color.a < 0.75f && Object.op_Implicit((Object)(object)val2)) { val3.shader = val2.shader; val3.CopyPropertiesFromMaterial(val2); val3.renderQueue = val2.renderQueue; val3.SetColor("_TintColor", new Color(color.r, color.g, color.b, 1f)); } else if (Object.op_Implicit((Object)(object)val)) { Texture texture = val3.GetTexture("_MainTex"); float num = val3.GetFloat("_Glossiness"); val3.shader = val; val3.shaderKeywords = null; val3.renderQueue = -1; val3.SetTexture("_MainTex", texture); val3.SetColor("_Color", new Color(color.r, color.g, color.b, 1f)); val3.SetFloat("_Smoothness", num); } else { Log.Warning("Could not convert material " + ((Object)val3).name + ", it will probably render pink.", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Modules\\Utils\\AssetHelpers.cs", "ConvertBundleMaterials", 48); } } } } internal class ItemHelpers { public static RendererInfo[] ItemDisplaySetup(GameObject obj) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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) 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++) { array[i] = new RendererInfo { defaultMaterial = list[i].sharedMaterial, renderer = list[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } public static GameObject SetupDisplayPrefab(GameObject prefab) { if (Object.op_Implicit((Object)(object)prefab) && !Object.op_Implicit((Object)(object)prefab.GetComponent<ItemDisplay>())) { prefab.AddComponent<ItemDisplay>().rendererInfos = ItemDisplaySetup(prefab); } return prefab; } } } namespace HarbCrateRevived.Modules.StandaloneBuffs { public abstract class BuffBase<T> : BuffBase where T : BuffBase<T> { public static T instance { get; private set; } public BuffBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting BuffBase was instantiated twice"); } instance = this as T; } } public abstract class BuffBase { public BuffDef BuffDef; public abstract string BuffName { get; } public abstract Color Color { get; } public virtual bool CanStack { get; } public virtual bool IsDebuff { get; } public virtual bool IsCooldown { get; } public virtual bool IsHidden { get; } public virtual Sprite BuffIcon { get; } = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common_MiscIcons.texMysteryIcon_png_texMysteryIcon_).WaitForCompletion(); public virtual void Init(ConfigFile config) { CreateBuff(); Hooks(); } public void CreateBuff() { //IL_0023: 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) BuffDef = ScriptableObject.CreateInstance<BuffDef>(); ((Object)BuffDef).name = BuffName; BuffDef.buffColor = Color; BuffDef.canStack = CanStack; BuffDef.isDebuff = IsDebuff; BuffDef.iconSprite = BuffIcon; BuffDef.isCooldown = IsCooldown; BuffDef.isHidden = IsHidden; ContentAddition.AddBuffDef(BuffDef); } public abstract void Hooks(); } public class DistillateBuff : BuffBase<DistillateBuff> { public const float LuckIncrease = 2f; public override string BuffName => "HC_LUCKJUICE_BUFF"; public override Color Color => Color.Lerp(Color.red, Color.yellow, 0.5f); public override Sprite BuffIcon => Main.MainAssets.LoadAsset<Sprite>("Assets/HarbCrate/DivDistillate/texBuffLuck.png"); public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody body, StatHookEventArgs args) { if (body.HasBuff(BuffDef)) { args.luckAdd += 2f; } }; } } } namespace HarbCrateRevived.Modules.Pickups { public abstract class EquipmentBase<T> : EquipmentBase where T : EquipmentBase<T> { public static T instance { get; private set; } public EquipmentBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBase was instantiated twice"); } instance = this as T; } } public abstract class EquipmentBase { public EquipmentDef EquipmentDef; public abstract string EquipmentName { get; } public string ConfigEquipmentName => EquipmentName.Replace("'", ""); public abstract string EquipmentLangTokenName { get; } public abstract string EquipmentPickupDesc { get; } public abstract string EquipmentFullDescription { get; } public abstract string EquipmentLore { get; } public virtual GameObject EquipmentModel { get; } = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Mystery.PickupMystery_prefab).WaitForCompletion(); public virtual Sprite EquipmentIcon { get; } = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common_MiscIcons.texMysteryIcon_png_texMysteryIcon_).WaitForCompletion(); public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public virtual bool CanDrop { get; } = true; public virtual float Cooldown { get; } = 60f; public virtual bool EnigmaCompatible { get; } = true; public virtual bool IsBoss { get; } public virtual bool IsLunar { get; } public virtual void Init(ConfigFile config) { CreateLang(); CreateEquipment(); Hooks(); } protected void CreateLang() { LanguageAPI.Add(EquipmentLangTokenName, EquipmentName); LanguageAPI.Add(EquipmentLangTokenName + "_PICKUP", EquipmentPickupDesc); LanguageAPI.Add(EquipmentLangTokenName + "_DESC", EquipmentFullDescription); LanguageAPI.Add(EquipmentLangTokenName + "_LORE", EquipmentLore); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateEquipment() { //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) EquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>(); ((Object)EquipmentDef).name = EquipmentLangTokenName; EquipmentDef.nameToken = EquipmentLangTokenName; EquipmentDef.pickupToken = EquipmentLangTokenName + "_PICKUP"; EquipmentDef.descriptionToken = EquipmentLangTokenName + "_DESC"; EquipmentDef.loreToken = EquipmentLangTokenName + "_LORE"; EquipmentDef.pickupModelPrefab = EquipmentModel; EquipmentDef.pickupIconSprite = EquipmentIcon; EquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer; EquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer; EquipmentDef.canDrop = CanDrop; EquipmentDef.cooldown = Cooldown; EquipmentDef.enigmaCompatible = EnigmaCompatible; EquipmentDef.isBoss = IsBoss; EquipmentDef.isLunar = IsLunar; if (IsLunar) { EquipmentDef.colorIndex = (ColorIndex)4; } ItemAPI.Add(new CustomEquipment(EquipmentDef, CreateItemDisplayRules())); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); } private bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)EquipmentDef) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); } protected abstract bool ActivateEquipment(EquipmentSlot slot); public abstract void Hooks(); protected static ItemDisplayRuleDict CreateThighDisplayRules(GameObject followerPrefab, Vector3 defaultScale) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleType ruleType = (ItemDisplayRuleType)0; ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighL", localPos = new Vector3(0.2f, 0.15f, 0f), localAngles = new Vector3(-0.0001368911f, 90.00013f, 180f), localScale = defaultScale * 0.3f } }); val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighR", localPos = new Vector3(-1.3f, 1.31f, 0.57f), localAngles = new Vector3(0.4302638f, 112.6148f, 178.8079f), localScale = defaultScale * 2f } }); val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighR", localPos = new Vector3(-0.17f, 0.18f, -0.07f), localAngles = new Vector3(0.1981713f, 89.21727f, 182.4698f), localScale = defaultScale * 0.3f } }); val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighL", localPos = new Vector3(0.129f, 0.043f, 0.105f), localAngles = new Vector3(0f, 120.74f, 186.3f), localScale = defaultScale * 0.25f } }); val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighR", localPos = new Vector3(-0.18f, 0.21f, 0.092f), localAngles = new Vector3(352.083f, 112.7895f, 178.7964f), localScale = defaultScale * 0.3f } }); val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighR", localPos = new Vector3(-0.1f, 0.24f, 0.107f), localAngles = new Vector3(354.2113f, 105f, 180f), localScale = defaultScale * 0.25f } }); val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighR", localPos = new Vector3(-0.16f, -0.7f, 0f), localAngles = new Vector3(356.9035f, 89.99998f, 180f), localScale = defaultScale * 0.3f } }); val.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "Chest", localPos = new Vector3(14.04f, 2.7f, 6.18f), localAngles = new Vector3(35f, 280.3f, 358.8f), localScale = defaultScale * 3f } }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "ThighL", localPos = new Vector3(-0.09f, 0.15f, 0.88f), localAngles = new Vector3(0.8589115f, 1.487932f, 240.0112f), localScale = defaultScale * 1.5f } }); val["mdlHAND"] = val["mdlToolbot"]; val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "PlatformBase", localPos = new Vector3(-0.702f, -0.046f, -0.017f), localAngles = new Vector3(0f, 261.7092f, 0f), localScale = defaultScale * 0.4f } }); return val; } } public abstract class ItemBase<T> : ItemBase where T : ItemBase<T> { public static T instance { get; private set; } public ItemBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice"); } instance = this as T; } } public abstract class ItemBase { public ItemDef ItemDef; public abstract string ItemName { get; } public string ConfigItemName => ItemName.Replace("'", ""); public abstract string ItemLangTokenName { get; } public abstract string ItemPickupDesc { get; } public abstract string ItemFullDescription { get; } public abstract string ItemLore { get; } public abstract ItemTier Tier { get; } public virtual ItemTag[] ItemTags { get; } = (ItemTag[])(object)new ItemTag[0]; public virtual GameObject ItemModel { get; } = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Mystery.PickupMystery_prefab).WaitForCompletion(); public virtual Sprite ItemIcon { get; } = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common_MiscIcons.texMysteryIcon_png_texMysteryIcon_).WaitForCompletion(); public virtual bool CanRemove { get; } = true; public virtual bool Hidden { get; } public virtual void Init(ConfigFile config) { CreateLang(); CreateItem(); Hooks(); } protected void CreateLang() { LanguageAPI.Add(ItemLangTokenName, ItemName); LanguageAPI.Add(ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add(ItemLangTokenName + "_DESC", ItemFullDescription); LanguageAPI.Add(ItemLangTokenName + "_LORE", ItemLore); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateItem() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown ItemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)ItemDef).name = ItemLangTokenName; ItemDef.nameToken = ItemLangTokenName; ItemDef.pickupToken = ItemLangTokenName + "_PICKUP"; ItemDef.descriptionToken = ItemLangTokenName + "_DESC"; ItemDef.loreToken = ItemLangTokenName + "_LORE"; ItemDef.pickupModelPrefab = ItemModel; ItemDef.pickupIconSprite = ItemIcon; ItemDef.hidden = Hidden; ItemDef.canRemove = CanRemove; ItemDef.deprecatedTier = Tier; ItemDef.tags = ItemTags; ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules())); } public abstract void Hooks(); public int GetCount(CharacterBody body) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return GetCount(body.inventory); } public int GetCount(Inventory inventory) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)inventory) || !Object.op_Implicit((Object)(object)ItemDef) || (int)ItemDef.itemIndex == -1) { return 0; } return inventory.GetItemCountEffective(ItemDef); } } } namespace HarbCrateRevived.Modules.Pickups.Items { internal class BrawnOverBrain : ItemBase<BrawnOverBrain> { public const float DebuffReduction = 0.5f; public override string ItemName => "Brawn over Brain"; public override string ItemLangTokenName => "HC_BOB"; public override string ItemPickupDesc => "A percentage of damage is taken from <style=cIsHealing>health</style> before <style=cIsHealing>shield</style>. <style=cIsUtility>50% debuff reduction</style> whilst you have <style=cIsHealing>shield</style>."; public override string ItemFullDescription => "<style=cIsUtility>50%</style><style=cStack>(+0% per stack)</style> <style=cIsUtility>debuff reduction</style> whilst you have <style=cIsHealing>shield</style>. <style=cIsUtility>40%</style><style=cStack>(+15% per stack)</style>* of damage taken is taken from <style=cIsHealing>health</style> before <style=cIsHealing>shield</style>. This damage <b>cannot</b> kill while you have enough <style=cIsHealing>shield</style>."; public override string ItemLore => "For loss, one must have\nFor defeat, one must try\n\nChange means to have an unnacceptable reality\n\nTo abandon, one must have\nTo win, one must try\n\nChange means to have an acceptable reality\n\nBeyond pain lies recovery\nBeyond rain lies the sun\n\nChange means to be wrong\n\nBefore disaster lies hope\nBefore death lies life\n\nChange means to be right\n\nAbandon then, your flesh.\nAbandon then, your frailty.\nCast your suffering away.\nEmbrace the balance between."; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)2 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset<GameObject>("Assets/HarbCrate/Tetrahdron/BoB.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset<Sprite>("Assets/HarbCrate/Tetrahdron/bob.png"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_000d: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_008c: 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_009d: 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_00c4: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) GameObject followerPrefab = ItemHelpers.SetupDisplayPrefab(ItemModel); ItemDisplayRuleType ruleType = (ItemDisplayRuleType)0; ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "Base", localScale = new Vector3(20f, 20f, 20f), localPos = new Vector3(-0.43f, -0.72f, -0.43f) } }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "Base", localScale = new Vector3(175f, 175f, 175f), localPos = new Vector3(3.39f, -8f, 3f) } }); val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "Base", localScale = new Vector3(175f, 175f, 175f), localPos = new Vector3(-3f, 4f, 3f) } }); val.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "Head", localScale = new Vector3(25f, 25f, 25f), localPos = new Vector3(-1.4f, 1f, -1f) } }); val["mdlEngiWalkerTurret"] = val["mdlEngiTurret"]; val.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = followerPrefab, ruleType = ruleType, childName = "Base", localScale = new Vector3(200f, 200f, 200f), localPos = new Vector3(-5f, 10f, 5f) } }); val["mdlHAND"] = val["mdlToolbot"]; return val; } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new Manipulator(NonLethalBypassShield); CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(ShortenTimedDebuffs); DotController.AddDot_GameObject_float_HurtBox_DotIndex_float_ProcChainMask_Nullable1_Nullable1_Nullable1 += new hook_AddDot_GameObject_float_HurtBox_DotIndex_float_ProcChainMask_Nullable1_Nullable1_Nullable1(ShortenDots); SetStateOnHurt.SetFrozen += new hook_SetFrozen(SetStateOnHurt_SetFrozen); SetStateOnHurt.SetStun += new hook_SetStun(SetStateOnHurt_SetStun); } public float GetReduction(CharacterBody body) { if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && GetCount(body) > 0 && body.healthComponent.shield > 0f) { return 0.5f; } return 1f; } private void SetStateOnHurt_SetFrozen(orig_SetFrozen orig, SetStateOnHurt self, float duration) { orig.Invoke(self, duration * GetReduction(((Component)self).GetComponent<CharacterBody>())); } private void SetStateOnHurt_SetStun(orig_SetStun orig, SetStateOnHurt self, float duration) { orig.Invoke(self, duration * GetReduction(((Component)self).GetComponent<CharacterBody>())); } private void ShortenDots(orig_AddDot_GameObject_float_HurtBox_DotIndex_float_ProcChainMask_Nullable1_Nullable1_Nullable1 orig, DotController self, GameObject attackerObject, float duration, HurtBox hitHurtBox, DotIndex dotIndex, float damageMultiplier, ProcChainMask procChainMask, uint? maxStacksFromAttacker, float? totalDamage, DotIndex? preUpgradeDotIndex) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, attackerObject, duration * GetReduction(Object.op_Implicit((Object)(object)self.victimObject) ? self.victimObject.GetComponent<CharacterBody>() : null), hitHurtBox, dotIndex, damageMultiplier, procChainMask, maxStacksFromAttacker, totalDamage, preUpgradeDotIndex); } private void ShortenTimedDebuffs(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration) { if (Object.op_Implicit((Object)(object)buffDef) && buffDef.isDebuff) { duration *= GetReduction(self); } orig.Invoke(self, buffDef, duration); } private void NonLethalBypassShield(ILContext il) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int damageLoc = -1; ILLabel val2 = default(ILLabel); if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref damageLoc), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<HealthComponent>(x, "shield") })) { Log.Error("Brawn over Brain: failed to find the shield damage step in HealthComponent.TakeDamageProcess, its health-before-shield effect is disabled.", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Modules\\Pickups\\Items\\BrawnOverBrain.cs", "NonLethalBypassShield", 154); return; } val.MoveAfterLabels(); val.Emit(OpCodes.Ldloc, damageLoc); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<float, HealthComponent, float>>((Func<float, HealthComponent, float>)delegate(float damage, HealthComponent self) { int count = GetCount(self.body); if (count > 0) { float num = damage * (0.09f + 0.90999997f * (1f - 2.13f / Mathf.Pow((float)count + 2.13f, 1f))); float num2 = Mathf.Min(self.health, 1f); float num3 = Mathf.Max(self.health - num, num2); num = self.health - num3; self.Networkhealth = num3; damage -= num; } return damage; }); val.Emit(OpCodes.Stloc, damageLoc); } } internal class Fragment : ItemBase<Fragment> { public const int FragmentsNeeded = 3; public const float RedChance = 5f; public override string ItemName => "Fragment"; public override string ItemLangTokenName => "HC_FRAGMENT"; public override string ItemPickupDesc => "A fragment of something greater."; public override string ItemFullDescription => "Every 3 of these you collect get turned into an item of a higher tier."; public override string ItemLore => "Do the stars tell us who we are?\nAfter wandering the stars for some decennia now, we can confidentily say,\n<b>\"yes\"</b>\nBecause you are either a spacefarer or you aren't.\nBut if asked if our fate is written there, I doubt it.\nThere's certainties everywhere if you are willing to look, but the stars are generally too far and too many to influence us.\n\nWe must choose our own fate, and grasp our own destiny."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)4 }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(MaybeAwardLoot); Chat.AddPickupMessage_CharacterBody_string_Color32_uint += new hook_AddPickupMessage_CharacterBody_string_Color32_uint(FixPickupMessage); Chat.AddPickupMessage_CharacterBody_string_Color32_uint_string += new hook_AddPickupMessage_CharacterBody_string_Color32_uint_string(FixPickupMessageFormatted); } private void FixPickupMessage(orig_AddPickupMessage_CharacterBody_string_Color32_uint orig, CharacterBody body, string pickupToken, Color32 pickupColor, uint pickupQuantity) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (pickupToken == ItemDef.nameToken && pickupQuantity == 0) { pickupQuantity = 3u; } orig.Invoke(body, pickupToken, pickupColor, pickupQuantity); } private void FixPickupMessageFormatted(orig_AddPickupMessage_CharacterBody_string_Color32_uint_string orig, CharacterBody body, string pickupToken, Color32 pickupColor, uint pickupQuantity, string pickupFormat) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (pickupToken == ItemDef.nameToken && pickupQuantity == 0) { pickupQuantity = 3u; } orig.Invoke(body, pickupToken, pickupColor, pickupQuantity, pickupFormat); } private void MaybeAwardLoot(orig_OnInventoryChanged orig, CharacterBody self) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_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_00bc: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self.inventory) || !Object.op_Implicit((Object)(object)Run.instance)) { return; } int itemCountPermanent = self.inventory.GetItemCountPermanent(ItemDef); if (itemCountPermanent <= 0 || itemCountPermanent % 3 != 0) { return; } self.inventory.RemoveItemPermanent(ItemDef, 3); List<PickupIndex> list = (Util.CheckRoll(5f, self.master) ? Run.instance.availableTier3DropList : Run.instance.availableTier2DropList); if (list.Count != 0) { PickupIndex val = Run.instance.treasureRng.NextElementUniform<PickupIndex>(list); if (self.isPlayerControlled) { PickupDropletController.CreatePickupDroplet(new UniquePickup(val), self.corePosition, Vector3.up * 5f, false); return; } PickupDef pickupDef = PickupCatalog.GetPickupDef(val); self.inventory.GiveItemPermanent(pickupDef.itemIndex, 1); int itemCountPermanent2 = self.inventory.GetItemCountPermanent(pickupDef.itemIndex); Chat.AddPickupMessage(self, pickupDef.nameToken, Color32.op_Implicit(pickupDef.baseColor), (uint)itemCountPermanent2); } } } public class NetworkedSI : NetworkBehaviour { public int multikills; public int cachedItemCount; private CharacterBody body; public int Networkmultikills { get { return multikills; } set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref multikills, 1u); } } private void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); } public void AddMultiKill() { Networkmultikills = multikills + 1; VerifyIntegrity(); } public void SetItemCount(int newCount) { cachedItemCount = newCount; VerifyIntegrity(); } private void VerifyIntegrity() { int val = cachedItemCount * 15; Networkmultikills = Math.Min(Math.Max(0, multikills), val); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.WritePackedUInt32((uint)multikills); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & 1) != 0) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; writer.WritePackedUInt32((uint)multikills); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { multikills = (int)reader.ReadPackedUInt32(); } else { if ((reader.ReadPackedUInt32() & 1) == 0) { return; } multikills = (int)reader.ReadPackedUInt32(); } if (Object.op_Implicit((Object)(object)body)) { body.MarkAllStatsDirty(); } } } internal class ShieldOnMultiKill : ItemBase<ShieldOnMultiKill> { public const float ShieldPerMK = 10f; public const int MultikillCountNeeded = 3; public const int MultikillsNeededForMaxValue = 15; public override string ItemName => "Obsidian Bouche"; public override string ItemLangTokenName => "HC_MAXSHIELDONMULTIKILL"; public override string ItemPickupDesc => "Gain maximum <style=cIsHealing>shield</style> on <style=cIsDamage>multikill</style>."; public override string ItemFullDescription => $"Gain {10f} additional maximum <style=cIsHealing>shield</style> on multikill." + $" Maximum <style=cIsHealing>shield</style> tops off at an additional {150f}<style=cStack>(+{150f} per stack)</style>."; public override string ItemLore => "Obsidian is an interesting material.\nUnlike what a popular games would have you believe, obsidian is relatively light and brittle.\nIt's a terrible material for shields.\nYou'll cut yourself on the edges and it will shatter on the slightest impact.\n\nHowever, a material made from the inside of a volcano has a certain charm to it.\nTo not acknowledge its mystical properties would be unwise.\nTherefore, we've build this shield.\nIt yearns to be back inside the volcano, to be inside the carnage, the heat.\n\nWill you fuel it, or break and shatter away?"; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)6 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset<GameObject>("Assets/HarbCrate/Obsidian_Shield/GhorsWay.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset<Sprite>("Assets/HarbCrate/Obsidian_Shield/Bouche.png"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_000d: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) GameObject followerPrefab = ItemHelpers.SetupDisplayPrefab(ItemModel); ItemDisplayRuleType ruleType = (ItemDisplayRuleType)0; ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "HandR", localPos = new Vector3(0f, 0f, 0.2f), localAngles = new Vector3(210f, 0f, 0f), localScale = new Vector3(25f, 25f, 25f) } }); val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "Chest", localPos = new Vector3(0f, 0f, -0.3f), localAngles = new Vector3(330f, 0f, 180f), localScale = new Vector3(25f, 25f, 25f) } }); val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "HandR", localPos = new Vector3(0f, 0f, 0.25f), localAngles = new Vector3(210f, 0f, 0f), localScale = new Vector3(25f, 25f, 25f) } }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "LowerArmR", localPos = new Vector3(-1f, 2.4f, 1.6f), localAngles = new Vector3(8f, 180f, 67f), localScale = new Vector3(200f, 200f, 200f) } }); val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "HandL", localPos = new Vector3(-0.48f, 1.31f, 0.55f), localAngles = new Vector3(338.5f, 228.5f, 280f), localScale = new Vector3(50f, 50f, 50f) } }); val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "MechLowerArmL", localPos = new Vector3(0.07f, 0.31f, -0.25f), localAngles = new Vector3(23.14f, 0f, 0f), localScale = new Vector3(25f, 25f, 25f) } }); val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "LowerArmR", localPos = new Vector3(-0.14f, 0.2f, 0.2f), localAngles = new Vector3(6f, 160f, 92f), localScale = new Vector3(25f, 25f, 25f) } }); val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "LowerArmR", localPos = new Vector3(2.5f, -0.59f, 1.67f), localAngles = new Vector3(0f, 255f, 0f), localScale = new Vector3(200f, 200f, 200f) } }); val.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "LegBar3", localPos = new Vector3(0f, 0.18f, 0.6f), localAngles = new Vector3(30f, 180f, 0f), localScale = new Vector3(75f, 75f, 75f) } }); val["mdlEngiWalkerTurret"] = val["mdlEngiTurret"]; val.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "Head", localPos = new Vector3(0f, -10f, -11f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(620f, 620f, 620f) } }); val.Add("mdlHAND", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = ruleType, followerPrefab = followerPrefab, childName = "UpperArmL", localPos = new Vector3(-0.97f, 0.53f, 0.37f), localAngles = new Vector3(49f, 92f, 0f), localScale = new Vector3(135f, 135f, 135f) } }); return val; } public override void Hooks() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddComponentToBodies)); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(AddFlatShields); CharacterBody.AddMultiKill += new hook_AddMultiKill(CharacterBodyOnAddMultiKill); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged); } private void AddComponentToBodies() { foreach (CharacterBody allBodyPrefabBodyBodyComponent in BodyCatalog.allBodyPrefabBodyBodyComponents) { if (Object.op_Implicit((Object)(object)allBodyPrefabBodyBodyComponent) && Object.op_Implicit((Object)(object)((Component)allBodyPrefabBodyBodyComponent).GetComponent<NetworkIdentity>()) && !Object.op_Implicit((Object)(object)((Component)allBodyPrefabBodyBodyComponent).GetComponent<NetworkedSI>())) { ((Component)allBodyPrefabBodyBodyComponent).gameObject.AddComponent<NetworkedSI>(); } } } private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { NetworkedSI component = ((Component)self).GetComponent<NetworkedSI>(); if (Object.op_Implicit((Object)(object)component)) { component.SetItemCount(GetCount(self)); self.MarkAllStatsDirty(); } else if (GetCount(self) > 0) { Log.Warning("Missing si component on " + ((Object)self).name + "!", "D:\\Games\\LostItems\\nemesisaddons\\harbcraterevived\\HarbCrateRevived\\Modules\\Pickups\\Items\\ShieldOnMultiKill.cs", "CharacterBody_OnInventoryChanged", 208); } } } private void AddFlatShields(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { NetworkedSI component = ((Component)sender).GetComponent<NetworkedSI>(); if (Object.op_Implicit((Object)(object)component)) { args.baseShieldAdd += (float)component.multikills * 10f; } } } private void CharacterBodyOnAddMultiKill(orig_AddMultiKill orig, CharacterBody self, int kills) { orig.Invoke(self, kills); if (Object.op_Implicit((Object)(object)self.inventory) && self.multiKillCount % 3 == 0 && GetCount(self) > 0) { NetworkedSI component = ((Component)self).GetComponent<NetworkedSI>(); if (Object.op_Implicit((Object)(object)component)) { component.AddMultiKill(); self.MarkAllStatsDirty(); } } } } } namespace HarbCrateRevived.Modules.Pickups.Equipments { internal class ColdSnap : EquipmentBase<ColdSnap> { public const float Radius = 16f; public const float FreezeDuration = 3f; private static GameObject delayBlastPrefab; private static GameObject explosionEffect; private static GameObject delayEffect; public override string EquipmentName => "Coldsnap"; public override string EquipmentLangTokenName => "HC_COLDSNAP"; public override string EquipmentPickupDesc => "<style=cIsUtility>Freeze</style> nearby enemies."; public override string EquipmentFullDescription => $"<style=cIsUtility>Freeze</style> nearby enemies for {3f} seconds. Frozen enemies can be <style=cIsDamage>executed</style>."; public override string EquipmentLore => "Order: \"Instant Antiheat Crystal\"\r\nTracking Number: 23******\r\nEstimated Delivery: 02/29/2056\r\nShipping Method: Standard/Fragile\r\nShipping Address: Tortoise Infrastructure, Salvador, Earth\r\nShipping Details:\r\n\r\nTo safeguard the interests of our clients, we need to up our fire proofing. I have ordered a test run of IACs for you. Install them and find out if they are worth investing into. "; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset<GameObject>("Assets/HarbCrate/IceShard/ColdSnap.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset<Sprite>("Assets/HarbCrate/IceShard/coldsnap.png"); public override float Cooldown => 64f; public override bool EnigmaCompatible => true; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_000b: 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) return EquipmentBase.CreateThighDisplayRules(ItemHelpers.SetupDisplayPrefab(EquipmentModel), Vector3.one * 60f); } public override void Hooks() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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) delayBlastPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common.GenericDelayBlast_prefab).WaitForCompletion(); explosionEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_EliteIce.AffixWhiteExplosion_prefab).WaitForCompletion(); delayEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_EliteIce.AffixWhiteDelayEffect_prefab).WaitForCompletion(); } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Invalid comparison between Unknown and I4 //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) CharacterBody characterBody = slot.characterBody; if (!Object.op_Implicit((Object)(object)characterBody) || !Object.op_Implicit((Object)(object)characterBody.teamComponent)) { return false; } Vector3 corePosition = characterBody.corePosition; TeamIndex val = (TeamIndex)0; while ((int)val < 6) { if (val != characterBody.teamComponent.teamIndex) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { Vector3 val2 = ((Component)teamMember).transform.position - corePosition; if (!(((Vector3)(ref val2)).sqrMagnitude > 256f)) { SetStateOnHurt component = ((Component)teamMember).GetComponent<SetStateOnHurt>(); if (Object.op_Implicit((Object)(object)component)) { component.SetFrozen(3f); } } } } val = (TeamIndex)(sbyte)(val + 1); } GameObject obj = Object.Instantiate<GameObject>(delayBlastPrefab, corePosition, Quaternion.identity); obj.transform.localScale = new Vector3(16f, 16f, 16f); DelayBlast component2 = obj.GetComponent<DelayBlast>(); component2.explosionEffect = explosionEffect; component2.delayEffect = delayEffect; component2.position = corePosition; component2.baseDamage = 0f; component2.baseForce = 0f; component2.radius = 16f; component2.maxTimer = 0.1f; component2.procCoefficient = 0f; obj.GetComponent<TeamFilter>().teamIndex = characterBody.teamComponent.teamIndex; NetworkServer.Spawn(obj); return true; } } internal class DivinationDistillate : EquipmentBase<DivinationDistillate> { public class DistillateBehaviour : MonoBehaviour { public float lifeTime = 7f; private float nextHealIn; private float intervalFraction; public HealthComponent hc; public CharacterBody cb; private void Awake() { intervalFraction = 1f / 35f; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)cb)) { cb.RemoveBuff(BuffBase<DistillateBuff>.instance.BuffDef); } } private void FixedUpdate() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) nextHealIn -= Time.fixedDeltaTime; lifeTime -= Time.fixedDeltaTime; if (nextHealIn < 0f || lifeTime < 0f) { nextHealIn += 0.2f; if (Object.op_Implicit((Object)(object)hc)) { hc.RechargeShield(hc.fullShield * 0.5f * intervalFraction); hc.Heal(hc.fullHealth * 0.2f * intervalFraction, default(ProcChainMask), true); } } if (!Object.op_Implicit((Object)(object)hc) || lifeTime <= 0f || (hc.fullHealth == hc.health && hc.shield == hc.fullShield && !hc.godMode)) { Object.Destroy((Object)(object)this); } } } public const float DistillateDuration = 7f; public const float Interval = 0.2f; public const float TotalHealthFraction = 0.2f; public const float TotalShieldFraction = 0.5f; public override string EquipmentName => "Divination Distillate"; public override string EquipmentLangTokenName => "HC_LUCKJUICE"; public override string EquipmentPickupDesc => "<style=cIsHealing>Heal</style> both <style=cIsHealing>health</style> and <style=cIsHealing>shield</style> for a short period of time. <style=cIsUtility>Luck</style> increased while active."; public override string EquipmentFullDescription => $"Heal both <style=cIsHealing>health</style> and <style=cIsHealing>shield</style> for {7f} seconds. Effects stops at full <style=cIsHealing>health</style> and full <style=cIsHealing>shield</style>." + " While under effect, your <style=cIsUtility>luck</style> is greatly increased."; public override string EquipmentLore => "Knowledge is fermented in pain and loss\nDistilled with reflection\nTo quench the thirst of those\nWho dream of enlightenment\n\nOpportunity is ripened in risk and rain\nRefined in a single moment\nTo fuel the hunger of those\nWho crave for avarice\n\n<i>Divination Distillate's model, effect and lore are deratives of Grinding Gear Games' version.</i>"; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset<GameObject>("Assets/HarbCrate/DivDistillate/LuckJuice.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset<Sprite>("Assets/HarbCrate/DivDistillate/luckjuice.png"); public override float Cooldown => 30f; public override bool EnigmaCompatible => false; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_000b: 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) return EquipmentBase.CreateThighDisplayRules(ItemHelpers.SetupDisplayPrefab(EquipmentModel), Vector3.one * 21f); } public override void Hooks() { } protected override bool ActivateEquipment(EquipmentSlot slot) { CharacterBody characterBody = slot.characterBody; if (!Object.op_Implicit((Object)(object)characterBody)) { return false; } HealthComponent healthComponent = characterBody.healthComponent; if (!Object.op_Implicit((Object)(object)healthComponent) || (healthComponent.health == healthComponent.fullHealth && healthComponent.shield == healthComponent.fullShield && !healthComponent.godMode)) { return false; } DistillateBehaviour distillateBehaviour = ((Component)characterBody).GetComponent<DistillateBehaviour>(); if (!Object.op_Implicit((Object)(object)distillateBehaviour)) { distillateBehaviour = ((Component)characterBody).gameObject.AddComponent<DistillateBehaviour>(); distillateBehaviour.hc = healthComponent; distillateBehaviour.cb = characterBody; } distillateBehaviour.lifeTime = 7f; characterBody.AddBuff(BuffBase<DistillateBuff>.instance.BuffDef); return true; } } internal class WrithingJar : EquipmentBase<WrithingJar> { public const float HostileDMG = 2f; public const float HostileHP = 4.7f; public const float AllyDMG = 1.5f; public const float AllyHP = 2f; private static SpawnCard hostileCard; private static SpawnCard friendCard; public override string EquipmentName => "The Writhing Jar"; public override string EquipmentLangTokenName => "HC_WORMJAR"; public override string EquipmentPickupDesc => "Inside of you there's two worms. One is a friend, the other a monster. You are a <color=blue>monster</color>."; public override string EquipmentFullDescription => "Summons a <style=cIsHealing>friendly</style> Magma Worm and a <style=cDeath>HOSTILE</style> <color=blue>Overloading Magma Worm</color>."; public override string EquipmentLore => "<style=cStack>Recovered from a half burned notebook, near unmarked research facility at [Redacted]</style>\r\n<style=cIsUtility>Day 4:</style>\nThe writings said the urn was the 'vessel of a great scourge', that it was a 'tremendous power that turned breath to smoke and flesh to ash'. Mikhail thinks it's just a jar of dead worms - probably a plague that they didn't understand and some leeches that they used to try and 'draw it out'.Or something. But... I'm not so sure. \n\n<style=cIsUtility>Day 12:</style>\nI've been having a dream lately, more or less the same every night. It's always there, almost like it's waiting. The air feels like being in an oven; heavy and so hot it feels like I'm going to burn up or dry out or both. I open up the lid, and reach inside. The skin on my fingers blisters and cracks. I push my hands in deeper and my flesh turns to char, and then to dust...but I don't feel anything. It's almost a relief, to be free from that heat. I fall inside, and my body turns to smoke that joins the darkness. It's a little bit unsettling, to be sure. And yet, I keep having this feeling like there's something more here. Something coiled just beneath the surface.\nI need to run some more tests. Maybe I can coax these dried husks back to life, or clone them, or something. Get some answers.\nI'll keep it to myself for now - Mikhail would just think I'm being stupid - but there is more to this jar than just a couple of silly little worms.\n<style=cStack>The rest of the log is unreadable.</style>"; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset<GameObject>("Assets/HarbCrate/2_Worm_Jar/WormJar.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset<Sprite>("Assets/HarbCrate/2_Worm_Jar/worm.png"); public override float Cooldown => 120f; public override bool IsLunar => true; public override bool EnigmaCompatible => true; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_000b: 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) return EquipmentBase.CreateThighDisplayRules(ItemHelpers.SetupDisplayPrefab(EquipmentModel), Vector3.one * 2.3f); } public override void Hooks() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) hostileCard = Addressables.LoadAssetAsync<SpawnCard>((object)RoR2_Base_ElectricWorm.cscElectricWorm_asset).WaitForCompletion(); friendCard = Addressables.LoadAssetAsync<SpawnCard>((object)RoR2_Base_MagmaWorm.cscMagmaWorm_asset).WaitForCompletion(); } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002f: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown DirectorPlacementRule val = new DirectorPlacementRule { placementMode = (PlacementMode)1, minDistance = 10f, maxDistance = 100f, spawnOnTarget = ((Component)slot).transform }; GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(hostileCard, val, RoR2Application.rng) { ignoreTeamMemberLimit = false, teamIndexOverride = (TeamIndex)2 }); if (Object.op_Implicit((Object)(object)val2)) { BoostMaster(val2.GetComponent<CharacterMaster>(), 2f, 4.7f); } GameObject val3 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(friendCard, val, RoR2Application.rng) { ignoreTeamMemberLimit = false, teamIndexOverride = (TeamIndex)1, summonerBodyObject = (Object.op_Implicit((Object)(object)slot.characterBody) ? ((Component)slot.characterBody).gameObject : null) }); if (Object.op_Implicit((Object)(object)val3)) { BoostMaster(val3.GetComponent<CharacterMaster>(), 1.5f, 2f); } if (!Object.op_Implicit((Object)(object)val2)) { return Object.op_Implicit((Object)(object)val3); } return true; } private static void BoostMaster(CharacterMaster master, float damageMultiplier, float healthMultiplier) { if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory)) { master.inventory.GiveItemPermanent(Items.BoostDamage, GetItemCountFromMultiplier(damageMultiplier)); master.inventory.GiveItemPermanent(Items.BoostHp, GetItemCountFromMultiplier(healthMultiplier)); } } private static int GetItemCountFromMultiplier(float multiplier) { if (multiplier <= 1f) { return 0; } return Mathf.CeilToInt((multiplier - 1f) * 10f); } } }