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 Ladle of Pelmeni v1.0.0
LadleOfPelmeni.dll
Decompiled 18 hours agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using On.RoR2; using R2API; using RoR2; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LadleOfPelmeni")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LadleOfPelmeni")] [assembly: AssemblyTitle("LadleOfPelmeni")] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } namespace LadleOfPelmeniMod { [BepInPlugin("com.YourName.LadleOfPelmeni", "Ladle of Pelmeni", "2.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class LadleOfPelmeniPlugin : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_BuildDropTable <>9__17_0; public static hook_Update <>9__17_2; public static StatHookEventHandler <>9__17_3; internal void <AddHooks>b__17_0(orig_BuildDropTable orig, Run self) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_001a: 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_0050: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); PickupIndex val = PickupCatalog.FindPickupIndex(PelmeniItem.itemIndex); if (val != PickupIndex.none && self.availableTier3DropList != null && !self.availableTier3DropList.Contains(val)) { self.availableTier3DropList.Add(val); } } internal void <AddHooks>b__17_2(orig_Update orig, CharacterBody self) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (((NetworkBehaviour)self).isLocalPlayer && Enum.TryParse<KeyCode>("F3", out KeyCode result) && Input.GetKeyDown(result) && NetworkServer.active) { PickupIndex val = PickupCatalog.FindPickupIndex(PelmeniItem.itemIndex); Vector3 val2 = self.corePosition + ((Component)self).transform.forward * 2f; PickupDropletController.CreatePickupDroplet(val, val2, new Vector3(0f, 5f, 0f)); } } internal void <AddHooks>b__17_3(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(SatietyBuff)) { args.attackSpeedMultAdd += 0.1f; } } } public const string PluginGUID = "com.YourName.LadleOfPelmeni"; public const string PluginName = "Ladle of Pelmeni"; public const string PluginVersion = "2.0.0"; public static ItemDef PelmeniItem; public static BuffDef SatietyBuff; public static GameObject LadleEntityPrefab; public static GameObject PelmenPrefab; public static AssetBundle MainBundle; public static Shader HGStandardShader; public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); LoadAddressableAssets(); string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "pelmenibundle"); if (File.Exists(text)) { MainBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)MainBundle != (Object)null) { Log.LogInfo("СУПЕР! AssetBundle 'pelmenibundle' успешно прочитан!"); } } CreatePrefabs(); CreateBuff(); CreateItem(); AddHooks(); Log.LogInfo("Ladle of Pelmeni successfully loaded!"); } private void LoadAddressableAssets() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) try { HGStandardShader = Addressables.LoadAssetAsync<Shader>((object)"RoR2/Base/Shaders/HGStandard.shader").WaitForCompletion(); } catch (Exception ex) { Log.LogInfo("Ошибка загрузки HGStandard.shader: " + ex.Message); } } private void CreatePrefabs() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0094: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) GameObject val = (((Object)(object)MainBundle != (Object)null) ? MainBundle.LoadAsset<GameObject>("CauldronModel") : null); if ((Object)(object)val != (Object)null) { LadleEntityPrefab = PrefabAPI.InstantiateClone(val, "PelmeniCauldronEntityPrefab", false); } else { Log.LogInfo("Внимание: CauldronModel не найден в AssetBundle! Создан резервный примитив."); LadleEntityPrefab = new GameObject("PelmeniCauldronEntityPrefab"); GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)2); val2.transform.SetParent(LadleEntityPrefab.transform); val2.transform.localPosition = new Vector3(0f, 0.5f, 0f); val2.transform.localScale = new Vector3(2f, 1f, 2f); val2.GetComponent<Renderer>().material.color = new Color(0.1f, 0.1f, 0.1f); Object.Destroy((Object)(object)val2.GetComponent<Collider>()); } Object.DontDestroyOnLoad((Object)(object)LadleEntityPrefab); LadleEntityPrefab.SetActive(false); FixPrefabMaterials(LadleEntityPrefab); if (!Object.op_Implicit((Object)(object)LadleEntityPrefab.GetComponent<NetworkIdentity>())) { LadleEntityPrefab.AddComponent<NetworkIdentity>(); } if (!Object.op_Implicit((Object)(object)LadleEntityPrefab.GetComponentInChildren<Collider>())) { MeshFilter componentInChildren = LadleEntityPrefab.GetComponentInChildren<MeshFilter>(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren.sharedMesh)) { MeshCollider val3 = LadleEntityPrefab.AddComponent<MeshCollider>(); val3.sharedMesh = componentInChildren.sharedMesh; } else { LadleEntityPrefab.AddComponent<BoxCollider>(); } } if (!Object.op_Implicit((Object)(object)LadleEntityPrefab.GetComponent<LadleBehavior>())) { LadleEntityPrefab.AddComponent<LadleBehavior>(); } PrefabAPI.RegisterNetworkPrefab(LadleEntityPrefab); GameObject val4 = (((Object)(object)MainBundle != (Object)null) ? MainBundle.LoadAsset<GameObject>("PelmenModel") : null); if ((Object)(object)val4 != (Object)null) { PelmenPrefab = PrefabAPI.InstantiateClone(val4, "PelmenPrefab", false); } else { Log.LogInfo("Внимание: PelmenModel не найден в AssetBundle! Создан резервный примитив."); PelmenPrefab = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)PelmenPrefab).name = "PelmenPrefab"; PelmenPrefab.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); PelmenPrefab.GetComponent<Renderer>().material.color = new Color(1f, 0.9f, 0.6f); } Object.DontDestroyOnLoad((Object)(object)PelmenPrefab); PelmenPrefab.SetActive(false); FixPrefabMaterials(PelmenPrefab); if (!Object.op_Implicit((Object)(object)PelmenPrefab.GetComponent<NetworkIdentity>())) { PelmenPrefab.AddComponent<NetworkIdentity>(); } if (!Object.op_Implicit((Object)(object)PelmenPrefab.GetComponent<Rigidbody>())) { PelmenPrefab.AddComponent<Rigidbody>(); } Collider val5 = PelmenPrefab.GetComponentInChildren<Collider>(); if (!Object.op_Implicit((Object)(object)val5)) { val5 = (Collider)(object)PelmenPrefab.AddComponent<SphereCollider>(); } val5.isTrigger = false; if (!Object.op_Implicit((Object)(object)PelmenPrefab.GetComponent<PelmenBehavior>())) { PelmenPrefab.AddComponent<PelmenBehavior>(); } PrefabAPI.RegisterNetworkPrefab(PelmenPrefab); } private Sprite LoadIconSprite() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0072: 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) string path = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "icon_game.png"); if (File.Exists(path)) { byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; val.Apply(false, true); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } return null; } private void CreateBuff() { //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) SatietyBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)SatietyBuff).name = "Satiety"; SatietyBuff.buffColor = new Color(0.9f, 0.8f, 0.4f); SatietyBuff.canStack = false; SatietyBuff.isDebuff = false; ContentAddition.AddBuffDef(SatietyBuff); } private void CreateItem() { //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_00e9: 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_013f: 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) PelmeniItem = ScriptableObject.CreateInstance<ItemDef>(); ((Object)PelmeniItem).name = "LadleOfPelmeni"; PelmeniItem.nameToken = "ITEM_LADLEOFPELMENI_NAME"; PelmeniItem.pickupToken = "ITEM_LADLEOFPELMENI_PICKUP"; PelmeniItem.descriptionToken = "ITEM_LADLEOFPELMENI_DESC"; PelmeniItem.loreToken = "ITEM_LADLEOFPELMENI_LORE"; if ((Object)(object)MainBundle != (Object)null) { GameObject val = MainBundle.LoadAsset<GameObject>("LadleModel"); if ((Object)(object)val != (Object)null) { FixPrefabMaterials(val); SetupModelPanelParameters(val); PelmeniItem.pickupModelPrefab = val; Log.LogInfo("Отлично! Префаб LadleModel полностью настроен и привязан к предмету."); } } if ((Object)(object)PelmeniItem.pickupModelPrefab == (Object)null) { GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val2).name = "PelmeniDisplayPrefab"; val2.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); val2.GetComponent<Renderer>().material.color = new Color(1f, 0.9f, 0.6f); Object.DontDestroyOnLoad((Object)(object)val2); val2.SetActive(false); PelmeniItem.pickupModelPrefab = val2; } try { ItemTierDef val3 = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/Tier3Def.asset").WaitForCompletion(); FieldInfo field = typeof(ItemDef).GetField("_itemTierDef", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && (Object)(object)val3 != (Object)null) { field.SetValue(PelmeniItem, val3); } } catch { } PelmeniItem.hidden = false; PelmeniItem.canRemove = true; PelmeniItem.pickupIconSprite = LoadIconSprite(); PelmeniItem.tags = (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)2 }; ItemAPI.Add(new CustomItem(PelmeniItem, new ItemDisplayRuleDict((ItemDisplayRule[])null))); LanguageAPI.Add("ITEM_LADLEOFPELMENI_NAME", "Половник пельменей"); LanguageAPI.Add("ITEM_LADLEOFPELMENI_PICKUP", "Использование навыка мобильности оставляет кипящий котёл, который взрывается и лечит пельменями."); LanguageAPI.Add("ITEM_LADLEOFPELMENI_DESC", "При использовании <style=cIsUtility>вспомогательного навыка</style> оставляет <style=cIsDamage>кипящий котёл</style>, наносящий <style=cIsDamage>100% урона в секунду</style>. Через 3 секунды взрывается на <style=cIsDamage>300% <style=cStack>(+300% за стак)</style> урона</style> и разбрасывает <style=cIsHealing>3 <style=cStack>(+2 за стак)</style> пельменя</style>. Пельмени лечат <style=cIsHealing>5% здоровья</style> и дают <style=cIsUtility>+10% скорости атаки</style> на 5 секунд. Перезарядка: 6 секунд."); LanguageAPI.Add("ITEM_LADLEOFPELMENI_LORE", "Запись транскрипта: Логистический терминал UES «Safe Journeys»\nДата: 14.11.2056\nДело: Несанкционированный кулинарный груз #4881-B\n\n«— Сержант, вы хотите сказать, что этот чугунный котёл пережил прямое попадание плазменного заряда?\n— Не просто пережил, сэр. Он продолжил варить.\n— Варить... что именно?\n— По документам это проходило как \"Традиционный комплект высококалорийного питания образца Сибири, Земля\". Внутри находились замороженные тестовые подушечки с мясным наполнителем. В момент аварии система автономного кипячения котла активировалась автоматически.\n— И каков результат?\n— Радиус поражения — тридцать метров. Все монстры в зоне взрыва были аннигилированы высокой температурой и парным бульоном. А выжившие десантники... ну, они подкрепились и мгновенно вернулись в строй.\n— Отлично. Оставьте один котёл в капитанской каюте. И найдите где-нибудь сметану.»"); } private static void FixPrefabMaterials(GameObject modelPrefab) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)HGStandardShader == (Object)null) { return; } Renderer[] componentsInChildren = modelPrefab.GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)val != (Object)null && (Object)(object)val.sharedMaterial != (Object)null) { Material sharedMaterial = val.sharedMaterial; Texture mainTexture = sharedMaterial.mainTexture; sharedMaterial.shader = HGStandardShader; sharedMaterial.SetColor("_Color", Color.white); if ((Object)(object)mainTexture != (Object)null) { sharedMaterial.SetTexture("_MainTex", mainTexture); } sharedMaterial.EnableKeyword("DITHER"); } } } private static void SetupModelPanelParameters(GameObject modelPrefab) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) ModelPanelParameters val = modelPrefab.GetComponent<ModelPanelParameters>(); if (!Object.op_Implicit((Object)(object)val)) { val = modelPrefab.AddComponent<ModelPanelParameters>(); } Transform val2 = modelPrefab.transform.Find("FocusPoint"); if (!Object.op_Implicit((Object)(object)val2)) { GameObject val3 = new GameObject("FocusPoint"); val3.transform.SetParent(modelPrefab.transform, false); val3.transform.localPosition = Vector3.zero; val2 = val3.transform; } val.focusPointTransform = val2; Transform val4 = modelPrefab.transform.Find("CameraPosition"); if (!Object.op_Implicit((Object)(object)val4)) { GameObject val5 = new GameObject("CameraPosition"); val5.transform.SetParent(modelPrefab.transform, false); val5.transform.localPosition = new Vector3(0f, 0.2f, -1.8f); val4 = val5.transform; } val.cameraPositionTransform = val4; val.minDistance = 0.5f; val.maxDistance = 5f; } private void AddHooks() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_004c: 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_0057: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown object obj = <>c.<>9__17_0; if (obj == null) { hook_BuildDropTable val = delegate(orig_BuildDropTable orig, Run self) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_001a: 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_0050: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); PickupIndex val4 = PickupCatalog.FindPickupIndex(PelmeniItem.itemIndex); if (val4 != PickupIndex.none && self.availableTier3DropList != null && !self.availableTier3DropList.Contains(val4)) { self.availableTier3DropList.Add(val4); } }; <>c.<>9__17_0 = val; obj = (object)val; } Run.BuildDropTable += (hook_BuildDropTable)obj; CharacterBody.OnSkillActivated += (hook_OnSkillActivated)delegate(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { orig.Invoke(self, skill); if (Object.op_Implicit((Object)(object)self.inventory) && Object.op_Implicit((Object)(object)self.skillLocator) && (Object)(object)skill == (Object)(object)self.skillLocator.utility) { int itemCountEffective = self.inventory.GetItemCountEffective(PelmeniItem); if (itemCountEffective > 0) { PelmeniCooldown pelmeniCooldown = ((Component)self).GetComponent<PelmeniCooldown>(); if (!Object.op_Implicit((Object)(object)pelmeniCooldown)) { pelmeniCooldown = ((Component)self).gameObject.AddComponent<PelmeniCooldown>(); } if (pelmeniCooldown.CanUse()) { pelmeniCooldown.Reset(6f); if (NetworkServer.active) { SpawnLadle(self, itemCountEffective); } } } } }; object obj2 = <>c.<>9__17_2; if (obj2 == null) { hook_Update val2 = delegate(orig_Update orig, CharacterBody self) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (((NetworkBehaviour)self).isLocalPlayer && Enum.TryParse<KeyCode>("F3", out KeyCode result) && Input.GetKeyDown(result) && NetworkServer.active) { PickupIndex val4 = PickupCatalog.FindPickupIndex(PelmeniItem.itemIndex); Vector3 val5 = self.corePosition + ((Component)self).transform.forward * 2f; PickupDropletController.CreatePickupDroplet(val4, val5, new Vector3(0f, 5f, 0f)); } }; <>c.<>9__17_2 = val2; obj2 = (object)val2; } CharacterBody.Update += (hook_Update)obj2; object obj3 = <>c.<>9__17_3; if (obj3 == null) { StatHookEventHandler val3 = delegate(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(SatietyBuff)) { args.attackSpeedMultAdd += 0.1f; } }; <>c.<>9__17_3 = val3; obj3 = (object)val3; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj3; } private void SpawnLadle(CharacterBody body, int itemCount) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(LadleEntityPrefab, body.corePosition, Quaternion.identity); val.SetActive(true); LadleBehavior component = val.GetComponent<LadleBehavior>(); component.owner = body; component.itemCount = itemCount; NetworkServer.Spawn(val); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void LogInfo(object data) { _logSource.LogInfo(data); } } public class PelmeniCooldown : MonoBehaviour { private float timer = 0f; private void FixedUpdate() { if (timer > 0f) { timer -= Time.fixedDeltaTime; } } public bool CanUse() { return timer <= 0f; } public void Reset(float cd) { timer = cd; } } public class LadleBehavior : MonoBehaviour { public CharacterBody owner; public int itemCount; private float lifeTimer = 3f; private float tickTimer = 0f; private void FixedUpdate() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00ba: 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_00d0: 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_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_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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } if (!Object.op_Implicit((Object)(object)owner)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } tickTimer += Time.fixedDeltaTime; if (tickTimer >= 1f) { tickTimer = 0f; new BlastAttack { attacker = ((Component)owner).gameObject, inflictor = ((Component)this).gameObject, teamIndex = owner.teamComponent.teamIndex, baseDamage = owner.damage * 1f, baseForce = 0f, radius = 10f, crit = owner.RollCrit(), falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), position = ((Component)this).transform.position }.Fire(); } lifeTimer -= Time.fixedDeltaTime; if (lifeTimer <= 0f) { ExplodeAndSpawn(); } } private void ExplodeAndSpawn() { //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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //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_0039: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_008e: 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_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_00a1: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) new BlastAttack { attacker = ((Component)owner).gameObject, inflictor = ((Component)this).gameObject, teamIndex = owner.teamComponent.teamIndex, baseDamage = owner.damage * (3f + 3f * (float)(itemCount - 1)), baseForce = 1500f, radius = 10f, crit = owner.RollCrit(), falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), position = ((Component)this).transform.position }.Fire(); int num = 3 + 2 * (itemCount - 1); for (int i = 0; i < num; i++) { GameObject val = Object.Instantiate<GameObject>(LadleOfPelmeniPlugin.PelmenPrefab, ((Component)this).transform.position + Vector3.up * 1f, Quaternion.identity); val.SetActive(true); Rigidbody component = val.GetComponent<Rigidbody>(); component.velocity = new Vector3(Random.Range(-5f, 5f), Random.Range(5f, 10f), Random.Range(-5f, 5f)); PelmenBehavior component2 = val.GetComponent<PelmenBehavior>(); component2.teamIndex = owner.teamComponent.teamIndex; NetworkServer.Spawn(val); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class PelmenBehavior : MonoBehaviour { public TeamIndex teamIndex; private bool canPickup = false; private void Awake() { ((Component)this).GetComponent<Collider>().isTrigger = false; ((MonoBehaviour)this).Invoke("EnablePickup", 0.5f); if (NetworkServer.active) { Object.Destroy((Object)(object)((Component)this).gameObject, 15f); } } public void EnablePickup() { canPickup = true; ((Component)this).GetComponent<Collider>().isTrigger = true; Rigidbody component = ((Component)this).GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component)) { component.isKinematic = true; } } private void OnTriggerEnter(Collider other) { //IL_003f: 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_007c: 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) if (!NetworkServer.active || !canPickup) { return; } CharacterBody component = ((Component)other).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.teamComponent) && component.teamComponent.teamIndex == teamIndex) { if (Object.op_Implicit((Object)(object)component.healthComponent)) { component.healthComponent.Heal(component.healthComponent.fullHealth * 0.05f, default(ProcChainMask), true); } component.AddTimedBuff(LadleOfPelmeniPlugin.SatietyBuff, 5f); Object.Destroy((Object)(object)((Component)this).gameObject); } } } }