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 LowKeyMidItems v1.0.2
LowKeyMidItems.dll
Decompiled 18 hours agousing System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HG; using LowKeyMidItems.Items; using Microsoft.CodeAnalysis; using On.RoR2; using R2API; using RoR2; using RoR2.Projectile; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LowKeyMidItems")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LowKeyMidItems")] [assembly: AssemblyTitle("LowKeyMidItems")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.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 LowKeyMidItems { internal static class BossDrops { [CompilerGenerated] private static class <>O { public static hook_DropRewards <0>__AddToBossDrops; } private static readonly List<ItemDef> items = new List<ItemDef>(); private static readonly FieldInfo bossDropsField = typeof(BossGroup).GetField("bossDrops", BindingFlags.Instance | BindingFlags.NonPublic); public static void Add(ItemDef itemDef) { //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_0027: Expected O, but got Unknown if (items.Count == 0) { object obj = <>O.<0>__AddToBossDrops; if (obj == null) { hook_DropRewards val = AddToBossDrops; <>O.<0>__AddToBossDrops = val; obj = (object)val; } BossGroup.DropRewards += (hook_DropRewards)obj; } items.Add(itemDef); } private static void AddToBossDrops(orig_DropRewards orig, BossGroup self) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_006f: Unknown result type (might be due to invalid IL or missing references) if (bossDropsField?.GetValue(self) is List<UniquePickup> list) { foreach (ItemDef item in items) { PickupIndex pickupIndex = PickupCatalog.FindPickupIndex(item.itemIndex); if (((PickupIndex)(ref pickupIndex)).isValid && !list.Exists((UniquePickup drop) => drop.pickupIndex == pickupIndex)) { list.Add(new UniquePickup(pickupIndex)); } } } orig.Invoke(self); } } internal static class ItemFactory { private static readonly FieldInfo itemTierDefField = typeof(ItemDef).GetField("_itemTierDef", BindingFlags.Instance | BindingFlags.NonPublic); private static string TierDefKey(ItemTier tier) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected I4, but got Unknown return (int)tier switch { 0 => "RoR2/Base/Common/Tier1Def.asset", 1 => "RoR2/Base/Common/Tier2Def.asset", 2 => "RoR2/Base/Common/Tier3Def.asset", 3 => "RoR2/Base/Common/LunarTierDef.asset", 4 => "RoR2/Base/Common/BossTierDef.asset", 6 => "RoR2/DLC1/Common/VoidTier1Def.asset", 7 => "RoR2/DLC1/Common/VoidTier2Def.asset", 11 => "RoR2/DLC4/CursedTierDef.asset", 13 => "RoR2/DLC4/HexDef.asset", _ => null, }; } public static ItemDef CreateItem(string id, string iconName, ItemTier tier, string displayName, string pickup, string description, string lore, params ItemTag[] tags) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown string text = "LKM_" + id.ToUpperInvariant(); ItemDef val = ScriptableObject.CreateInstance<ItemDef>(); ((Object)val).name = "LKM_" + id; val.nameToken = text + "_NAME"; val.pickupToken = text + "_PICKUP"; val.descriptionToken = text + "_DESC"; val.loreToken = text + "_LORE"; itemTierDefField.SetValue(val, ModAssets.Load<ItemTierDef>(TierDefKey(tier))); val.tags = tags; val.canRemove = true; val.hidden = false; val.pickupModelPrefab = ModAssets.CreatePickupModel(sprite: val.pickupIconSprite = ModAssets.LoadSprite(iconName), name: ((Object)val).name); AddTokens(text, displayName, pickup, description, lore); ItemAPI.Add(new CustomItem(val, new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()))); return val; } public static EquipmentDef CreateEquipment(string id, string iconName, float cooldown, string displayName, string pickup, string description, string lore) { //IL_0090: 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_00d2: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown string text = "LKM_" + id.ToUpperInvariant(); EquipmentDef obj = ScriptableObject.CreateInstance<EquipmentDef>(); ((Object)obj).name = "LKM_" + id; obj.nameToken = text + "_NAME"; obj.pickupToken = text + "_PICKUP"; obj.descriptionToken = text + "_DESC"; obj.loreToken = text + "_LORE"; obj.cooldown = cooldown; obj.canDrop = true; obj.enigmaCompatible = true; obj.appearsInSinglePlayer = true; obj.appearsInMultiPlayer = true; obj.colorIndex = (ColorIndex)5; Sprite sprite = (obj.pickupIconSprite = ModAssets.LoadSprite(iconName)); obj.pickupModelPrefab = ModAssets.CreatePickupModel(((Object)obj).name, sprite); AddTokens(text, displayName, pickup, description, lore); ItemAPI.Add(new CustomEquipment(obj, new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()))); return obj; } private static void AddTokens(string token, string displayName, string pickup, string description, string lore) { LanguageAPI.Add(token + "_NAME", displayName); LanguageAPI.Add(token + "_PICKUP", pickup); LanguageAPI.Add(token + "_DESC", description); LanguageAPI.Add(token + "_LORE", lore); } public static int Count(CharacterBody body, ItemDef def) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCountEffective(def); } public static int Count(CharacterMaster master, ItemDef def) { if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory)) { return 0; } return master.inventory.GetItemCountEffective(def); } } internal static class Minions { public static GameObject CloneBody(string key, string name, string nameToken, string displayName, Sprite portrait) { GameObject obj = PrefabAPI.InstantiateClone(ModAssets.Load<GameObject>(key), name, true); CharacterBody component = obj.GetComponent<CharacterBody>(); component.baseNameToken = nameToken; if (Object.op_Implicit((Object)(object)portrait)) { component.portraitIcon = (Texture)(object)portrait.texture; } LanguageAPI.Add(nameToken, displayName); ContentAddition.AddBody(obj); return obj; } public static GameObject CloneMaster(string key, string name, GameObject bodyPrefab) { GameObject obj = PrefabAPI.InstantiateClone(ModAssets.Load<GameObject>(key), name, true); obj.GetComponent<CharacterMaster>().bodyPrefab = bodyPrefab; ContentAddition.AddMaster(obj); return obj; } public static CharacterMaster Summon(GameObject masterPrefab, CharacterBody owner) { //IL_0001: 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_0024: 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_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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0055: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0079: Unknown result type (might be due to invalid IL or missing references) Vector3 position = owner.footPosition + Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward * 4f + Vector3.up; CharacterMaster val = new MasterSummon { masterPrefab = masterPrefab, position = position, rotation = Quaternion.identity, summonerBodyObject = ((Component)owner).gameObject, ignoreTeamMemberLimit = true, useAmbientLevel = false }.Perform(); if (Object.op_Implicit((Object)(object)val)) { val.inventory.GiveItemPermanent(Items.MinionLeash, 1); } return val; } } internal static class ModAssets { private static readonly Dictionary<string, Sprite> sprites = new Dictionary<string, Sprite>(); public static T Load<T>(string key) where T : Object { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) T val = Addressables.LoadAssetAsync<T>((object)key).WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val)) { LowKeyMidItemsPlugin.Log.LogError((object)("Missing addressable asset '" + key + "'")); } return val; } public static Sprite LoadSprite(string name) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_00ad: 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) if (sprites.TryGetValue(name, out var value)) { return value; } using Stream stream = typeof(ModAssets).Assembly.GetManifestResourceStream("LowKeyMidItems." + name + ".png"); if (stream == null) { LowKeyMidItemsPlugin.Log.LogError((object)("Missing embedded icon '" + name + "'")); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Object)val).name = name; Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); ((Object)val2).name = name; sprites[name] = val2; return val2; } public static GameObject CreatePickupModel(string name, Sprite sprite) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name + "Pickup"); GameObject val2 = new GameObject("Drawing"); val2.transform.SetParent(val.transform, false); val2.transform.localRotation = Quaternion.Euler(0f, 45f, 0f); val2.AddComponent<SpriteRenderer>().sprite = sprite; val2.AddComponent<FaceCamera>(); GameObject result = PrefabAPI.InstantiateClone(val, name + "Pickup", false); Object.Destroy((Object)(object)val); return result; } public static void SpawnEffect(GameObject effectPrefab, Vector3 position, float scale) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0023: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)effectPrefab)) { EffectManager.SpawnEffect(effectPrefab, new EffectData { origin = position, scale = scale }, true); } } } internal class FaceCamera : MonoBehaviour { private void LateUpdate() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) ReadOnlyCollection<CameraRigController> readOnlyInstancesList = CameraRigController.readOnlyInstancesList; if (readOnlyInstancesList.Count != 0 && Object.op_Implicit((Object)(object)readOnlyInstancesList[0].sceneCam)) { ((Component)this).transform.rotation = ((Component)readOnlyInstancesList[0].sceneCam).transform.rotation; } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.lowkeymid.LowKeyMidItems", "LowKeyMidItems", "1.0.2")] public class LowKeyMidItemsPlugin : BaseUnityPlugin { public const string GUID = "com.lowkeymid.LowKeyMidItems"; public const string Name = "LowKeyMidItems"; public const string Version = "1.0.2"; internal static ManualLogSource Log; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Plunger.Init(); FeralScrungler.Init(); VoraciousFangs.Init(); Thingamajig.Init(); MurderousPrawn.Init(); LitanousGrub.Init(); TwistedBaculum.Init(); OrbitalStrikeCannon.Init(); KrombCore.Init(); ChaliceOfBlood.Init(); HexOfMildDiscomfort.Init(); HexOfDismemberment.Init(); VoidCorruption.Init(); Log.LogInfo((object)"Loaded. +10% whatever."); } } } namespace LowKeyMidItems.Items { internal static class ChaliceOfBlood { [CompilerGenerated] private static class <>O { public static hook_OnSkillActivated <0>__OnSkillActivated; } public static ItemDef ItemDef; private const float BlibChance = 10f; private const float BlibRange = 60f; public static void Init() { //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_0065: Expected O, but got Unknown ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ItemDef = ItemFactory.CreateItem("ChaliceOfBlood", "ChaliceOfBlood", (ItemTier)11, "Chalice of Blood", "Click a button for a chance to apply blib. Apply blib to win the run.", "When you click a button, gain a <style=cIsUtility>10%</style> chance to apply <style=cIsDamage>blib</style> to an enemy. Whenever you apply blib to an enemy, <style=cIsUtility>win the run</style>.\n<style=cSub>(There are several other items that also apply blib or interact with blib.)</style>", "Not to be confused with any other chalice, sanguine or otherwise. This one is of blood. Totally different.\n\nThe inscription on the base reads: \"blib = win\".", (ItemTag[])(object)array); LanguageAPI.Add("LKM_CHALICE_WIN", "<color=#c4002b>{0} applied blib. The Chalice of Blood is satisfied.</color>"); object obj = <>O.<0>__OnSkillActivated; if (obj == null) { hook_OnSkillActivated val = OnSkillActivated; <>O.<0>__OnSkillActivated = val; obj = (object)val; } CharacterBody.OnSkillActivated += (hook_OnSkillActivated)obj; } private static void OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { orig.Invoke(self, skill); if (NetworkServer.active && ItemFactory.Count(self, ItemDef) > 0 && Util.CheckRoll(10f, self.master)) { CharacterBody val = FindTarget(self); if (Object.op_Implicit((Object)(object)val)) { FeralScrungler.ApplyBlib(val, self.master); } } } private static CharacterBody FindTarget(CharacterBody self) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_0061: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0090: Unknown result type (might be due to invalid IL or missing references) BullseyeSearch val = new BullseyeSearch { searchOrigin = (Object.op_Implicit((Object)(object)self.inputBank) ? self.inputBank.aimOrigin : self.corePosition), searchDirection = (Object.op_Implicit((Object)(object)self.inputBank) ? self.inputBank.aimDirection : ((Component)self).transform.forward), maxDistanceFilter = 60f, maxAngleFilter = 180f, teamMaskFilter = TeamMask.GetEnemyTeams(self.teamComponent.teamIndex), filterByLoS = true, sortMode = (SortMode)1 }; val.RefreshCandidates(); foreach (HurtBox result in val.GetResults()) { if (Object.op_Implicit((Object)(object)result.healthComponent) && result.healthComponent.alive) { return result.healthComponent.body; } } return null; } public static void OnBlibApplied(CharacterMaster source) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)source) && ItemFactory.Count(source, ItemDef) > 0) { Run instance = Run.instance; if (Object.op_Implicit((Object)(object)instance) && !instance.isGameOverServer) { CharacterBody body = source.GetBody(); SimpleChatMessage val = new SimpleChatMessage(); val.baseToken = "LKM_CHALICE_WIN"; val.paramTokens = new string[1] { Object.op_Implicit((Object)(object)body) ? body.GetUserName() : "Someone" }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); instance.BeginGameOver(GameEndings.MainEnding); } } } } internal static class FeralScrungler { [CompilerGenerated] private static class <>O { public static Action<DamageReport> <0>__OnCharacterDeath; public static hook_TakeDamage <1>__ApplyBlib; } public static ItemDef ItemDef; public static BuffDef Blib; private const float EliteDeathRadius = 40f; private const float BlibDuration = 15f; private static GameObject scrunglerBodyPrefab; private static GameObject scrunglerMasterPrefab; private static GameObject bubblePrefab; private static readonly List<CharacterBody> livingScrunglers = new List<CharacterBody>(); public static void Init() { //IL_007a: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown ItemDef = ItemFactory.CreateItem("FeralScrungler", "FeralScrungler", (ItemTier)1, "Feral Scrungler", "Tiny chance on kill to summon the scrungler. Elites that die near it leave gagwini bubbles.", "<style=cIsUtility>1%</style> <style=cStack>(+0.0005% per stack)</style> chance on kill to summon <style=cIsUtility>the scrungler</style>. While the scrungler is alive, <style=cIsDamage>elite monsters</style> that die near it create a <style=cIsUtility>gagwini bubble</style> on death. The gagwini bubble applies <style=cIsDamage>1</style> stack of <style=cIsDamage>blib</style> to monsters inside it. Blib increases damage from <style=cIsDamage>electric attacks</style> by <style=cIsDamage>3%</style> <style=cStack>(+1% per stack)</style>. When the scrungler dies, it pops into one final gagwini bubble.", "It was in the vents. It has always been in the vents.\n\nDo not make eye contact with the scrungler. Do not feed the scrungler. If the scrungler offers you a gagwini, accept it. You do not want to know what happens if you refuse.", (ItemTag)1, (ItemTag)6); Blib = ScriptableObject.CreateInstance<BuffDef>(); ((Object)Blib).name = "LKM_Blib"; Blib.canStack = true; Blib.isDebuff = true; Blib.buffColor = new Color(0.55f, 1f, 0.35f); Blib.iconSprite = ModAssets.LoadSprite("FeralScrungler"); ContentAddition.AddBuffDef(Blib); scrunglerBodyPrefab = Minions.CloneBody("RoR2/Base/Imp/ImpBody.prefab", "LKMScrunglerBody", "LKM_SCRUNGLER_BODY_NAME", "The Scrungler", ModAssets.LoadSprite("FeralScrungler")); scrunglerMasterPrefab = Minions.CloneMaster("RoR2/Base/Imp/ImpMaster.prefab", "LKMScrunglerMaster", scrunglerBodyPrefab); bubblePrefab = CreateBubblePrefab(); CharacterBody.onBodyStartGlobal += delegate(CharacterBody body) { if (IsScrungler(body)) { livingScrunglers.Add(body); } }; CharacterBody.onBodyDestroyGlobal += delegate(CharacterBody body) { livingScrunglers.Remove(body); }; GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeath; object obj = <>O.<1>__ApplyBlib; if (obj == null) { hook_TakeDamage val = ApplyBlib; <>O.<1>__ApplyBlib = val; obj = (object)val; } HealthComponent.TakeDamage += (hook_TakeDamage)obj; } private static bool IsScrungler(CharacterBody body) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0012: 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) if (Object.op_Implicit((Object)(object)body) && (int)body.bodyIndex != -1) { return body.bodyIndex == BodyCatalog.FindBodyIndex(scrunglerBodyPrefab); } return false; } private static GameObject CreateBubblePrefab() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("LKMGagwiniBubble"); val.AddComponent<NetworkIdentity>(); GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)obj).name = "Sphere"; Object.DestroyImmediate((Object)(object)obj.GetComponent<Collider>()); ((Renderer)obj.GetComponent<MeshRenderer>()).sharedMaterial = ModAssets.Load<Material>("RoR2/Base/Clay/matClayBubble.mat"); obj.transform.SetParent(val.transform, false); obj.transform.localScale = Vector3.zero; val.AddComponent<GagwiniBubble>(); GameObject result = PrefabAPI.InstantiateClone(val, "LKMGagwiniBubble", true); Object.Destroy((Object)(object)val); return result; } private static void SpawnBubble(Vector3 position, TeamIndex team, CharacterMaster owner) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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) GameObject obj = Object.Instantiate<GameObject>(bubblePrefab, position, Quaternion.identity); GagwiniBubble component = obj.GetComponent<GagwiniBubble>(); component.teamIndex = team; component.ownerMaster = owner; NetworkServer.Spawn(obj); } private static CharacterMaster OwnerOf(CharacterBody scrungler) { if (!Object.op_Implicit((Object)(object)scrungler.master)) { return null; } return scrungler.master.minionOwnership.ownerMaster; } public static void ApplyBlib(CharacterBody target, CharacterMaster source) { target.AddTimedBuff(Blib, 15f); ChaliceOfBlood.OnBlibApplied(source); } private static void OnCharacterDeath(DamageReport report) { //IL_0025: 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_0087: 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_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) //IL_00ab: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)report.victimBody)) { return; } CharacterBody victimBody = report.victimBody; if (IsScrungler(victimBody)) { SpawnBubble(victimBody.corePosition, victimBody.teamComponent.teamIndex, OwnerOf(victimBody)); } else if (report.victimIsElite) { foreach (CharacterBody livingScrungler in livingScrunglers) { if (Object.op_Implicit((Object)(object)livingScrungler) && livingScrungler.healthComponent.alive && TeamManager.IsTeamEnemy(livingScrungler.teamComponent.teamIndex, victimBody.teamComponent.teamIndex)) { Vector3 val = livingScrungler.corePosition - victimBody.corePosition; if (!(((Vector3)(ref val)).sqrMagnitude > 1600f)) { SpawnBubble(victimBody.corePosition, livingScrungler.teamComponent.teamIndex, OwnerOf(livingScrungler)); break; } } } } CharacterMaster attackerMaster = report.attackerMaster; int num = ItemFactory.Count(attackerMaster, ItemDef); if (num > 0 && Object.op_Implicit((Object)(object)report.attackerBody) && !OwnsScrungler(attackerMaster) && Util.CheckRoll(1f + 0.0005f * (float)(num - 1), attackerMaster)) { Minions.Summon(scrunglerMasterPrefab, report.attackerBody); } } private static bool OwnsScrungler(CharacterMaster owner) { foreach (CharacterBody livingScrungler in livingScrunglers) { if (Object.op_Implicit((Object)(object)livingScrungler) && Object.op_Implicit((Object)(object)livingScrungler.master) && (Object)(object)livingScrungler.master.minionOwnership.ownerMaster == (Object)(object)owner) { return true; } } return false; } private static void ApplyBlib(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0013: 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) if (Object.op_Implicit((Object)(object)self.body) && (damageInfo.damageType.damageTypeExtended & 0x2000) != 0) { int buffCount = self.body.GetBuffCount(Blib); if (buffCount > 0) { damageInfo.damage *= 1.03f + 0.01f * (float)(buffCount - 1); } } orig.Invoke(self, damageInfo); } } internal class GagwiniBubble : MonoBehaviour { private const float Radius = 10f; private const float Lifetime = 8f; private const float PulseInterval = 0.5f; public TeamIndex teamIndex; public CharacterMaster ownerMaster; private Transform sphere; private float age; private float pulseTimer; private readonly HashSet<HealthComponent> blibbed = new HashSet<HealthComponent>(); private void Awake() { sphere = ((Component)this).transform.Find("Sphere"); } private void Update() { //IL_0042: 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) age += Time.deltaTime; float num = Mathf.Clamp01(age / 0.3f) * Mathf.Clamp01((8f - age) / 0.4f); sphere.localScale = Vector3.one * (20f * num); } private void FixedUpdate() { if (NetworkServer.active) { pulseTimer -= Time.fixedDeltaTime; if (pulseTimer <= 0f) { pulseTimer = 0.5f; Pulse(); } if (age >= 8f) { NetworkServer.Destroy(((Component)this).gameObject); } } } private void Pulse() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_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) TeamMask enemyTeams = TeamMask.GetEnemyTeams(teamIndex); TeamIndex val = (TeamIndex)0; while ((int)val < 6) { if (((TeamMask)(ref enemyTeams)).HasTeam(val)) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { CharacterBody body = teamMember.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive) { Vector3 val2 = body.corePosition - ((Component)this).transform.position; if (!(((Vector3)(ref val2)).sqrMagnitude > 100f) && blibbed.Add(body.healthComponent)) { FeralScrungler.ApplyBlib(body, ownerMaster); } } } } val = (TeamIndex)(sbyte)(val + 1); } } } internal static class HexOfMildDiscomfort { public static ItemDef ItemDef; private const float UpdateInterval = 0.5f; private static float updateTimer; public static void Init() { ItemDef = ItemFactory.CreateItem("HexOfMildDiscomfort", "HexOfMildDiscomfort", (ItemTier)13, "Hex of Mild Discomfort", "All chests cost 1 extra gold.", "All chests cost <style=cDeath>1</style> <style=cStack>(+1 per stack)</style> extra gold. <style=cDeath>Scales with time.</style>\n<style=cSub>Stacks from every player add up.</style>", "It's only one gold. What's one gold? Don't worry about it.\n\nDon't look at the fine print either.", (ItemTag)4, (ItemTag)13); RoR2Application.onFixedUpdate += UpdateChestPrices; } private static void UpdateChestPrices() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Invalid comparison between Unknown and I4 if (!NetworkServer.active || !Object.op_Implicit((Object)(object)Run.instance)) { return; } updateTimer -= Time.fixedDeltaTime; if (updateTimer > 0f) { return; } updateTimer = 0.5f; int num = 0; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { num += ItemFactory.Count(instance.master, ItemDef); } float difficultyCoefficient = Run.instance.difficultyCoefficient; int num2 = num * Mathf.CeilToInt(difficultyCoefficient * difficultyCoefficient); foreach (ChestBehavior instances in InstanceTracker.GetInstancesList<ChestBehavior>()) { PurchaseInteraction component = ((Component)instances).GetComponent<PurchaseInteraction>(); if (!Object.op_Implicit((Object)(object)component) || (int)component.costType != 1 || !component.available) { continue; } DiscomfortFee discomfortFee = ((Component)instances).GetComponent<DiscomfortFee>(); if (!Object.op_Implicit((Object)(object)discomfortFee)) { if (num2 == 0) { continue; } discomfortFee = ((Component)instances).gameObject.AddComponent<DiscomfortFee>(); } if (component.cost != discomfortFee.baseCost + discomfortFee.fee) { discomfortFee.baseCost = component.cost - discomfortFee.fee; } if (discomfortFee.fee != num2) { discomfortFee.fee = num2; component.Networkcost = discomfortFee.baseCost + num2; } } } } internal class DiscomfortFee : MonoBehaviour { public int baseCost; public int fee; } internal static class HexOfDismemberment { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__1_0; public static Action<CharacterBody> <>9__1_1; public static hook_UpdateModelTransform <>9__1_2; internal void <Init>b__1_0(CharacterBody body, StatHookEventArgs args) { if (ItemFactory.Count(body, ItemDef) > 0) { args.jumpPowerTotalMult = 0f; } } internal void <Init>b__1_1(CharacterBody body) { body.AddItemBehavior<DismembermentBehavior>(ItemFactory.Count(body, ItemDef)); } internal void <Init>b__1_2(orig_UpdateModelTransform orig, ModelLocator self, float deltaTime) { orig.Invoke(self, deltaTime); DismembermentBehavior component = ((Component)self).GetComponent<DismembermentBehavior>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)self.modelTransform)) { component.Crawl(self.modelTransform); } } } public static ItemDef ItemDef; public static void Init() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown ItemDef = ItemFactory.CreateItem("HexOfDismemberment", "HexOfDismemberment", (ItemTier)13, "Hex of Dismemberment", "Your character loses their legs.", "Your character <style=cDeath>loses their legs</style>. You can no longer jump, and have to crawl everywhere.\n<style=cSub>Fuck you.</style>", "Good news: Petrichor V is surprisingly wheelchair accessible.\n\nBad news: everything else.", (ItemTag)4, (ItemTag)13); object obj = <>c.<>9__1_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody body, StatHookEventArgs args) { if (ItemFactory.Count(body, ItemDef) > 0) { args.jumpPowerTotalMult = 0f; } }; <>c.<>9__1_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; CharacterBody.onBodyInventoryChangedGlobal += delegate(CharacterBody body) { body.AddItemBehavior<DismembermentBehavior>(ItemFactory.Count(body, ItemDef)); }; object obj2 = <>c.<>9__1_2; if (obj2 == null) { hook_UpdateModelTransform val2 = delegate(orig_UpdateModelTransform orig, ModelLocator self, float deltaTime) { orig.Invoke(self, deltaTime); DismembermentBehavior component = ((Component)self).GetComponent<DismembermentBehavior>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)self.modelTransform)) { component.Crawl(self.modelTransform); } }; <>c.<>9__1_2 = val2; obj2 = (object)val2; } ModelLocator.UpdateModelTransform += (hook_UpdateModelTransform)obj2; } } internal class DismembermentBehavior : ItemBehavior { private static readonly string[] legBoneNames = new string[7] { "thigh", "upperleg", "upper_leg", "leg.l", "leg.r", "legl", "legr" }; private const float CrawlTilt = 80f; private readonly List<KeyValuePair<Transform, Vector3>> legs = new List<KeyValuePair<Transform, Vector3>>(); private Transform model; private float hipHeight = 1f; private void LateUpdate() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)base.body) || !Object.op_Implicit((Object)(object)base.body.modelLocator) || !Object.op_Implicit((Object)(object)base.body.modelLocator.modelTransform)) { return; } if ((Object)(object)model != (Object)(object)base.body.modelLocator.modelTransform) { FindLegs(); } foreach (KeyValuePair<Transform, Vector3> leg in legs) { if (Object.op_Implicit((Object)(object)leg.Key)) { leg.Key.localScale = Vector3.one * 0.001f; } } } public void Crawl(Transform modelTransform) { //IL_000b: 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_0024: 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_002e: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); Quaternion val2 = default(Quaternion); modelTransform.GetPositionAndRotation(ref val, ref val2); modelTransform.SetPositionAndRotation(val + val2 * new Vector3(0f, 0.25f, (0f - hipHeight) * 0.8f), val2 * Quaternion.Euler(80f, 0f, 0f)); } private void OnDisable() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<Transform, Vector3> leg in legs) { if (Object.op_Implicit((Object)(object)leg.Key)) { leg.Key.localScale = leg.Value; } } } private void FindLegs() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) OnDisable(); model = base.body.modelLocator.modelTransform; legs.Clear(); float num = 0f; Transform[] componentsInChildren = ((Component)model).GetComponentsInChildren<Transform>(true); foreach (Transform val in componentsInChildren) { if (IsLegBone(val) && (!Object.op_Implicit((Object)(object)val.parent) || !IsLegBone(val.parent))) { legs.Add(new KeyValuePair<Transform, Vector3>(val, val.localScale)); num += model.InverseTransformPoint(val.position).y; } } hipHeight = ((legs.Count > 0) ? Mathf.Max(num / (float)legs.Count, 0.3f) : 1f); } private static bool IsLegBone(Transform bone) { string text = ((Object)bone).name.ToLowerInvariant(); string[] array = legBoneNames; foreach (string value in array) { if (text.Contains(value)) { return true; } } return false; } } internal static class KrombCore { public static ItemDef ItemDef; public static GameObject StrikeEffect; public static void Init() { ItemDef = ItemFactory.CreateItem("KrombCore", "KrombCore", (ItemTier)4, "Kromb Core", "Has a 50% chance of dealing some damage every other minute.", "Every other minute, has a <style=cIsDamage>50%</style> chance of dealing <style=cIsDamage>some damage</style> <style=cStack>(more per stack)</style> to a random nearby enemy.", "It's a core. Of a kromb. It does something, sometimes, about half the time, every couple of minutes.\n\nField testers report that it is \"definitely a boss item.\"", (ItemTag)1); StrikeEffect = ModAssets.Load<GameObject>("RoR2/Base/Lightning/LightningStrikeImpact.prefab"); BossDrops.Add(ItemDef); CharacterBody.onBodyInventoryChangedGlobal += delegate(CharacterBody body) { if (NetworkServer.active) { body.AddItemBehavior<KrombCoreBehavior>(ItemFactory.Count(body, ItemDef)); } }; } } internal class KrombCoreBehavior : ItemBehavior { private const float Interval = 120f; private const float Range = 60f; private const float DamageCoefficientPerStack = 1f; private float timer = 120f; private void FixedUpdate() { //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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Invalid comparison between Unknown and I4 //IL_0088: 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_011c: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)base.body) || !base.body.healthComponent.alive) { return; } timer -= Time.fixedDeltaTime; if (timer > 0f) { return; } timer = 120f; if (!Util.CheckRoll(50f, base.body.master)) { return; } List<CharacterBody> list = new List<CharacterBody>(); TeamIndex teamIndex = base.body.teamComponent.teamIndex; TeamIndex val = (TeamIndex)0; while ((int)val < 6) { if (TeamManager.IsTeamEnemy(teamIndex, val)) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { CharacterBody body = teamMember.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive) { Vector3 val2 = body.corePosition - base.body.corePosition; if (((Vector3)(ref val2)).sqrMagnitude <= 3600f) { list.Add(body); } } } } val = (TeamIndex)(sbyte)(val + 1); } if (list.Count != 0) { CharacterBody val3 = list[Random.Range(0, list.Count)]; ModAssets.SpawnEffect(KrombCore.StrikeEffect, val3.corePosition, 1f); val3.healthComponent.TakeDamage(new DamageInfo { attacker = ((Component)base.body).gameObject, inflictor = ((Component)base.body).gameObject, damage = base.body.damage * 1f * (float)base.stack, crit = base.body.RollCrit(), position = val3.corePosition, procCoefficient = 1f, damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)0) }); } } } internal static class LitanousGrub { public static ItemDef ItemDef; public static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ItemDef = ItemFactory.CreateItem("LitanousGrub", "LitanousGrub", (ItemTier)6, "Litanous Grub", "100% chance to just ruin your whole build. <style=cIsVoid>Corrupts all Plungers</style>.", "<style=cDeath>100%</style> chance to just ruin your whole build. Every time you gain a Litanous Grub, <style=cDeath>every other item you own is rerolled</style> into a random item of the same tier. <style=cIsVoid>Corrupts all Plungers</style>.", "It hums the same three notes over and over. They are, roughly: \"no\", \"not like that\", and \"wrong\".\n\nYou had a plan. The grub has heard your plan.", (ItemTag[])(object)array); LanguageAPI.Add("LKM_GRUB_RUINED", "<color=#ed7fcd>{0}'s whole build has been ruined by the Litanous Grub.</color>"); Inventory.onInventoryChangedGlobal += OnInventoryChanged; } private static void OnInventoryChanged(Inventory inventory) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown if (!NetworkServer.active || !Object.op_Implicit((Object)(object)Run.instance)) { return; } GrubTracker grubTracker = ((Component)inventory).GetComponent<GrubTracker>(); int itemCountPermanent = inventory.GetItemCountPermanent(ItemDef); if (!Object.op_Implicit((Object)(object)grubTracker)) { if (itemCountPermanent <= 0) { return; } grubTracker = ((Component)inventory).gameObject.AddComponent<GrubTracker>(); } int lastCount = grubTracker.lastCount; grubTracker.lastCount = itemCountPermanent; if (itemCountPermanent > lastCount) { RuinBuild(inventory); CharacterMaster component = ((Component)inventory).GetComponent<CharacterMaster>(); string text = ((Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.GetBody())) ? component.GetBody().GetUserName() : "Someone"); SimpleChatMessage val = new SimpleChatMessage(); val.baseToken = "LKM_GRUB_RUINED"; val.paramTokens = new string[1] { text }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } private static void RuinBuild(Inventory inventory) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_002b: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) Xoroshiro128Plus rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); List<KeyValuePair<ItemIndex, int>> list = new List<KeyValuePair<ItemIndex, int>>(); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { int itemCountPermanent = inventory.GetItemCountPermanent(item); if (itemCountPermanent > 0) { list.Add(new KeyValuePair<ItemIndex, int>(item, itemCountPermanent)); } } foreach (KeyValuePair<ItemIndex, int> item2 in list) { ItemDef itemDef = ItemCatalog.GetItemDef(item2.Key); if (!Object.op_Implicit((Object)(object)itemDef) || (Object)(object)itemDef == (Object)(object)ItemDef || itemDef.hidden || !itemDef.canRemove) { continue; } List<PickupIndex> list2 = DropListFor(itemDef.tier); if (list2 == null || list2.Count == 0) { continue; } inventory.RemoveItemPermanent(item2.Key, item2.Value); for (int i = 0; i < item2.Value; i++) { ItemIndex val = RollItem(list2, rng); if ((int)val != -1) { inventory.GiveItemPermanent(val, 1); } } } } private static ItemIndex RollItem(List<PickupIndex> pool, Xoroshiro128Plus rng) { //IL_0006: 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_001b: Invalid comparison between Unknown and I4 //IL_001e: 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_0030: 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_0042: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 10; i++) { PickupDef pickupDef = PickupCatalog.GetPickupDef(rng.NextElementUniform<PickupIndex>(pool)); if (pickupDef != null && (int)pickupDef.itemIndex != -1 && pickupDef.itemIndex != Plunger.ItemDef.itemIndex && pickupDef.itemIndex != ItemDef.itemIndex) { return pickupDef.itemIndex; } } return (ItemIndex)(-1); } public static List<PickupIndex> DropListFor(ItemTier tier) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected I4, but got Unknown Run instance = Run.instance; return (int)tier switch { 0 => instance.availableTier1DropList, 1 => instance.availableTier2DropList, 2 => instance.availableTier3DropList, 4 => instance.availableBossDropList, 3 => instance.availableLunarItemDropList, 6 => instance.availableVoidTier1DropList, 7 => instance.availableVoidTier2DropList, 8 => instance.availableVoidTier3DropList, 9 => instance.availableVoidBossDropList, _ => null, }; } } internal class GrubTracker : MonoBehaviour { public int lastCount; } internal static class MurderousPrawn { public static ItemDef ItemDef; private const float ChancePerStack = 3f; private const float DamageCoefficient = 10f; public static GameObject VortexEffect; public static void Init() { ItemDef = ItemFactory.CreateItem("MurderousPrawn", "MurderousPrawn", (ItemTier)7, "Murderous Prawn", "On hit chance to summon a total perspective vortex. <style=cIsVoid>Corrupts all Feral Scrunglers</style>.", "<style=cIsDamage>3%</style> <style=cStack>(+3% per stack)</style> chance on hit to summon a <style=cIsVoid>total perspective vortex</style> that drags in nearby enemies for <style=cIsUtility>4</style> seconds, then collapses for <style=cIsDamage>1000%</style> base damage. <style=cIsVoid>Corrupts all Feral Scrunglers</style>.", "The prawn has seen the entire universe, and a tiny dot that says \"you are here.\" It did not take it well.\n\nIt would like you to see it too.\n\nKnown exceptions: Beeblebrox. For him, bring a few Vogon's Prose.", (ItemTag)1); VortexEffect = ModAssets.Load<GameObject>("RoR2/Base/Nullifier/NullifierDeathBombExplosion.prefab"); GlobalEventManager.onServerDamageDealt += OnDamageDealt; } private static void OnDamageDealt(DamageReport report) { //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) DamageInfo damageInfo = report.damageInfo; if (NetworkServer.active && !(damageInfo.procCoefficient <= 0f) && !damageInfo.rejected) { CharacterBody attackerBody = report.attackerBody; int num = ItemFactory.Count(attackerBody, ItemDef); if (num > 0 && Object.op_Implicit((Object)(object)report.victimBody) && Util.CheckRoll(3f * (float)num * damageInfo.procCoefficient, report.attackerMaster)) { PerspectiveVortex perspectiveVortex = new GameObject("LKM_PerspectiveVortex").AddComponent<PerspectiveVortex>(); ((Component)perspectiveVortex).transform.position = report.victimBody.corePosition; perspectiveVortex.attacker = attackerBody; perspectiveVortex.damage = attackerBody.damage * 10f; perspectiveVortex.crit = attackerBody.RollCrit(); } } } } internal class PerspectiveVortex : MonoBehaviour { private const float Radius = 14f; private const float Duration = 4f; private const float PullInterval = 0.1f; private const float PullSpeedPerTick = 2.5f; private const float PulseInterval = 0.5f; public CharacterBody attacker; public float damage; public bool crit; private float age; private float pullTimer; private float pulseTimer; private void FixedUpdate() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)attacker)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } age += Time.fixedDeltaTime; pulseTimer -= Time.fixedDeltaTime; if (pulseTimer <= 0f) { pulseTimer = 0.5f; ModAssets.SpawnEffect(MurderousPrawn.VortexEffect, ((Component)this).transform.position, 14f * Mathf.Lerp(1f, 0.4f, age / 4f)); } pullTimer -= Time.fixedDeltaTime; if (pullTimer <= 0f) { pullTimer = 0.1f; Pull(); } if (age >= 4f) { Collapse(); } } private void Pull() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Invalid comparison between Unknown and I4 //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) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_0030: 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_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_00ec: 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: 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) Vector3 position = ((Component)this).transform.position; TeamIndex teamIndex = attacker.teamComponent.teamIndex; TeamIndex val = (TeamIndex)0; while ((int)val < 6) { if (TeamManager.IsTeamEnemy(teamIndex, val)) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { CharacterBody body = teamMember.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive) { Vector3 val2 = position - body.corePosition; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude > 14f) && !(magnitude < 1.5f)) { float num = (Object.op_Implicit((Object)(object)body.characterMotor) ? body.characterMotor.mass : (Object.op_Implicit((Object)(object)body.rigidbody) ? body.rigidbody.mass : 100f)); body.healthComponent.TakeDamageForce(val2 / magnitude * 2.5f * num, true, false); } } } } val = (TeamIndex)(sbyte)(val + 1); } } private void Collapse() { //IL_000b: 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_0030: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00ab: 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_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) ModAssets.SpawnEffect(MurderousPrawn.VortexEffect, ((Component)this).transform.position, 14f); new BlastAttack { attacker = ((Component)attacker).gameObject, inflictor = ((Component)attacker).gameObject, teamIndex = attacker.teamComponent.teamIndex, position = ((Component)this).transform.position, radius = 14f, baseDamage = damage, baseForce = 0f, crit = crit, procCoefficient = 0f, falloffModel = (FalloffModel)0, damageColorIndex = (DamageColorIndex)9, attackerFiltering = (AttackerFiltering)2 }.Fire(); Object.Destroy((Object)(object)((Component)this).gameObject); } } internal static class OrbitalStrikeCannon { [CompilerGenerated] private static class <>O { public static hook_PerformEquipmentAction <0>__PerformEquipmentAction; } public static EquipmentDef EquipmentDef; private const float DamageCoefficient = 1f; private const float MinBlastRadius = 20f; public static float RecycleRadius; private static GameObject strikePrefab; public static GameObject ObliterateEffect; public static void Init() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown EquipmentDef = ItemFactory.CreateEquipment("OrbitalStrikeCannon", "OrbitalStrikeCannon", 10800f, "Orbital Strike Cannon", "Call down an orbital strike. Worse than recycler.", "Call down an <style=cIsDamage>orbital strike</style> at your crosshair for <style=cIsDamage>100% damage</style>. Items caught in the blast are <style=cIsUtility>recycled</style> into an item of a <style=cDeath>worse tier</style>. Common items are recycled into <style=cDeath>nothing</style>. Still works in Hidden Realms.\n<style=cSub>worse than recycler</style>", "UES Safe Travels orbital support, how can we help?\n\"Uh, yeah, could I get a strike on that red item over there?\"\nConfirmed. Firing.\n\"Wait, why is it green now?\"\nThank you for choosing UES orbital support.\n\n[Coverage area: everywhere. Yes, even there. Sorry, Captain.]"); GameObject obj = PrefabAPI.InstantiateClone(ModAssets.Load<GameObject>("RoR2/Base/Captain/CaptainAirstrikeProjectile1.prefab"), "LKMOrbitalStrikeProjectile", true); ProjectileImpactExplosion component = obj.GetComponent<ProjectileImpactExplosion>(); ((ProjectileExplosion)component).blastRadius = Mathf.Max(((ProjectileExplosion)component).blastRadius * 2.5f, 20f); ((ProjectileExplosion)component).preserveExplosionScale = false; RecycleRadius = ((ProjectileExplosion)component).blastRadius; obj.AddComponent<RecycleOnDetonate>(); ContentAddition.AddProjectile(obj); strikePrefab = obj; ObliterateEffect = ModAssets.Load<GameObject>("RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab"); object obj2 = <>O.<0>__PerformEquipmentAction; if (obj2 == null) { hook_PerformEquipmentAction val = PerformEquipmentAction; <>O.<0>__PerformEquipmentAction = val; obj2 = (object)val; } EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj2; } private static bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0069: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00f7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)equipmentDef != (Object)(object)EquipmentDef) { return orig.Invoke(self, equipmentDef); } CharacterBody characterBody = self.characterBody; if (!Object.op_Implicit((Object)(object)characterBody)) { return false; } Ray val = (Ray)(Object.op_Implicit((Object)(object)characterBody.inputBank) ? characterBody.inputBank.GetAimRay() : new Ray(characterBody.corePosition, ((Component)characterBody).transform.forward)); Ray val2 = val; LayerIndex world = LayerIndex.world; RaycastHit val3 = default(RaycastHit); Vector3 position = (Physics.Raycast(val2, ref val3, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1) ? ((RaycastHit)(ref val3)).point : ((Ray)(ref val)).GetPoint(100f)); ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = strikePrefab, position = position, rotation = Quaternion.identity, owner = ((Component)characterBody).gameObject, damage = characterBody.damage * 1f, crit = characterBody.RollCrit(), force = 0f }); return true; } public static void Recycle(GenericPickupController pickup) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_003f: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected I4, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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) PickupDef pickupDef = PickupCatalog.GetPickupDef(pickup.pickup.pickupIndex); if (pickupDef == null) { return; } ItemTier? val = null; bool flag = false; if ((int)pickupDef.equipmentIndex != -1) { val = (ItemTier)0; } else if ((int)pickupDef.itemIndex != -1) { ItemTier tier = ItemCatalog.GetItemDef(pickupDef.itemIndex).tier; switch ((int)tier) { case 2: val = (ItemTier)1; break; case 1: case 4: val = (ItemTier)0; break; case 3: val = (ItemTier)0; break; case 8: val = (ItemTier)7; break; case 7: case 9: val = (ItemTier)6; break; case 0: case 6: flag = true; break; } } if (flag) { ModAssets.SpawnEffect(ObliterateEffect, ((Component)pickup).transform.position, 2f); NetworkServer.Destroy(((Component)pickup).gameObject); } else if (val.HasValue) { List<PickupIndex> list = LitanousGrub.DropListFor(val.Value); if (list != null && list.Count != 0) { pickup.pickup = new UniquePickup(list[Random.Range(0, list.Count)]); } } } } internal class RecycleOnDetonate : MonoBehaviour { private void OnDestroy() { //IL_0019: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)Run.instance)) { return; } Scene scene = ((Component)this).gameObject.scene; if (!((Scene)(ref scene)).isLoaded) { return; } Vector3 position = ((Component)this).transform.position; GenericPickupController[] array = Object.FindObjectsOfType<GenericPickupController>(); foreach (GenericPickupController val in array) { Vector3 val2 = ((Component)val).transform.position - position; if (((Vector3)(ref val2)).sqrMagnitude <= OrbitalStrikeCannon.RecycleRadius * OrbitalStrikeCannon.RecycleRadius) { OrbitalStrikeCannon.Recycle(val); } } } } internal static class Plunger { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__1_0; internal void <Init>b__1_0(CharacterBody body, StatHookEventArgs args) { int num = ItemFactory.Count(body, ItemDef); if (num > 0) { float num2 = 0.1f * (float)num; args.damageMultAdd += num2; args.attackSpeedMultAdd += num2; args.moveSpeedMultAdd += num2; args.healthMultAdd += num2; args.regenMultAdd += num2; args.jumpPowerMultAdd += num2; args.critDamageMultAdd += num2; args.critAdd += 10f * (float)num; args.armorAdd += 10f * (float)num; } } } public static ItemDef ItemDef; public static void Init() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ItemDef = ItemFactory.CreateItem("Plunger", "Plunger", (ItemTier)0, "Plunger", "+10% whatever.", "<style=cIsUtility>+10%</style> <style=cStack>(+10% per stack)</style> whatever: damage, attack speed, movement speed, max health, health regen, jump height and crit damage. Also <style=cIsDamage>+10% crit chance</style> and <style=cIsHealing>+10 armor</style> <style=cStack>(+10 per stack)</style>, because why not.\n<style=cSub>(Best item in the game)</style>", "It unclogs things. It's fine. It's whatever.\n\nOrder #11,203: one (1) plunger, used. Customer notes: \"best item in the game.\"", (ItemTag[])(object)array); object obj = <>c.<>9__1_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody body, StatHookEventArgs args) { int num = ItemFactory.Count(body, ItemDef); if (num > 0) { float num2 = 0.1f * (float)num; args.damageMultAdd += num2; args.attackSpeedMultAdd += num2; args.moveSpeedMultAdd += num2; args.healthMultAdd += num2; args.regenMultAdd += num2; args.jumpPowerMultAdd += num2; args.critDamageMultAdd += num2; args.critAdd += 10f * (float)num; args.armorAdd += 10f * (float)num; } }; <>c.<>9__1_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; } } internal static class Thingamajig { [CompilerGenerated] private static class <>O { public static hook_OnTriggerStay <0>__OnJumpVolume; public static hook_OnInteractionBegin <1>__OnPurchase; } public static ItemDef ItemDef; public static GameObject ChudMasterPrefab; private const int SecretPlungers = 5; private static GameObject secretEffect; public static void Init() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_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_011b: Expected O, but got Unknown //IL_0130: 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_013b: Expected O, but got Unknown ItemDef = ItemFactory.CreateItem("Thingamajig", "Thingamajig", (ItemTier)4, "Thingamajig", "Summons fat chud. He will get in your way.", "Summons <style=cIsUtility>1</style> <style=cStack>(+1 per stack)</style> <style=cIsUtility>fat chud</style> that has a <style=cIsHealth>100%</style> chance to get in your way when you jump on a movement pad.\n\n<style=cSub>can be brought to the flux terminal for a secret...</style>", "\"What is it?\"\n\"It's a thingamajig.\"\n\"What does it do?\"\n\"It summons a fat chud.\"\n\"Why?\"\n\"...\"\n\nThe terminal hums when you hold it near. Don't tell anyone.", (ItemTag)3, (ItemTag)13); LanguageAPI.Add("LKM_THINGAMAJIG_SECRET", "<color=#c9c26b>{0} brought the thingamajig to the flux terminal. Something clicked. (+50% whatever)</color>"); Sprite portrait = ModAssets.LoadSprite("Thingamajig"); GameObject val = Minions.CloneBody("RoR2/Base/Golem/GolemBody.prefab", "LKMFatChudBody", "LKM_FATCHUD_BODY_NAME", "Fat Chud", portrait); ModelLocator component = val.GetComponent<ModelLocator>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelTransform)) { component.modelTransform.localScale = Vector3.Scale(component.modelTransform.localScale, new Vector3(1.7f, 1f, 1.7f)); } ChudMasterPrefab = Minions.CloneMaster("RoR2/Base/Golem/GolemMaster.prefab", "LKMFatChudMaster", val); secretEffect = ModAssets.Load<GameObject>("RoR2/Base/Common/VFX/ShrineUseEffect.prefab"); CharacterBody.onBodyInventoryChangedGlobal += delegate(CharacterBody body) { if (NetworkServer.active) { body.AddItemBehavior<ChudBehavior>(ItemFactory.Count(body, ItemDef)); } }; object obj = <>O.<0>__OnJumpVolume; if (obj == null) { hook_OnTriggerStay val2 = OnJumpVolume; <>O.<0>__OnJumpVolume = val2; obj = (object)val2; } JumpVolume.OnTriggerStay += (hook_OnTriggerStay)obj; object obj2 = <>O.<1>__OnPurchase; if (obj2 == null) { hook_OnInteractionBegin val3 = OnPurchase; <>O.<1>__OnPurchase = val3; obj2 = (object)val3; } PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj2; BossDrops.Add(ItemDef); } private static void OnJumpVolume(orig_OnTriggerStay orig, JumpVolume self, Collider other) { orig.Invoke(self, other); if (NetworkServer.active) { ChudBehavior component = ((Component)other).GetComponent<ChudBehavior>(); if (Object.op_Implicit((Object)(object)component)) { component.GetInTheWay(self); } } } private static void OnPurchase(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0083: 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_0098: Expected O, but got Unknown if (NetworkServer.active && Object.op_Implicit((Object)(object)activator) && (int)self.costType == 1 && Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShopTerminalBehavior>())) { CharacterBody component = ((Component)activator).GetComponent<CharacterBody>(); Inventory val = (Object.op_Implicit((Object)(object)component) ? component.inventory : null); if (Object.op_Implicit((Object)(object)val) && val.GetItemCountPermanent(ItemDef) > 0) { val.RemoveItemPermanent(ItemDef, 1); val.GiveItemPermanent(Plunger.ItemDef, 5); ModAssets.SpawnEffect(secretEffect, ((Component)self).transform.position, 3f); SimpleChatMessage val2 = new SimpleChatMessage(); val2.baseToken = "LKM_THINGAMAJIG_SECRET"; val2.paramTokens = new string[1] { component.GetUserName() }; Chat.SendBroadcastChat((ChatMessageBase)(object)val2); } } orig.Invoke(self, activator); } } internal class ChudBehavior : ItemBehavior { private const float FirstSummonDelay = 1f; private const float ResummonDelay = 15f; private const float JumpCooldown = 1.5f; private readonly List<CharacterMaster> chuds = new List<CharacterMaster>(); private float summonTimer = 1f; private float jumpTimer; private void FixedUpdate() { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)base.body)) { return; } jumpTimer -= Time.fixedDeltaTime; chuds.RemoveAll((CharacterMaster master) => !Object.op_Implicit((Object)(object)master) || master.IsDeadAndOutOfLivesServer()); while (chuds.Count > base.stack) { chuds[chuds.Count - 1].TrueKill(); chuds.RemoveAt(chuds.Count - 1); } if (chuds.Count >= base.stack || !base.body.healthComponent.alive) { return; } summonTimer -= Time.fixedDeltaTime; if (summonTimer <= 0f) { summonTimer = 15f; CharacterMaster val = Minions.Summon(Thingamajig.ChudMasterPrefab, base.body); if (Object.op_Implicit((Object)(object)val)) { chuds.Add(val); } } } private void OnDisable() { if (!NetworkServer.active) { return; } foreach (CharacterMaster chud in chuds) { if (Object.op_Implicit((Object)(object)chud)) { chud.TrueKill(); } } chuds.Clear(); } public void GetInTheWay(JumpVolume jumpVolume) { //IL_002f: 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_0022: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e7: 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) if (jumpTimer > 0f) { return; } jumpTimer = 1.5f; Vector3 val = (jumpVolume.alignJumpVelocityToTransform ? (((Component)jumpVolume).transform.up * ((Vector3)(ref jumpVolume.jumpVelocity)).magnitude) : jumpVolume.jumpVelocity); Vector3 footPosition = base.body.footPosition; for (int i = 0; i < chuds.Count; i++) { CharacterBody val2 = (Object.op_Implicit((Object)(object)chuds[i]) ? chuds[i].GetBody() : null); if (Object.op_Implicit((Object)(object)val2)) { float num = 0.3f + 0.2f * (float)i; Vector3 val3 = footPosition + val * num + 0.5f * num * num * Physics.gravity; TeleportHelper.TeleportBody(val2, val3 + Vector3.down); if (Object.op_Implicit((Object)(object)val2.characterMotor)) { val2.characterMotor.velocity = Vector3.zero; } } } } } internal static class TwistedBaculum { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__2_0; public static Action<CharacterBody> <>9__2_1; internal void <Init>b__2_0(CharacterBody body, StatHookEventArgs args) { int num = ItemFactory.Count(body, ItemDef); if (num > 0) { args.baseCurseAdd += 0.1f * (float)num; } } internal void <Init>b__2_1(CharacterBody body) { if (NetworkServer.active) { body.AddItemBehavior<BaculumBehavior>(ItemFactory.Count(body, ItemDef)); } } } public static ItemDef ItemDef; public static GameObject StareKillEffect; public static void Init() { //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_0065: Expected O, but got Unknown ItemDef = ItemFactory.CreateItem("TwistedBaculum", "TwistedBaculum", (ItemTier)3, "Twisted Baculum", "Immediately kill any enemy that looks at you. <color=#FF7F7F>BUT... you kinda smell bad.</color>", "<style=cDeath>Immediately kill</style> any enemy that <style=cIsUtility>looks at you</style>.\n<color=#FF7F7F>but....</color>\nyou kinda <style=cIsHealth>smell bad</style>, reducing your <style=cIsHealth>maximum health</style> by <style=cIsHealth>10%</style> <style=cStack>(+10% per stack)</style>.", "Don't ask where it came from. Don't ask what it's from. Definitely don't ask why everything that sees it drops dead.\n\nThe smell is, unfortunately, part of the deal.", (ItemTag)1, (ItemTag)4); StareKillEffect = ModAssets.Load<GameObject>("RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab"); object obj = <>c.<>9__2_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody body, StatHookEventArgs args) { int num = ItemFactory.Count(body, ItemDef); if (num > 0) { args.baseCurseAdd += 0.1f * (float)num; } }; <>c.<>9__2_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; CharacterBody.onBodyInventoryChangedGlobal += delegate(CharacterBody body) { if (NetworkServer.active) { body.AddItemBehavior<BaculumBehavior>(ItemFactory.Count(body, ItemDef)); } }; } } internal class BaculumBehavior : ItemBehavior { private const float CheckInterval = 0.1f; private const float MaxStareDistance = 150f; private static readonly float stareCone = Mathf.Cos(0.17453292f); private float timer; private readonly List<HealthComponent> victims = new List<HealthComponent>(); private void FixedUpdate() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Invalid comparison between Unknown and I4 //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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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_00e1: 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_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_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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)base.body) || !base.body.healthComponent.alive) { return; } timer -= Time.fixedDeltaTime; if (timer > 0f) { return; } timer = 0.1f; Vector3 corePosition = base.body.corePosition; TeamIndex teamIndex = base.body.teamComponent.teamIndex; TeamIndex val = (TeamIndex)0; while ((int)val < 6) { if (TeamManager.IsTeamEnemy(teamIndex, val)) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { CharacterBody body = teamMember.body; if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inputBank) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive || (body.bodyFlags & 0x10) != 0) { continue; } Vector3 aimOrigin = body.inputBank.aimOrigin; Vector3 val2 = corePosition - aimOrigin; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude > 150f) && !(magnitude < 0.01f) && !(Vector3.Dot(body.inputBank.aimDirection, val2 / magnitude) < stareCone)) { LayerIndex world = LayerIndex.world; if (!Physics.Linecast(aimOrigin, corePosition, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { victims.Add(body.healthComponent); } } } } val = (TeamIndex)(sbyte)(val + 1); } foreach (HealthComponent victim in victims) { ModAssets.SpawnEffect(TwistedBaculum.StareKillEffect, victim.body.corePosition, victim.body.radius); victim.Suicide(((Component)base.body).gameObject, ((Component)base.body).gameObject, default(DamageTypeCombo)); } victims.Clear(); } } internal static class VoidCorruption { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_SetItemRelationships <>9__0_0; internal void <Init>b__0_0(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_006d: 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) ItemRelationshipProvider val = ScriptableObject.CreateInstance<ItemRelationshipProvider>(); ((Object)val).name = "LKM_VoidCorruption"; val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[2] { new Pair { itemDef1 = FeralScrungler.ItemDef, itemDef2 = MurderousPrawn.ItemDef }, new Pair { itemDef1 = Plunger.ItemDef, itemDef2 = LitanousGrub.ItemDef } }; ArrayUtils.ArrayAppend<ItemRelationshipProvider>(ref providers, ref val); orig.Invoke(providers); } } public static void Init() { //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) //IL_001f: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { hook_SetItemRelationships val = delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_006d: 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) ItemRelationshipProvider val2 = ScriptableObject.CreateInstance<ItemRelationshipProvider>(); ((Object)val2).name = "LKM_VoidCorruption"; val2.relationshipType = ItemRelationshipTypes.ContagiousItem; val2.relationships = (Pair[])(object)new Pair[2] { new Pair { itemDef1 = FeralScrungler.ItemDef, itemDef2 = MurderousPrawn.ItemDef }, new Pair { itemDef1 = Plunger.ItemDef, itemDef2 = LitanousGrub.ItemDef } }; ArrayUtils.ArrayAppend<ItemRelationshipProvider>(ref providers, ref val2); orig.Invoke(providers); }; <>c.<>9__0_0 = val; obj = (object)val; } ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)obj; } } internal static class VoraciousFangs { public static ItemDef ItemDef; private const float DamageCoefficient = 6f; private const int MaxEffectsPerFury = 60; private static GameObject furyInflictor; private static GameObject[] furyEffects; public static void Init() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ItemDef = ItemFactory.CreateItem("VoraciousFangs", "VoraciousFangs", (ItemTier)2, "Voracious Fangs", "Killing a monster activates the fury of the dark lord, harbinger of death.", "Killing a monster activates <style=cDeath>the fury of the dark lord, harbinger of death</style>, dealing <style=cIsDamage>600%</style> base damage to all monsters within <style=cIsDamage>16m</style> <style=cStack>(+4m per stack)</style>.\n<style=cSub>(lowk mid and if you have more than like 3 you just wont be able to see anything lol)</style>\n<style=cSub>(important bosses are completely immune)</style>", "HE IS RISEN. HE IS HUNGRY. HE IS, HONESTLY, KIND OF MID.\n\nThe Dark Lord does not choose his vessels. He simply bites whoever is closest, and then everything nearby explodes for a while. Nobody has seen anything clearly since.", (ItemTag[])(object)array); furyInflictor = new GameObject("LKM_DarkLordFury"); Object.DontDestroyOnLoad((Object)(object)furyInflictor); furyEffects = (GameObject[])(object)new GameObject[4] { ModAssets.Load<GameObject>("RoR2/Base/ImpBoss/ImpBossDeathEffect.prefab"), ModAssets.Load<GameObject>("RoR2/Base/Bell/OmniExplosionVFXBellDeath.prefab"), ModAssets.Load<GameObject>("RoR2/Base/RoboBallBoss/OmniExplosionVFXRoboBallBossDeath.prefab"), ModAssets.Load<GameObject>("RoR2/Base/Grandparent/GrandparentDeathEffect.prefab") }; GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeath; } public static bool IsImportantBoss(CharacterBody body) { //IL_0011: 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_001a: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)body)) { if (!body.isBoss) { return (body.bodyFlags & 0x10) > 0; } return true; } return false; } private static void OnCharacterDeath(DamageReport report) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00bc: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0112: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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) if (!NetworkServer.active || (report.damageInfo != null && (Object)(object)report.damageInfo.inflictor == (Object)(object)furyInflictor)) { return; } CharacterBody attacker = report.attackerBody; int num = ItemFactory.Count(attacker, ItemDef); if (num > 0) { Vector3 val = (Object.op_Implicit((Object)(object)report.victimBody) ? report.victimBody.corePosition : report.damageInfo.position); float num2 = 12f + 4f * (float)num; new BlastAttack { attacker = ((Component)attacker).gameObject, inflictor = furyInflictor, teamIndex = attacker.teamComponent.teamIndex, position = val, radius = num2, baseDamage = attacker.damage * 6f, baseForce = 2000f, crit = attacker.RollCrit(), procCoefficient = 0.5f, falloffModel = (FalloffModel)0, damageColorIndex = (DamageColorIndex)9, attackerFiltering = (AttackerFiltering)6, filterCallback = (CustomFilter)((BlastAttackFilterStruct target) => (Object)(object)((Component)target.healthComponent).gameObject != (Object)(object)((Component)attacker).gameObject && !IsImportantBoss(target.healthComponent.body)) }.Fire(); int num3 = Mathf.Min(1 + 3 * num, 60); for (int num4 = 0; num4 < num3; num4++) { Vector3 val2 = ((num4 == 0) ? Vector3.zero : (Random.insideUnitSphere * num2 * 0.6f)); ModAssets.SpawnEffect(furyEffects[Random.Range(0, furyEffects.Length)], val + val2, num2 * 0.5f); } } } } }