using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using Microsoft.CodeAnalysis; using R2API; using RoR2; using UnityEngine; 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("BalanceoItems")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BalanceoItems")] [assembly: AssemblyTitle("BalanceoItems")] [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 BalanceoItems { [BepInPlugin("com.miusario.BalanceoItems", "BalanceoItems", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { [HarmonyPatch(typeof(HealthComponent), "TakeDamage")] public class ModificarProyectilesPerforantes { private static void Prefix(HealthComponent __instance, DamageInfo damageInfo) { if (damageInfo == null || !((Object)(object)damageInfo.attacker != (Object)null)) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.inventory != (Object)null) { int itemCountEffective = component.inventory.GetItemCountEffective(Items.BossDamageBonus); if (itemCountEffective > 0 && (Object)(object)__instance.body != (Object)null && __instance.body.isBoss) { float num = 1f + 0.2f * (float)itemCountEffective; float num2 = 1.2f + 0.1f * (float)(itemCountEffective - 1); damageInfo.damage *= num2 / num; } } } } [HarmonyPatch(typeof(HealthComponent), "TakeDamage")] public class ModificarTuboDeMonedas { private static void Prefix(HealthComponent __instance, DamageInfo damageInfo) { if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.body != (Object)null && (Object)(object)__instance.body.inventory != (Object)null) { int itemCountEffective = __instance.body.inventory.GetItemCountEffective(Items.GoldOnHurt); if (itemCountEffective > 0) { damageInfo.damage *= 0.95f; } } } private static void Postfix(HealthComponent __instance, DamageInfo damageInfo) { if (damageInfo == null || damageInfo.rejected || !(damageInfo.damage > 0f) || !((Object)(object)__instance != (Object)null) || !((Object)(object)__instance.body != (Object)null) || !((Object)(object)__instance.body.master != (Object)null) || !((Object)(object)__instance.body.inventory != (Object)null)) { return; } int itemCountEffective = __instance.body.inventory.GetItemCountEffective(Items.GoldOnHurt); if (itemCountEffective > 0 && (Object)(object)Run.instance != (Object)null) { float difficultyCoefficient = Run.instance.difficultyCoefficient; uint num = (uint)(3f * (float)itemCountEffective * difficultyCoefficient); uint num2 = (uint)((6f + 4f * (float)(itemCountEffective - 1)) * difficultyCoefficient); if (num2 > num) { __instance.body.master.GiveMoney(num2 - num); } } } } [HarmonyPatch(typeof(HealthComponent), "TakeDamage")] public class ModificarCristalConcentracion { private static void Prefix(HealthComponent __instance, DamageInfo damageInfo) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) if (damageInfo == null || !((Object)(object)damageInfo.attacker != (Object)null)) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (!((Object)(object)component != (Object)null) || !((Object)(object)component.inventory != (Object)null)) { return; } int itemCountEffective = component.inventory.GetItemCountEffective(Items.NearbyDamageBonus); if (itemCountEffective > 0) { Vector3 val = damageInfo.attacker.transform.position - ((Component)__instance).transform.position; if (((Vector3)(ref val)).sqrMagnitude <= 169f) { float num = 1f + 0.2f * (float)itemCountEffective; float num2 = 1.25f + 0.2f * (float)(itemCountEffective - 1); damageInfo.damage *= num2 / num; } } } } [HarmonyPatch(typeof(HealthComponent), "TakeDamage")] public class PatchOpalo { private static void Prefix(HealthComponent __instance, DamageInfo damageInfo) { if (!((Object)(object)__instance != (Object)null) || !((Object)(object)__instance.body != (Object)null) || damageInfo == null || !(damageInfo.damage > 0f)) { return; } RastreadorOpalo component = ((Component)__instance.body).GetComponent(); if ((Object)(object)component != (Object)null) { int num = (Object.op_Implicit((Object)(object)__instance.body.inventory) ? __instance.body.inventory.GetItemCountEffective(Items.OutOfCombatArmor) : 0); if (num > 0) { component.ActivarProteccionExtra(); } } } } public class RastreadorOpalo : MonoBehaviour { private CharacterBody body = null; private bool estabaFueraDePeligro = false; public float TiempoArmaduraRestante { get; private set; } public float TiempoLatigoRestante { get; private set; } private void Awake() { body = ((Component)this).GetComponent(); } private void Update() { if (TiempoArmaduraRestante > 0f) { TiempoArmaduraRestante -= Time.deltaTime; } if (TiempoLatigoRestante > 0f) { TiempoLatigoRestante -= Time.deltaTime; } if ((Object)(object)body != (Object)null) { bool outOfDanger = body.outOfDanger; if (estabaFueraDePeligro && !outOfDanger) { TiempoLatigoRestante = 1.5f; } estabaFueraDePeligro = outOfDanger; } } public void ActivarProteccionExtra() { TiempoArmaduraRestante = 1.5f; } } [HarmonyPatch(typeof(GlobalEventManager), "OnHitEnemy")] public class ModificarProbabilidadesOnHit { private static IEnumerable Transpiler(IEnumerable instructions) { string itemActual = null; foreach (CodeInstruction instr in instructions) { if (instr.operand != null) { string opStr = instr.operand.ToString(); if (opStr.Contains("StickyBomb")) { itemActual = "StickyBomb"; } else if (opStr.Contains("StunChanceOnHit")) { itemActual = "StunChanceOnHit"; } } if (itemActual != null && CodeInstructionExtensions.LoadsConstant(instr, 5.0)) { instr.operand = 25f; itemActual = null; } yield return instr; } } } [HarmonyPatch(typeof(GlobalEventManager), "OnHitEnemy")] public class ModificarMarcaDeMuerte { private static IEnumerable Transpiler(IEnumerable instructions) { bool cercaDeDeathMark = false; foreach (CodeInstruction instr in instructions) { if (instr.operand != null && instr.operand.ToString().Contains("DeathMark")) { cercaDeDeathMark = true; } if (cercaDeDeathMark && CodeInstructionExtensions.LoadsConstant(instr, 4L)) { instr.opcode = OpCodes.Ldc_I4_2; instr.operand = null; cercaDeDeathMark = false; } yield return instr; } } } [HarmonyPatch(typeof(CharacterBody), "AddMultiKill")] public class DesactivarHombreraVanilla { private static IEnumerable Transpiler(IEnumerable instructions) { foreach (CodeInstruction instr in instructions) { if (CodeInstructionExtensions.LoadsConstant(instr, 3L)) { yield return new CodeInstruction(OpCodes.Ldc_I4, (object)9999); } else { yield return instr; } } } } [HarmonyPatch(typeof(GlobalEventManager), "OnHitEnemy")] public class ModificarCuracionGuadaña { private static IEnumerable Transpiler(IEnumerable instructions) { bool cercaDeHealOnCrit = false; int reemplazos = 0; foreach (CodeInstruction instr in instructions) { if (instr.operand != null && instr.operand.ToString().Contains("HealOnCrit")) { cercaDeHealOnCrit = true; } if (cercaDeHealOnCrit && CodeInstructionExtensions.LoadsConstant(instr, 4.0) && reemplazos < 2) { instr.operand = 5f; reemplazos++; if (reemplazos == 2) { cercaDeHealOnCrit = false; } } yield return instr; } } } [HarmonyPatch(typeof(GlobalEventManager), "OnHitEnemy")] public class ModificarSemillas { private static void Postfix(DamageInfo damageInfo) { //IL_00b4: 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) if (damageInfo == null || damageInfo.rejected || (Object)(object)damageInfo.attacker == (Object)null) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (!((Object)(object)component != (Object)null) || !((Object)(object)component.inventory != (Object)null) || !((Object)(object)component.healthComponent != (Object)null)) { return; } int itemCountEffective = component.inventory.GetItemCountEffective(Items.Seed); if (itemCountEffective > 0) { float num = 1f * (float)itemCountEffective; float num2 = 5f + (2f + (float)(itemCountEffective - 1)); float num3 = num2 - num; if (num3 > 0f) { component.healthComponent.Heal(num3, default(ProcChainMask), true); } } } } public class RastreadorHombrera : MonoBehaviour { [HarmonyPatch(typeof(GlobalEventManager), "OnCharacterDeath")] public class ModificarMascaraFeliz { private static IEnumerable Transpiler(IEnumerable instructions) { bool cercaDeGhostOnKill = false; foreach (CodeInstruction instr in instructions) { if (instr.operand != null && instr.operand.ToString().Contains("GhostOnKill")) { cercaDeGhostOnKill = true; } if (cercaDeGhostOnKill && CodeInstructionExtensions.LoadsConstant(instr, 7.0)) { instr.operand = 15f; cercaDeGhostOnKill = false; } yield return instr; } } } [HarmonyPatch(typeof(HealthComponent), "Heal")] public class ModificarEstanteRejuvenecedor { private static void Prefix(HealthComponent __instance, ref float amount) { if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.body != (Object)null && (Object)(object)__instance.body.inventory != (Object)null) { int itemCountEffective = __instance.body.inventory.GetItemCountEffective(Items.IncreaseHealing); if (itemCountEffective > 0) { float num = 1f + (float)itemCountEffective; float num2 = 2f + (float)itemCountEffective; amount *= num2 / num; } } } } [HarmonyPatch(typeof(GlobalEventManager), "OnCharacterDeath")] public class ModificarSusurrosSonoros { private static IEnumerable Transpiler(IEnumerable instructions) { bool cercaDeSusurros = false; foreach (CodeInstruction instr in instructions) { if (instr.operand != null && instr.operand.ToString().Contains("ItemDropChanceOnKill")) { cercaDeSusurros = true; } if (cercaDeSusurros && CodeInstructionExtensions.LoadsConstant(instr, 4.0)) { instr.operand = 10f; cercaDeSusurros = false; } yield return instr; } } } private CharacterBody body = null; private readonly List tiemposDeMuertes = new List(); private void Awake() { body = ((Component)this).GetComponent(); GlobalEventManager.onCharacterDeathGlobal += AlMorirAlguien; } private void OnDestroy() { GlobalEventManager.onCharacterDeathGlobal -= AlMorirAlguien; } private void AlMorirAlguien(DamageReport report) { if (!((Object)(object)report.attackerBody == (Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return; } int itemCountEffective = body.inventory.GetItemCountEffective(Items.WarCryOnMultiKill); if (itemCountEffective > 0) { tiemposDeMuertes.Add(Time.time); float tiempoActual = Time.time; tiemposDeMuertes.RemoveAll((float t) => tiempoActual - t > 7f); if (tiemposDeMuertes.Count >= 4) { tiemposDeMuertes.Clear(); float num = 2f + 4f * (float)itemCountEffective; body.AddTimedBuff(Buffs.WarCryBuff, num); } } } } public void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Harmony val = new Harmony("com.miusario.BalanceoItems"); val.PatchAll(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ModificarEstadisticas); ((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)ModificarRarezas); Language.onCurrentLanguageChanged += ActualizarDescripciones; Stage.onStageStartGlobal += RestablecerElixires; GlobalEventManager.onServerDamageDealt += CuracionGenesisLoop; CharacterBody.onBodyStartGlobal += delegate(CharacterBody body) { ((Component)body).gameObject.AddComponent(); }; CharacterBody.onBodyStartGlobal += delegate(CharacterBody body) { ((Component)body).gameObject.AddComponent(); ((Component)body).gameObject.AddComponent(); }; Debug.Log((object)"[BalanceoItems] Mod cargado correctamente."); } private void CuracionGenesisLoop(DamageReport report) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) if (report == null || report.damageInfo == null || (Object)(object)report.attackerBody == (Object)null || (Object)(object)report.damageInfo.inflictor == (Object)null || !((Object)report.damageInfo.inflictor).name.Contains("VagrantNovaItem")) { return; } int num = (Object.op_Implicit((Object)(object)report.attackerBody.inventory) ? report.attackerBody.inventory.GetItemCountEffective(Items.NovaOnLowHealth) : 0); if (num > 0) { float num2 = report.damageDealt * 0.15f; if (Object.op_Implicit((Object)(object)report.attackerBody.healthComponent) && num2 > 0f) { report.attackerBody.healthComponent.Heal(num2, default(ProcChainMask), true); } } } private void ModificarEstadisticas(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender == (Object)null || (Object)(object)sender.inventory == (Object)null) { return; } int itemCountEffective = sender.inventory.GetItemCountEffective(Items.BossDamageBonus); if (itemCountEffective > 0) { args.critAdd += 5f; } int itemCountEffective2 = sender.inventory.GetItemCountEffective(Items.FlatHealth); if (itemCountEffective2 > 0) { float num = 25f * (float)itemCountEffective2; float num2 = 45f + 35f * (float)(itemCountEffective2 - 1); args.baseHealthAdd += num2 - num; } int itemCountEffective3 = sender.inventory.GetItemCountEffective(Items.OutOfCombatArmor); if (itemCountEffective3 > 0) { RastreadorOpalo component = ((Component)sender).GetComponent(); if ((Object)(object)component != (Object)null && component.TiempoArmaduraRestante > 0f && !sender.HasBuff(Buffs.OutOfCombatArmorBuff)) { args.armorAdd += 100f * (float)itemCountEffective3; } } int itemCountEffective4 = sender.inventory.GetItemCountEffective(Items.AttackSpeedOnCrit); if (itemCountEffective4 > 0) { args.critAdd += 5f; } if (sender.HasBuff(Buffs.Energized)) { args.attackSpeedMultAdd += 0.8f; } int itemCountEffective5 = sender.inventory.GetItemCountEffective(Items.HealOnCrit); if (itemCountEffective5 > 0) { args.critAdd += 5f; } int itemCountEffective6 = sender.inventory.GetItemCountEffective(Items.SprintOutOfCombat); if (itemCountEffective6 > 0) { RastreadorOpalo component2 = ((Component)sender).GetComponent(); bool flag = (Object)(object)component2 != (Object)null && component2.TiempoLatigoRestante > 0f; if (!sender.outOfDanger && flag) { args.moveSpeedMultAdd += 0.3f * (float)itemCountEffective6; } } if (sender.HasBuff(Buffs.WarCryBuff)) { args.moveSpeedMultAdd -= 0.05f; args.attackSpeedMultAdd += 0.4f; } int itemCountEffective7 = sender.inventory.GetItemCountEffective(Items.Knurl); if (itemCountEffective7 > 0) { float num3 = 40f * (float)itemCountEffective7; float num4 = 85f + 60f * (float)(itemCountEffective7 - 1); args.baseHealthAdd += num4 - num3; float num5 = 1.6f * (float)itemCountEffective7; float num6 = 3f + 2.6f * (float)(itemCountEffective7 - 1); args.baseRegenAdd += num6 - num5; float maxHealth = sender.maxHealth; float num7 = Mathf.Floor(maxHealth / 100f); args.armorAdd += num7; } } private void ModificarRarezas() { ItemDef fragileDamageBonus = Items.FragileDamageBonus; if ((Object)(object)fragileDamageBonus != (Object)null) { fragileDamageBonus.tier = (ItemTier)3; } ItemDef jumpBoost = Items.JumpBoost; if ((Object)(object)jumpBoost != (Object)null) { jumpBoost.tier = (ItemTier)0; } ItemDef barrierOnOverHeal = Items.BarrierOnOverHeal; if ((Object)(object)barrierOnOverHeal != (Object)null) { barrierOnOverHeal.tier = (ItemTier)1; } ItemDef extraShrineItem = Items.ExtraShrineItem; if ((Object)(object)extraShrineItem != (Object)null) { extraShrineItem.tier = (ItemTier)0; } ItemDef extraStatsOnLevelUp = Items.ExtraStatsOnLevelUp; if ((Object)(object)extraStatsOnLevelUp != (Object)null) { extraStatsOnLevelUp.tier = (ItemTier)0; } Debug.Log((object)"[BalanceoItems] Varios Items cambiaron de Rareza."); } private void ActualizarDescripciones() { if (Language.currentLanguage != null) { Language.currentLanguage.SetStringByToken("ITEM_ATTACKSPEEDPERNEARBYALLYORENEMY_DESC", "Aumenta la velocidad de ataque un 10%(+3,5 % por acumulación) hasta 3 (+1 por acumulación) por cada aliado y enemigo en un radio de 20 metros."); Language.currentLanguage.SetStringByToken("ITEM_BOSSDAMAGEBONUS_DESC", "Aumenta el daño a jefes en 20% (+10% por acumulación) y otorga 5% de probabilidad de golpe crítico."); Language.currentLanguage.SetStringByToken("ITEM_GOLDONHURT_DESC", "Reduce el daño recibido en 5% y otorga 6 monedas (+4 por acumulación) al recibir daño."); Language.currentLanguage.SetStringByToken("ITEM_HEALINGPOTION_DESC", "Recibir daño que te deje debajo del 25% de tu salud máxima consumirá este objeto y te curará 75% de tu salud máxima. Este objeto se restaura cada ronda."); Language.currentLanguage.SetStringByToken("ITEM_FLATHEALTH_DESC", "Aumenta la salud máxima en 45 (+35 por acumulación)."); Language.currentLanguage.SetStringByToken("ITEM_NEARBYDAMAGEBONUS_DESC", "Aumenta el daño que le haces a los enemigos dentro de un radio de 13 metros en un 25% (+20% por acumulación)."); Language.currentLanguage.SetStringByToken("ITEM_OUTOFCOMBATARMOR_DESC", "Al estar fuera de peligro, aumenta la armadura en 100 (+100 por acumulación). Al entrar en combate esta bonificación dura 1,5s."); Language.currentLanguage.SetStringByToken("ITEM_STICKYBOMB_DESC", "Al impactar,hay una probabilidad del 25% (+5% por acumulación) de fijar una bomba a un enemigo, detonándola e infligiendo un 180% de daño TOTAL."); Language.currentLanguage.SetStringByToken("ITEM_STUNCHANCEONHIT_DESC", "Al impactar, hay una probabilidad del 25% (+5% por acumulación) de aturdir a un enemigo durante 2 segundos."); Language.currentLanguage.SetStringByToken("ITEM_ATTACKSPEEDONCRIT_DESC", "los golpes críticos aumentan la velocidad de ataque en un 12%. Limite máximo de 36% (+12% por acumulación) de velocidad de ataque. Obtienes 10% de probabilidad de crítico."); Language.currentLanguage.SetStringByToken("ITEM_DEATHMARK_DESC", "Los enemigos con 2 o más penalizaciones tienen una marca de muerte que aumenta el daño que reciban de cualquier fuente en un 50% durante 7 (+7 por acumulación) segundos."); Language.currentLanguage.SetStringByToken("ITEM_ENERGIZEDONEQUIPMENTUSE_DESC", "Activar tu equipamiento te concede un incremento de +150 % de velocidad de ataque durante 8 s (+4 s por acumulación)."); Language.currentLanguage.SetStringByToken("ITEM_HEALONCRIT_DESC", "Obtienes 10% de probabilidad de crítico. Los golpes críticos te curan 10 (+5 por acumulación) de salud."); Language.currentLanguage.SetStringByToken("ITEM_SEED_DESC", "Infligir daño te cura 5 (+2 por acumulación) puntos de salud."); Language.currentLanguage.SetStringByToken("ITEM_SPRINTOUTOFCOMBAT_DESC", "Al estar fuera de peligro, aumenta la velocidad de movimiento en un 30% (+30% por acumulación). Al entrar en combate esta bonificación dura 1,5s."); Language.currentLanguage.SetStringByToken("ITEM_WARCRYONMULTIKILL_DESC", "Matar a 4 enemigos en 7 segundos te enfurece con +45 % de velocidad de movimiento y +140 % de velocidad de ataque durante 6 s (+4 s por acumulación)."); Language.currentLanguage.SetStringByToken("ITEM_EXTRALIFE_DESC", "Al morir, este objeto se consumirá y reviviras con 3 segundos de invulnerabilidad. Este objeto se restaura cada ronda."); Language.currentLanguage.SetStringByToken("ITEM_GHOSTONKILL_DESC", "Tras matar a un enemigo hay un 15% de probabilidad de hacer aparecer un fantasma del enemigo que hayas matado con un 1500% de daño. Dura 30s (+30s por acumulación)."); Language.currentLanguage.SetStringByToken("ITEM_INCREASEHEALING_DESC", "Aumenta la eficacia de la curación en un 200% (+100% por acumulación)."); Language.currentLanguage.SetStringByToken("ITEM_ITEMDROPCHANCEONKILL_DESC", "Al matar a un Jefe o a un enemigo de élite, hay un 10% (+4% por acumulación) de probabilidad de que suelte un objeto."); Language.currentLanguage.SetStringByToken("ITEM_KNURL_DESC", "Aumenta la salud máxima en 85 (+60 por acumulación) y la regeneración de salud en 3 (+2,6 por acumulación). Además, aumenta la armadura en 1 por cada 35 de salud máxima."); Language.currentLanguage.SetStringByToken("ITEM_NOVAONLOWHEALTH_DESC", "Bajar del 15% de salud hace que explotes, infligiendo 6000% de daño base. Este efecto te curara un 15% del daño infligido. Se recarga cada 30 s (-50% por acumulación)."); } } private static void RestablecerElixires(Stage _) { //IL_00ab: 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_0105: 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) if (!NetworkServer.active) { return; } foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.inventory)) { Inventory inventory = instance.master.inventory; int itemCountPermanent = inventory.GetItemCountPermanent(Items.HealingPotionConsumed); if (itemCountPermanent > 0) { inventory.RemoveItemPermanent(Items.HealingPotionConsumed, itemCountPermanent); inventory.GiveItemPermanent(Items.HealingPotion, itemCountPermanent); CharacterMasterNotificationQueue.SendTransformNotification(instance.master, Items.HealingPotionConsumed.itemIndex, Items.HealingPotion.itemIndex, (TransformationType)0); } int itemCountPermanent2 = inventory.GetItemCountPermanent(Items.ExtraLifeConsumed); if (itemCountPermanent2 > 0) { inventory.RemoveItemPermanent(Items.ExtraLifeConsumed, itemCountPermanent2); inventory.GiveItemPermanent(Items.ExtraLife, itemCountPermanent2); CharacterMasterNotificationQueue.SendTransformNotification(instance.master, Items.ExtraLifeConsumed.itemIndex, Items.ExtraLife.itemIndex, (TransformationType)0); } } } } } }